]> www.infradead.org Git - users/sagi/blktests.git/commitdiff
nvme/{041,042,043,044,045}: check dhchap_ctrl_secret support by nvme-fabrics
authorShin'ichiro Kawasaki <shinichiro.kawasaki@wdc.com>
Mon, 20 Nov 2023 02:49:31 +0000 (11:49 +0900)
committerShin'ichiro Kawasaki <shinichiro.kawasaki@wdc.com>
Mon, 27 Nov 2023 11:09:08 +0000 (20:09 +0900)
The kernel commit d68006348288 ("nvme: rework NVME_AUTH Kconfig
selection") in v6.7-rc1 introduced a new kernel config option
NVME_HOST_AUTH. When the option is disabled, nvme test cases from 041 to
045 fail because nvme-fabrics module does not support the feature
dhchap_ctrl_secret.

To check the requirement, add _require_kernel_nvme_fabrics_feature()
which refers /dev/nvme-fabrics and checks if the specified feature
string is found or not. Call it to check dhchap_ctrl_secret support in
require() of the test cases.

This change relies on the kernel commit 1697d7d4c5ef ("nvme: blank out
authentication fabrics options if not configured").

Suggested-by: Daniel Wagner <dwagner@suse.de>
Suggested-by: Hannes Reinecke <hare@suse.de>
Reviewed-by: Daniel Wagner <dwagner@suse.de>
Signed-off-by: Shin'ichiro Kawasaki <shinichiro.kawasaki@wdc.com>
tests/nvme/041
tests/nvme/042
tests/nvme/043
tests/nvme/044
tests/nvme/045
tests/nvme/rc

index d23f10ad88d78dc69708a99c3e9b2f01f0019276..c4588d7058accf1800560058b7b91065cd10a735 100755 (executable)
@@ -14,6 +14,7 @@ requires() {
        _have_loop
        _have_kernel_option NVME_AUTH
        _have_kernel_option NVME_TARGET_AUTH
+       _require_kernel_nvme_fabrics_feature dhchap_ctrl_secret
        _require_nvme_trtype_is_fabrics
        _require_nvme_cli_auth
 }
index 9fda681a9b45610b3d0887b917e3cbe6b84cd6cc..815d65e7c610ea14c1eb8165d2c22d0539fa5646 100755 (executable)
@@ -14,6 +14,7 @@ requires() {
        _have_loop
        _have_kernel_option NVME_AUTH
        _have_kernel_option NVME_TARGET_AUTH
+       _require_kernel_nvme_fabrics_feature dhchap_ctrl_secret
        _require_nvme_trtype_is_fabrics
        _require_nvme_cli_auth
 }
index c6a0aa00855e6f1ae89abc18bf6d334b03d31bb5..e65abb09fe7cd026037c43a4c225441ac7b54f7e 100755 (executable)
@@ -14,6 +14,7 @@ requires() {
        _have_loop
        _have_kernel_option NVME_AUTH
        _have_kernel_option NVME_TARGET_AUTH
+       _require_kernel_nvme_fabrics_feature dhchap_ctrl_secret
        _require_nvme_trtype_is_fabrics
        _require_nvme_cli_auth
        _have_driver dh_generic
index 7bd43f39d46019279d4943f9f970e91a0c80ed85..9ee07475e7382f224a9ddfd213d8e2441f265031 100755 (executable)
@@ -14,6 +14,7 @@ requires() {
        _have_loop
        _have_kernel_option NVME_AUTH
        _have_kernel_option NVME_TARGET_AUTH
+       _require_kernel_nvme_fabrics_feature dhchap_ctrl_secret
        _require_nvme_trtype_is_fabrics
        _require_nvme_cli_auth
        _have_driver dh_generic
index 1eb1032a3b9363379d172e60804bf168ac26987b..be408b6297710212e61e2d9b6f67db0dc613e22e 100755 (executable)
@@ -15,6 +15,7 @@ requires() {
        _have_loop
        _have_kernel_option NVME_AUTH
        _have_kernel_option NVME_TARGET_AUTH
+       _require_kernel_nvme_fabrics_feature dhchap_ctrl_secret
        _require_nvme_trtype_is_fabrics
        _require_nvme_cli_auth
        _have_driver dh_generic
index 34a144f40fd12fd4b99cc0d345d29f4e2b5984cf..b0ef1eeab4b046ef6e26314206f6a5e6e878ed13 100644 (file)
@@ -155,6 +155,22 @@ _require_nvme_cli_auth() {
        return 0
 }
 
+_require_kernel_nvme_fabrics_feature() {
+       local feature="$1"
+
+       _have_driver nvme-fabrics || return 1
+
+       if ! [[ -r /dev/nvme-fabrics ]]; then
+               SKIP_REASONS+=("/dev/nvme-fabrics not available")
+               return 1;
+       fi
+       if ! grep -qe "${feature}" /dev/nvme-fabrics; then
+               SKIP_REASONS+=("nvme-fabrics does not support ${feature}")
+               return 1;
+       fi
+       return 0
+}
+
 _test_dev_nvme_ctrl() {
        echo "/dev/char/$(cat "${TEST_DEV_SYSFS}/device/dev")"
 }