[PATCHv3 blktests] loop/011: skip if running on kernel older than v6.9.11

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



The loop/011 is regression test for commit 5f75e081ab5c ("loop: Disable
fallocate() zero and discard if not supported") which requires minimum
kernel version 6.9.11. So running this test on kernel version older than
v6.9.11 would FAIL. This patch ensures that we skip running loop/011 if
kernel version is older than v6.9.11.

Link: https://lore.kernel.org/all/20240731111804.1161524-1-nilay@xxxxxxxxxxxxx/
Signed-off-by: Nilay Shroff <nilay@xxxxxxxxxxxxx>
---
    Changes from v2:
      - add a comment explaining why the kernel version check is present (Bart)
    Changes from v1:
      - loop/011 requires minimum kernel version 6.9.11 (Cyril, Shinichiro)
---
 tests/loop/011 | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/tests/loop/011 b/tests/loop/011
index 35eb39b..fe4d6d6 100755
--- a/tests/loop/011
+++ b/tests/loop/011
@@ -3,12 +3,16 @@
 # Copyright (C) 2024 Cyril Hrubis
 #
 # Regression test for the commit 5f75e081ab5c ("loop: Disable fallocate() zero
-# and discard if not supported").
+# and discard if not supported"). This commit is merged into the kernel v6.10
+# and later backported to kernel v6.9.11. Running this test on a kernel older
+# than v6.9.11 would obviously fail, so we enforce that this test is skipped
+# if it's started on a kernel version older than v6.9.11.
 
 . tests/loop/rc
 DESCRIPTION="Make sure unsupported backing file fallocate does not fill dmesg with errors"
 
 requires() {
+	_have_kver 6 9 11
 	_have_program mkfs.ext2
 }
 
-- 
2.45.2





[Index of Archives]     [Linux RAID]     [Linux SCSI]     [Linux ATA RAID]     [IDE]     [Linux Wireless]     [Linux Kernel]     [ATH6KL]     [Linux Bluetooth]     [Linux Netdev]     [Kernel Newbies]     [Security]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Device Mapper]

  Powered by Linux