]> www.infradead.org Git - users/sagi/blktests.git/commitdiff
common/scsi_debug, tests/*: re-define _have_scsi_debug
authorShin'ichiro Kawasaki <shinichiro.kawasaki@wdc.com>
Tue, 25 Apr 2023 11:47:41 +0000 (20:47 +0900)
committerShin'ichiro Kawasaki <shinichiro.kawasaki@wdc.com>
Mon, 22 May 2023 06:42:59 +0000 (15:42 +0900)
As a preparation to adapt test cases to built-in scsi_debug module, re-
define the _have_scsi_debug function. It checks that the scsi_debug
module is built as a loadable module. Modify it to check that the
scsi_debug module is available as built-in module or loadable module.

Also replace all _have_scsi_debug calls in test cases with
"_have_module scsi_debug" so that the change of _have_scsi_debug do not
affect the test cases. Following commits will modify them to call
_have_scsi_debug, only for test cases ready to run with built-in
scsi_debug.

Reviewed-by: Chaitanya Kulkarni <kch@nvidia.com>
Signed-off-by: Shin'ichiro Kawasaki <shinichiro.kawasaki@wdc.com>
15 files changed:
common/scsi_debug
tests/block/001
tests/block/002
tests/block/009
tests/block/025
tests/block/027
tests/block/028
tests/block/032
tests/loop/004
tests/scsi/004
tests/scsi/005
tests/scsi/007
tests/zbd/008
tests/zbd/009
tests/zbd/010

index ae13bb624b3d349df5822e5d6fdda6e363f6a2b0..5f733547b58430eb1562256b03a38248f58e1a4a 100644 (file)
@@ -5,7 +5,7 @@
 # scsi_debug helper functions.
 
 _have_scsi_debug() {
-       _have_module scsi_debug
+       _have_driver scsi_debug
 }
 
 _init_scsi_debug() {
index fb93932b39c3d67759beac28ae61927a58dd747d..2ea3754dbff188b3cf7047b5cb32650f1d068d8a 100755 (executable)
@@ -13,7 +13,7 @@ DESCRIPTION="stress device hotplugging"
 TIMED=1
 
 requires() {
-       _have_scsi_debug
+       _have_module scsi_debug
        _have_driver sd_mod
        _have_driver sr_mod
 }
index 05d00d2e27b46871a9f836e4254a44fa5967542a..a5f3ee5e32fcf22fe37491ba2477fdb67f3f5058 100755 (executable)
@@ -12,7 +12,8 @@ DESCRIPTION="remove a device while running blktrace"
 QUICK=1
 
 requires() {
-       _have_blktrace && _have_scsi_debug
+       _have_blktrace
+       _have_module scsi_debug
 }
 
 test() {
index df36edbf661649232adbe1cd79aec0d70f1ea81d..d3ea42a5a6f8db5d439b59e1ac81bf84b175d04c 100755 (executable)
@@ -12,7 +12,8 @@
 DESCRIPTION="check page-cache coherency after BLKDISCARD"
 
 requires() {
-       _have_scsi_debug && _have_program xfs_io
+       _have_module scsi_debug
+       _have_program xfs_io
 }
 
 test() {
index f746c1c4a2b952ce610dfa4ac0f18bd2f5d57183..4c48e9f9a5e76cb1fee0fe06c421a27607b9e470 100755 (executable)
@@ -12,7 +12,7 @@
 DESCRIPTION="do a huge discard with 4k sector size"
 
 requires() {
-       _have_scsi_debug
+       _have_module scsi_debug
 }
 
 test() {
index b60f62c1caa2fc4218b36d5e27ac1a3f82ddc64b..ab6369b83edbb87c328c35176337cb81bdac6de6 100755 (executable)
@@ -19,7 +19,9 @@ QUICK=1
 CAN_BE_ZONED=1
 
 requires() {
-       _have_cgroup2_controller io && _have_scsi_debug && _have_fio
+       _have_cgroup2_controller io
+       _have_module scsi_debug
+       _have_fio
 }
 
 scsi_debug_stress_remove() {
index 5140d941b366b458c34749b7c31b3cd094af7fe6..13b32787aa1a62a4a9b2773371836d80c010822d 100755 (executable)
@@ -12,7 +12,7 @@ DESCRIPTION="do I/O on scsi_debug with DIF/DIX enabled"
 DMESG_FILTER="sed -r 's/(guard tag error at sector|ref tag error at location)/blktests failure: \\1/'"
 
 requires() {
-       _have_scsi_debug
+       _have_module scsi_debug
 }
 
 test_pi() {
index b07b7ab0246254f58a6c9182d17707b3a55669f9..8975879660d7835e0cfb7d13cc22ee596cc6eb93 100755 (executable)
@@ -13,7 +13,8 @@ DESCRIPTION="remove one mounted device"
 QUICK=1
 
 requires() {
-       _have_xfs && _have_scsi_debug
+       _have_xfs
+       _have_module scsi_debug
 }
 
 test() {
index fab34e806da24b48c521ae79656d53615cca1443..ca52d80bec6fcc0ef3c82b7516a1408738c7c123 100755 (executable)
@@ -11,7 +11,10 @@ DESCRIPTION="combine loop direct I/O mode and a custom block size"
 QUICK=1
 
 requires() {
-       _have_program xfs_io && _have_scsi_debug && _have_src_program loblksize && _have_loop_set_block_size
+       _have_program xfs_io
+       _have_module scsi_debug
+       _have_src_program loblksize
+       _have_loop_set_block_size
 }
 
 test() {
index b5ef2dd006de5e4f22dc44b2cb5c978266aa5e49..f0845c127706e825bd093a9d4b5875b7963a8923 100755 (executable)
@@ -18,7 +18,7 @@ DESCRIPTION="ensure repeated TASK SET FULL results in EIO on timing out command"
 CAN_BE_ZONED=1
 
 requires() {
-       _have_scsi_debug
+       _have_module scsi_debug
 }
 
 test() {
index 22fb495ff73b0fc3beb1d814fa07ac3c7354fcdf..efd3d82873648aa1b393dcecb2202e3fb54b3b5e 100755 (executable)
@@ -11,7 +11,8 @@ DESCRIPTION="test SCSI device blacklisting"
 QUICK=1
 
 requires() {
-       _have_scsi_debug && _have_module_param scsi_debug inq_vendor
+       _have_module scsi_debug
+       _have_module_param scsi_debug inq_vendor
 }
 
 test() {
index e7088a124486f689af66571706079964ae5408f8..547a7357140c75ee53959f08c46aef2a3f78f8dd 100755 (executable)
@@ -12,7 +12,7 @@ DESCRIPTION="Trigger the SCSI error handler"
 QUICK=1
 
 requires() {
-       _have_scsi_debug
+       _have_module scsi_debug
 }
 
 config_hz() {
index c625bad59592d5f89d901227ad6d0b87fcc6d903..55b5b6ca6f019b5d181ae85218669c1ffd0f64a3 100755 (executable)
@@ -13,8 +13,9 @@ DESCRIPTION="check no stale page cache after BLKZONERESET and data read race"
 TIMED=1
 
 requires() {
-       _have_scsi_debug && _have_module_param scsi_debug zbc &&
-               _have_program xfs_io
+       _have_module scsi_debug
+       _have_module_param scsi_debug zbc
+       _have_program xfs_io
 }
 
 test() {
index 483cbf677b0fee8937b6b845773198cf99ccece4..c0ce1f21e3786d0b9fd5dac84c59202652374730 100755 (executable)
@@ -36,7 +36,7 @@ requires() {
        _have_driver btrfs
        _have_module_param scsi_debug zone_cap_mb
        _have_program mkfs.btrfs
-       _have_scsi_debug
+       _have_module scsi_debug
        have_good_mkfs_btrfs
 }
 
index 35143b8e496fc286db02abe6cf38cd377fb13cd8..c5cb76a00acccce6459972be4d3914cb53f54046 100755 (executable)
@@ -15,7 +15,7 @@ requires() {
        _have_module null_blk
        _have_module_param scsi_debug zone_cap_mb
        _have_program mkfs.f2fs
-       _have_scsi_debug
+       _have_module scsi_debug
 }
 
 test() {