[PATCH blktests 2/2] nvme: convert tests to use _have_kernel_options

Chaitanya Kulkarni ckulkarnilinux at gmail.com
Sat Nov 8 02:00:34 PST 2025


Convert multiple _have_kernel_option calls in nvme tests to use the new
_have_kernel_options helper function for more concise code.

Modified tests:
nvme/039: FAULT_INJECTION, FAULT_INJECTION_DEBUG_FS
nvme/041: NVME_AUTH, NVME_TARGET_AUTH
nvme/042: NVME_AUTH, NVME_TARGET_AUTH
nvme/043: NVME_AUTH, NVME_TARGET_AUTH
nvme/044: NVME_AUTH, NVME_TARGET_AUTH
nvme/045: NVME_AUTH, NVME_TARGET_AUTH
nvme/050: FAIL_IO_TIMEOUT, FAULT_INJECTION_DEBUG_FS
nvme/062: NVME_TCP_TLS, NVME_TARGET_TCP_TLS
nvme/063: NVME_AUTH, NVME_TCP_TLS, NVME_TARGET_AUTH, NVME_TARGET_TCP_TLS

Signed-off-by: Chaitanya Kulkarni <ckulkarnilinux at gmail.com>
---
 tests/nvme/039 | 3 +--
 tests/nvme/041 | 3 +--
 tests/nvme/042 | 3 +--
 tests/nvme/043 | 3 +--
 tests/nvme/044 | 3 +--
 tests/nvme/045 | 3 +--
 tests/nvme/050 | 3 +--
 tests/nvme/062 | 3 +--
 tests/nvme/063 | 6 ++----
 9 files changed, 10 insertions(+), 20 deletions(-)

diff --git a/tests/nvme/039 b/tests/nvme/039
index ab58f3b..98e5d28 100755
--- a/tests/nvme/039
+++ b/tests/nvme/039
@@ -14,8 +14,7 @@ QUICK=1
 
 requires() {
 	_have_program nvme
-	_have_kernel_option FAULT_INJECTION
-	_have_kernel_option FAULT_INJECTION_DEBUG_FS
+	_have_kernel_options FAULT_INJECTION FAULT_INJECTION_DEBUG_FS
 }
 
 device_requires() {
diff --git a/tests/nvme/041 b/tests/nvme/041
index 6855a47..8f908c5 100755
--- a/tests/nvme/041
+++ b/tests/nvme/041
@@ -12,8 +12,7 @@ QUICK=1
 requires() {
 	_nvme_requires
 	_have_loop
-	_have_kernel_option NVME_AUTH
-	_have_kernel_option NVME_TARGET_AUTH
+	_have_kernel_options NVME_AUTH NVME_TARGET_AUTH
 	_require_kernel_nvme_fabrics_feature dhchap_ctrl_secret
 	_require_nvme_trtype_is_fabrics
 	_require_nvme_cli_auth
diff --git a/tests/nvme/042 b/tests/nvme/042
index 17d8a73..34d6684 100755
--- a/tests/nvme/042
+++ b/tests/nvme/042
@@ -12,8 +12,7 @@ QUICK=1
 requires() {
 	_nvme_requires
 	_have_loop
-	_have_kernel_option NVME_AUTH
-	_have_kernel_option NVME_TARGET_AUTH
+	_have_kernel_options NVME_AUTH NVME_TARGET_AUTH
 	_require_kernel_nvme_fabrics_feature dhchap_ctrl_secret
 	_require_nvme_trtype_is_fabrics
 	_require_nvme_cli_auth
diff --git a/tests/nvme/043 b/tests/nvme/043
index 7f9e67e..616f7e7 100755
--- a/tests/nvme/043
+++ b/tests/nvme/043
@@ -12,8 +12,7 @@ QUICK=1
 requires() {
 	_nvme_requires
 	_have_loop
-	_have_kernel_option NVME_AUTH
-	_have_kernel_option NVME_TARGET_AUTH
+	_have_kernel_options NVME_AUTH NVME_TARGET_AUTH
 	_require_kernel_nvme_fabrics_feature dhchap_ctrl_secret
 	_require_nvme_trtype_is_fabrics
 	_require_nvme_cli_auth
diff --git a/tests/nvme/044 b/tests/nvme/044
index 1352910..4727dbf 100755
--- a/tests/nvme/044
+++ b/tests/nvme/044
@@ -12,8 +12,7 @@ QUICK=1
 requires() {
 	_nvme_requires
 	_have_loop
-	_have_kernel_option NVME_AUTH
-	_have_kernel_option NVME_TARGET_AUTH
+	_have_kernel_options NVME_AUTH NVME_TARGET_AUTH
 	_require_kernel_nvme_fabrics_feature dhchap_ctrl_secret
 	_require_nvme_trtype_is_fabrics
 	_require_nvme_cli_auth
diff --git a/tests/nvme/045 b/tests/nvme/045
index 4dd0f94..bf38824 100755
--- a/tests/nvme/045
+++ b/tests/nvme/045
@@ -13,8 +13,7 @@ requires() {
 	_nvme_requires
 	_have_fio
 	_have_loop
-	_have_kernel_option NVME_AUTH
-	_have_kernel_option NVME_TARGET_AUTH
+	_have_kernel_options NVME_AUTH NVME_TARGET_AUTH
 	_require_kernel_nvme_fabrics_feature dhchap_ctrl_secret
 	_require_nvme_trtype_is_fabrics
 	_require_nvme_cli_auth
diff --git a/tests/nvme/050 b/tests/nvme/050
index ba55c6e..91f3564 100755
--- a/tests/nvme/050
+++ b/tests/nvme/050
@@ -16,8 +16,7 @@ nvme_trtype=pci
 requires() {
 	_have_fio
 	_nvme_requires
-	_have_kernel_option FAIL_IO_TIMEOUT
-	_have_kernel_option FAULT_INJECTION_DEBUG_FS
+	_have_kernel_options FAIL_IO_TIMEOUT FAULT_INJECTION_DEBUG_FS
 }
 
 test_device() {
diff --git a/tests/nvme/062 b/tests/nvme/062
index 7c88719..19275f8 100755
--- a/tests/nvme/062
+++ b/tests/nvme/062
@@ -12,8 +12,7 @@ QUICK=1
 requires() {
 	_nvme_requires
 	_have_loop
-	_have_kernel_option NVME_TCP_TLS
-	_have_kernel_option NVME_TARGET_TCP_TLS
+	_have_kernel_options NVME_TCP_TLS NVME_TARGET_TCP_TLS
 	_require_kernel_nvme_fabrics_feature tls
 	_require_nvme_trtype tcp
 	_require_nvme_cli_tls
diff --git a/tests/nvme/063 b/tests/nvme/063
index 5bfe8be..bded9a3 100755
--- a/tests/nvme/063
+++ b/tests/nvme/063
@@ -12,10 +12,8 @@ QUICK=1
 requires() {
 	_nvme_requires
 	_have_loop
-	_have_kernel_option NVME_AUTH
-	_have_kernel_option NVME_TCP_TLS
-	_have_kernel_option NVME_TARGET_AUTH
-	_have_kernel_option NVME_TARGET_TCP_TLS
+	_have_kernel_options NVME_AUTH NVME_TCP_TLS NVME_TARGET_AUTH \
+		NVME_TARGET_TCP_TLS
 	_require_kernel_nvme_fabrics_feature dhchap_ctrl_secret
 	_require_kernel_nvme_fabrics_feature concat
 	_require_nvme_trtype tcp
-- 
2.40.0




More information about the Linux-nvme mailing list