diff mbox series

[blktests,2/4] tests, common: Get rid of _have_null_blk

Message ID 20250107061905.91316-3-lizhijian@fujitsu.com (mailing list archive)
State New
Headers show
Series Cleanup and Optimization in requires() | expand

Commit Message

Li Zhijian Jan. 7, 2025, 6:19 a.m. UTC
- _have_null_blk is same with _have_driver null_blk, it seems there is no
a strong opinion to keep it.
- In addition, '_have_module_param null_blk' will test _have_driver first,
  that means it's safe to remove its former _have_driver in require()

Signed-off-by: Li Zhijian <lizhijian@fujitsu.com>
---
 common/null_blk | 4 ----
 tests/block/006 | 2 +-
 tests/block/010 | 2 +-
 tests/block/014 | 2 +-
 tests/block/015 | 2 +-
 tests/block/016 | 2 +-
 tests/block/017 | 2 +-
 tests/block/018 | 2 +-
 tests/block/020 | 2 +-
 tests/block/021 | 2 +-
 tests/block/022 | 2 +-
 tests/block/023 | 2 +-
 tests/block/024 | 2 +-
 tests/block/029 | 2 +-
 tests/block/030 | 2 +-
 tests/block/031 | 2 +-
 tests/block/038 | 2 +-
 tests/throtl/rc | 2 +-
 tests/zbd/rc    | 2 +-
 19 files changed, 18 insertions(+), 22 deletions(-)
diff mbox series

Patch

diff --git a/common/null_blk b/common/null_blk
index 164125df562d..2b5f57721c25 100644
--- a/common/null_blk
+++ b/common/null_blk
@@ -6,10 +6,6 @@ 
 
 . common/shellcheck
 
-_have_null_blk() {
-	_have_driver null_blk
-}
-
 _have_null_blk_feature() {
 	# Ensure that null_blk driver is built-in or loaded
 	if ! [[ -d /sys/module/null_blk ]]; then
diff --git a/tests/block/006 b/tests/block/006
index 7d05b1113fb9..da909c2a0dca 100755
--- a/tests/block/006
+++ b/tests/block/006
@@ -15,7 +15,7 @@  TIMED=1
 CAN_BE_ZONED=1
 
 requires() {
-	_have_null_blk && _have_module_param null_blk blocking && _have_fio
+	_have_module_param null_blk blocking && _have_fio
 }
 
 test() {
diff --git a/tests/block/010 b/tests/block/010
index ed5613525255..4214c17e83a5 100755
--- a/tests/block/010
+++ b/tests/block/010
@@ -15,7 +15,7 @@  TIMED=1
 CAN_BE_ZONED=1
 
 requires() {
-	_have_null_blk && _have_module_param null_blk shared_tags && _have_fio
+	_have_module_param null_blk shared_tags && _have_fio
 }
 
 run_fio_job() {
diff --git a/tests/block/014 b/tests/block/014
index cac779b5e0f2..b118dce8f6f4 100755
--- a/tests/block/014
+++ b/tests/block/014
@@ -10,7 +10,7 @@ 
 DESCRIPTION="run null-blk with blk-mq and timeout injection configured"
 
 requires() {
-	_have_null_blk && _have_module_param null_blk timeout
+	_have_module_param null_blk timeout
 }
 
 test() {
diff --git a/tests/block/015 b/tests/block/015
index afb4b82ccb5b..f5b2592542e4 100755
--- a/tests/block/015
+++ b/tests/block/015
@@ -12,7 +12,7 @@  DESCRIPTION="run null-blk on different schedulers with requeue injection configu
 QUICK=1
 
 requires() {
-	_have_null_blk && _have_module_param null_blk requeue
+	_have_module_param null_blk requeue
 }
 
 test() {
diff --git a/tests/block/016 b/tests/block/016
index 775069c386bf..4a66218de42b 100755
--- a/tests/block/016
+++ b/tests/block/016
@@ -14,7 +14,7 @@  QUICK=1
 CAN_BE_ZONED=1
 
 requires() {
-	_have_null_blk
+	_have_driver null_blk
 }
 
 test() {
diff --git a/tests/block/017 b/tests/block/017
index 59429b0f1359..52ed0056e37c 100755
--- a/tests/block/017
+++ b/tests/block/017
@@ -14,7 +14,7 @@  QUICK=1
 CAN_BE_ZONED=1
 
 requires() {
-	_have_null_blk
+	_have_driver null_blk
 }
 
 show_inflight() {
diff --git a/tests/block/018 b/tests/block/018
index e7ac44521cae..e076714d76e0 100755
--- a/tests/block/018
+++ b/tests/block/018
@@ -11,7 +11,7 @@  DESCRIPTION="do I/O and check iostats times"
 QUICK=1
 
 requires() {
-	_have_null_blk
+	_have_driver null_blk
 }
 
 init_times() {
diff --git a/tests/block/020 b/tests/block/020
index 5ffa23248804..a59e73bdffb8 100755
--- a/tests/block/020
+++ b/tests/block/020
@@ -14,7 +14,7 @@  QUICK=1
 CAN_BE_ZONED=1
 
 requires() {
-	_have_null_blk && _have_fio
+	_have_driver null_blk && _have_fio
 }
 
 test() {
diff --git a/tests/block/021 b/tests/block/021
index 525d707bce8a..b5b0ee82cbfc 100755
--- a/tests/block/021
+++ b/tests/block/021
@@ -14,7 +14,7 @@  QUICK=1
 CAN_BE_ZONED=1
 
 requires() {
-	_have_null_blk
+	_have_driver null_blk
 }
 
 test() {
diff --git a/tests/block/022 b/tests/block/022
index 10851ff06ac1..42032c6c1ce0 100755
--- a/tests/block/022
+++ b/tests/block/022
@@ -12,7 +12,7 @@  DESCRIPTION="Test hang caused by freeze/unfreeze sequence"
 TIMED=1
 
 requires() {
-	_have_null_blk && _have_module_param null_blk shared_tags
+	_have_module_param null_blk shared_tags
 	_require_min_cpus 2
 }
 
diff --git a/tests/block/023 b/tests/block/023
index db1cbe04d5d8..ef48a7a77ed5 100755
--- a/tests/block/023
+++ b/tests/block/023
@@ -13,7 +13,7 @@  QUICK=1
 CAN_BE_ZONED=1
 
 requires() {
-	_have_null_blk
+	_have_driver null_blk
 }
 
 test() {
diff --git a/tests/block/024 b/tests/block/024
index 2a7c934a42ca..8a303e24b6d6 100755
--- a/tests/block/024
+++ b/tests/block/024
@@ -13,7 +13,7 @@  DESCRIPTION="do I/O faster than a jiffy and check iostats times"
 QUICK=1
 
 requires() {
-	_have_null_blk
+	_have_driver null_blk
 }
 
 init_times() {
diff --git a/tests/block/029 b/tests/block/029
index b9a897dbf830..487ebc9ec326 100755
--- a/tests/block/029
+++ b/tests/block/029
@@ -11,7 +11,7 @@  DESCRIPTION="trigger blk_mq_update_nr_hw_queues()"
 QUICK=1
 
 requires() {
-	_have_fio && _have_null_blk
+	_have_fio && _have_driver null_blk
 }
 
 modify_nr_hw_queues() {
diff --git a/tests/block/030 b/tests/block/030
index 82330c2736b2..b9974b5d18e4 100755
--- a/tests/block/030
+++ b/tests/block/030
@@ -13,7 +13,7 @@  DESCRIPTION="trigger the blk_mq_realloc_hw_ctxs() error path"
 QUICK=1
 
 requires() {
-	_have_null_blk && _have_module_param null_blk init_hctx
+	_have_module_param null_blk init_hctx
 }
 
 test() {
diff --git a/tests/block/031 b/tests/block/031
index 99615ec12c34..58503e6db905 100755
--- a/tests/block/031
+++ b/tests/block/031
@@ -12,7 +12,7 @@  TIMED=1
 
 requires() {
 	_have_fio
-	_have_null_blk
+	_have_driver null_blk
 	if ! _have_null_blk_feature shared_tag_bitmap; then
 		_have_module_param null_blk shared_tag_bitmap
 	fi
diff --git a/tests/block/038 b/tests/block/038
index 56272bebb14c..fbe240c89429 100755
--- a/tests/block/038
+++ b/tests/block/038
@@ -12,7 +12,7 @@  DESCRIPTION="Test null-blk concurrent power/submit_queues operations"
 QUICK=1
 
 requires() {
-	_have_null_blk
+	_have_driver null_blk
 	if ! _have_null_blk_feature submit_queues; then
 		SKIP_REASONS+=("null_blk does not support submit_queues")
 	fi
diff --git a/tests/throtl/rc b/tests/throtl/rc
index 9c264bd39f07..4cf275216cc2 100644
--- a/tests/throtl/rc
+++ b/tests/throtl/rc
@@ -15,7 +15,7 @@  declare THROTL_CLEAR_CGROUP2_DIR_CONTROL_IO
 
 group_requires() {
 	_have_root
-	_have_null_blk
+	_have_driver null_blk
 	_have_kernel_option BLK_DEV_THROTTLING
 	_have_cgroup2_controller io
 	_have_program bc
diff --git a/tests/zbd/rc b/tests/zbd/rc
index 570928b37c88..b748d55da2c1 100644
--- a/tests/zbd/rc
+++ b/tests/zbd/rc
@@ -14,7 +14,7 @@ 
 
 group_requires() {
 	_have_root && _have_program blkzone && _have_program dd &&
-		_have_kernel_option BLK_DEV_ZONED && _have_null_blk &&
+		_have_kernel_option BLK_DEV_ZONED && _have_driver null_blk &&
 		_have_module_param null_blk zoned
 }