Linux-NVME Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Shin'ichiro Kawasaki <shinichiro.kawasaki@wdc.com>
To: Daniel Wagner <dwagner@suse.de>
Cc: linux-block@vger.kernel.org, linux-nvme@lists.infradead.org
Subject: Re: [PATCH blktests v2 6/9] nvme: skip the DH-HMAC-CHAP algorithms the target doesn't support
Date: Sat, 28 Nov 2026 11:30:23 +0900	[thread overview]
Message-ID: <awo7lbuEbPHHuIm-@shinmob> (raw)
In-Reply-To: <20261118-nvme-target-control-v2-6-d191bbbf5dd6@suse.de>

On Nov 18, 2026 / 10:26, Daniel Wagner wrote:
> The authentication tests fail against a target that can't do
> DH-HMAC-CHAP, and nvme/042 and nvme/043 fail on every hash or DH group
> the target doesn't support.
> 
> Skip the authentication tests if the target doesn't list dhchap-sha256,
> the hash every DH-HMAC-CHAP target supports, and skip just the steps of
> nvme/042 and nvme/043 for the other algorithms the target doesn't list.
> 
> Signed-off-by: Daniel Wagner <dwagner@suse.de>
> ---
>  Documentation/running-tests.md |  7 +++++--
>  tests/nvme/041                 |  1 +
>  tests/nvme/042                 |  3 ++-
>  tests/nvme/043                 |  4 +++-
>  tests/nvme/044                 |  2 +-
>  tests/nvme/045                 |  2 +-
>  tests/nvme/063                 |  2 +-
>  tests/nvme/rc                  | 31 +++++++++++++++++++++++++------
>  8 files changed, 39 insertions(+), 13 deletions(-)

The commit message mentions the test cases nvme/042 and nvme/043 only, but
this patch touches more test cases listed above. I guess all those test cases
are modified for the same reason, right? If so, I can edit the commit message
when I apply this patch.

> 
> diff --git a/Documentation/running-tests.md b/Documentation/running-tests.md
> index b66bdf9cb2e8..d556f1d3b7cc 100644
> --- a/Documentation/running-tests.md
> +++ b/Documentation/running-tests.md
> @@ -261,8 +261,11 @@ The blktests expects that the script interface implements following
>    --subsysnqn SUBSYSNQN
>  
>  config --show-features prints the optional commands the script supports,
> -e.g. add-port, set-ana or set-host, and tls if the target can set up TLS.
> -blktests skips the tests which need a feature the list lacks.
> +e.g. add-port, set-ana or set-host, the DH-HMAC-CHAP hashes and DH groups
> +the target supports, e.g. dhchap-sha256 or dhchap-ffdhe2048, and tls if
> +the target can set up TLS. blktests skips the tests which need a feature
> +the list lacks: the authentication tests without dhchap-sha256, and
> +nvme/042 and nvme/043 only the steps for the other missing algorithms.
>  
>  contrib/nvme-target-control implements this interface. It configures a Linux
>  nvmet target over ssh and can be extended for other targets, see
> diff --git a/tests/nvme/041 b/tests/nvme/041
> index 9c3d9aaf4e12..2571c851be4d 100755
> --- a/tests/nvme/041
> +++ b/tests/nvme/041
> @@ -16,6 +16,7 @@ requires() {
>  	_require_kernel_nvme_fabrics_feature dhchap_ctrl_secret
>  	_require_nvme_trtype_is_fabrics
>  	_require_nvme_cli_auth
> +	_require_nvme_target_control_feature dhchap-sha256
>  }
>  
>  set_conditions() {
> diff --git a/tests/nvme/042 b/tests/nvme/042
> index e771cb6ca4aa..f9019e9640c4 100755
> --- a/tests/nvme/042
> +++ b/tests/nvme/042
> @@ -16,7 +16,7 @@ requires() {
>  	_require_kernel_nvme_fabrics_feature dhchap_ctrl_secret
>  	_require_nvme_trtype_is_fabrics
>  	_require_nvme_cli_auth
> -	_require_nvme_target_control_feature set-host
> +	_require_nvme_target_control_feature set-host dhchap-sha256
>  }
>  
>  set_conditions() {
> @@ -37,6 +37,7 @@ test() {
>  
>  	for hash in none sha256 sha384 sha512; do
>  		echo "Testing hash ${hash}"
> +		_have_nvme_target_dhchap "${hash}" || continue
>  		hostkey="$(_nvme_gen_kxchap_secret --hash="${hash}" 2> /dev/null)"
>  		if [ -z "$hostkey" ] ; then
>  			echo "couldn't generate host key for hash ${hash}"
> diff --git a/tests/nvme/043 b/tests/nvme/043
> index eb8f8b035f6d..695edaab9741 100755
> --- a/tests/nvme/043
> +++ b/tests/nvme/043
> @@ -17,7 +17,7 @@ requires() {
>  	_require_nvme_trtype_is_fabrics
>  	_require_nvme_cli_auth
>  	_have_crypto_algorithm dh-generic
> -	_require_nvme_target_control_feature set-host
> +	_require_nvme_target_control_feature set-host dhchap-sha256
>  }
>  
>  set_conditions() {
> @@ -45,6 +45,7 @@ test() {
>  	for hash in sha256 sha384 sha512; do
>  
>  		echo "Testing hash ${hash}"
> +		_have_nvme_target_dhchap "${hash}" || continue
>  
>  		_set_nvmet_hash "${def_hostnqn}" "hmac(${hash})"
>  
> @@ -56,6 +57,7 @@ test() {
>  	for dhgroup in ffdhe2048 ffdhe3072 ffdhe4096 ffdhe6144 ffdhe8192; do
>  
>  		echo "Testing DH group ${dhgroup}"
> +		_have_nvme_target_dhchap "${dhgroup}" || continue
>  
>  		_set_nvmet_dhgroup "${def_hostnqn}" "${dhgroup}"
>  
> diff --git a/tests/nvme/044 b/tests/nvme/044
> index c1a48f1e3d86..01a153e1f2a0 100755
> --- a/tests/nvme/044
> +++ b/tests/nvme/044
> @@ -17,7 +17,7 @@ requires() {
>  	_require_nvme_trtype_is_fabrics
>  	_require_nvme_cli_auth
>  	_have_crypto_algorithm dh-generic
> -	_require_nvme_target_control_feature set-host
> +	_require_nvme_target_control_feature set-host dhchap-sha256
>  }
>  
>  set_conditions() {
> diff --git a/tests/nvme/045 b/tests/nvme/045
> index 14f4949e198e..52d04ce40860 100755
> --- a/tests/nvme/045
> +++ b/tests/nvme/045
> @@ -18,7 +18,7 @@ requires() {
>  	_require_nvme_trtype_is_fabrics
>  	_require_nvme_cli_auth
>  	_have_crypto_algorithm dh-generic
> -	_require_nvme_target_control_feature set-host
> +	_require_nvme_target_control_feature set-host dhchap-sha256
>  }
>  
>  set_conditions() {
> diff --git a/tests/nvme/063 b/tests/nvme/063
> index 20aabd91ca80..578cb8799a6d 100755
> --- a/tests/nvme/063
> +++ b/tests/nvme/063
> @@ -19,7 +19,7 @@ requires() {
>  	_require_nvme_trtype tcp
>  	_require_nvme_cli_auth
>  	_have_systemd_tlshd_service
> -	_require_nvme_target_control_feature set-host tls
> +	_require_nvme_target_control_feature set-host tls dhchap-sha256
>  }
>  
>  set_conditions() {
> diff --git a/tests/nvme/rc b/tests/nvme/rc
> index 41811c033069..0d74c427313c 100644
> --- a/tests/nvme/rc
> +++ b/tests/nvme/rc
> @@ -155,18 +155,37 @@ _require_remote_nvme_target() {
>  	return 0
>  }
>  
> -# Skip the test if the NVME_TARGET_CONTROL target lacks one of the features,
> -# the optional commands and e.g. tls, see Documentation/running-tests.md.
> -_require_nvme_target_control_feature() {
> -	local features feature
> +# Check if the NVME_TARGET_CONTROL target lists the feature, one of the
> +# optional commands or e.g. tls, see Documentation/running-tests.md. The
> +# local target has all of them.
> +_have_nvme_target_control_feature() {
> +	local features
>  
>  	if [[ -z "${nvme_target_control}" ]]; then
>  		return 0
>  	fi
>  	features=" $("${nvme_target_control}" config --show-features) "
> +	# shellcheck disable=SC2076 # match the feature literally
> +	[[ "${features}" =~ " $1 " ]]
> +}

Nit: I think the shellcehck exception above can be avoided by a local variable.
I will add another follow-up commit as below. Just in case you think wrong,
please let me know.

diff --git a/tests/nvme/rc b/tests/nvme/rc
index e4fa9e0..879eb40 100644
--- a/tests/nvme/rc
+++ b/tests/nvme/rc
@@ -159,14 +159,14 @@ _require_remote_nvme_target() {
 # optional commands or e.g. tls, see Documentation/running-tests.md. The
 # local target has all of them.
 _have_nvme_target_control_feature() {
-       local features
+       local features feature

        if [[ -z "${nvme_target_control}" ]]; then
                return 0
        fi
        features=" $("${nvme_target_control}" config --show-features) "
-       # shellcheck disable=SC2076 # match the feature literally
-       [[ "${features}" =~ " $1 " ]]
+       feature=" $1 "
+       [[ "${features}" =~ $feature ]]
 }



  reply	other threads:[~2026-11-28  2:30 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-11-18  9:26 [PATCH blktests v2 0/9] nvme: make NVME_TARGET_CONTROL work with remote targets Daniel Wagner
2026-11-18  9:26 ` [PATCH blktests v2 1/9] nvme/047: look up the namespace again after reconnecting Daniel Wagner
2026-11-20 11:23   ` Hannes Reinecke
2026-11-18  9:26 ` [PATCH blktests v2 2/9] contrib/nvme-target-control: pick a free service ID for new nvmet ports Daniel Wagner
2026-11-18  9:26 ` [PATCH blktests v2 3/9] nvme/042, nvme/043: iterate over the DH-HMAC-CHAP hashes by name Daniel Wagner
2026-11-28  2:31   ` Shin'ichiro Kawasaki
2026-11-18  9:26 ` [PATCH blktests v2 4/9] nvme: skip tests that need a feature the remote target lacks Daniel Wagner
2026-11-18  9:26 ` [PATCH blktests v2 5/9] contrib/nvme-target-control: list the DH-HMAC-CHAP algorithms Daniel Wagner
2026-11-18  9:26 ` [PATCH blktests v2 6/9] nvme: skip the DH-HMAC-CHAP algorithms the target doesn't support Daniel Wagner
2026-11-28  2:30   ` Shin'ichiro Kawasaki [this message]
2026-11-18  9:26 ` [PATCH blktests v2 7/9] common/nvme: support the ports of a remote target Daniel Wagner
2026-11-18  9:26 ` [PATCH blktests v2 8/9] nvme/rc: change the host keys on " Daniel Wagner
2026-11-18  9:26 ` [PATCH blktests v2 9/9] contrib/nvme-target-control: add a NetApp ONTAP target Daniel Wagner
2026-11-20 11:25 ` [PATCH blktests v2 0/9] nvme: make NVME_TARGET_CONTROL work with remote targets Hannes Reinecke
2026-11-28  2:34 ` Shin'ichiro Kawasaki

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=awo7lbuEbPHHuIm-@shinmob \
    --to=shinichiro.kawasaki@wdc.com \
    --cc=dwagner@suse.de \
    --cc=linux-block@vger.kernel.org \
    --cc=linux-nvme@lists.infradead.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox