diff mbox series

[blktests,v2,6/6] block/{001,002,027}: allow to run with built-in scsi_debug and sd_mod

Message ID 20230426100611.2120-1-shinichiro@fastmail.com
State New
Headers show
Series [blktests,v2,1/6] common/rc: skip module file check if modules path does not exist | expand

Commit Message

Shin'ichiro Kawasaki April 26, 2023, 10:06 a.m. UTC
From: Shin'ichiro Kawasaki <shinichiro.kawasaki@wdc.com>

To allow the test cases run with build-in scsi_debug, replace
'_have_module scsi_debug' with _have_scsi_debug, and replace
_init_scsi_debug with _configure_scsi_debug.

Also to allow block/001 run with built-in sd_mod, replace
'_have_module sd_mod' with '_have_kernel_option BLK_DEV_SD'. When sd_mod
driver is built-in, /sys/module/sd_mod directory is not created. Then
_have_driver() can not detect availability of the driver. Instead, refer
the kernel config to check availability of the driver.

Signed-off-by: Shin'ichiro Kawasaki <shinichiro.kawasaki@wdc.com>
Reviewed-by: Chaitanya Kulkarni <kch@nvidia.com>
---
 tests/block/001 | 6 +++---
 tests/block/002 | 4 ++--
 tests/block/027 | 4 ++--
 3 files changed, 7 insertions(+), 7 deletions(-)

Comments

Johannes Thumshirn May 23, 2023, 9:22 a.m. UTC | #1
Looks good,
Reviewed-by: Johannes Thumshirn <johannes.thumshirn@wdc.com>
diff mbox series

Patch

diff --git a/tests/block/001 b/tests/block/001
index 2ea3754..32dd22f 100755
--- a/tests/block/001
+++ b/tests/block/001
@@ -13,13 +13,13 @@  DESCRIPTION="stress device hotplugging"
 TIMED=1
 
 requires() {
-	_have_module scsi_debug
-	_have_driver sd_mod
+	_have_scsi_debug
+	_have_kernel_option BLK_DEV_SD
 	_have_driver sr_mod
 }
 
 stress_scsi_debug() {
-	if ! _init_scsi_debug "$@"; then
+	if ! _configure_scsi_debug "$@"; then
 		return
 	fi
 
diff --git a/tests/block/002 b/tests/block/002
index a5f3ee5..b16d014 100755
--- a/tests/block/002
+++ b/tests/block/002
@@ -13,13 +13,13 @@  QUICK=1
 
 requires() {
 	_have_blktrace
-	_have_module scsi_debug
+	_have_scsi_debug
 }
 
 test() {
 	echo "Running ${TEST_NAME}"
 
-	if ! _init_scsi_debug delay=0; then
+	if ! _configure_scsi_debug delay=0; then
 		return 1
 	fi
 
diff --git a/tests/block/027 b/tests/block/027
index ab6369b..a79a115 100755
--- a/tests/block/027
+++ b/tests/block/027
@@ -20,12 +20,12 @@  CAN_BE_ZONED=1
 
 requires() {
 	_have_cgroup2_controller io
-	_have_module scsi_debug
+	_have_scsi_debug
 	_have_fio
 }
 
 scsi_debug_stress_remove() {
-	if ! _init_scsi_debug "$@"; then
+	if ! _configure_scsi_debug "$@"; then
 		return
 	fi