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 09/10] nvme: skip the tests which need a feature the remote target lacks
Date: Wed, 11 Nov 2026 19:33:36 +0900	[thread overview]
Message-ID: <avRD23enUQ1UfQpj@shinmob> (raw)
In-Reply-To: <20261104-nvme-target-control-v1-9-b31b40537bb4@suse.de>

On Nov 04, 2026 / 17:44, Daniel Wagner wrote:
> An NVME_TARGET_CONTROL target need not implement the optional commands.
> A storage array, for example, has fixed ports, manages the ANA states
> itself and may not take host keys or a TLS key from blktests. The tests
> which use a missing command then fail, e.g. nvme/057 on set-ana.
> 
> Add _require_nvme_target_control_feature, which checks the features
> config --show-features lists. Use it in the tests which add and remove
> ports (nvme/031), set ANA states (nvme/057), change host keys (nvme/042
> to nvme/045, nvme/063) or set up TLS (nvme/062, nvme/063). No target
> lists tls yet: blktests doesn't pass the TLS key to the script.
> 
> Signed-off-by: Daniel Wagner <dwagner@suse.de>
[...]
> diff --git a/tests/nvme/rc b/tests/nvme/rc
> index 3c3ed680e416..6bdd4058586a 100644
> --- a/tests/nvme/rc
> +++ b/tests/nvme/rc
> @@ -155,6 +155,24 @@ _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
> +
> +	if [[ -z "${nvme_target_control}" ]]; then
> +		return 0
> +	fi
> +	features=" $("${nvme_target_control}" config --show-features) "
> +	for feature in "$@"; do
> +		if [[ "${features}" != *" ${feature} "* ]]; then

The line above is a bit confusing for me. I guess the line can be simpler as
follows:

		if [[ "${features}" =~ " ${feature} " ]]; then

May I ask you to confirm it?

> +			SKIP_REASONS+=("NVME_TARGET_CONTROL target does not support ${feature}")
> +			return 1
> +		fi
> +	done
> +	return 0
> +}
> +
>  _test_dev_nvme_ctrl() {
>  	echo "/dev/char/$(cat "${TEST_DEV_SYSFS}/device/dev")"
>  }
> 
> -- 
> 2.56.0
> 


  reply	other threads:[~2026-11-11 10:33 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-11-04 16:44 [PATCH blktests 00/10] nvme: make NVME_TARGET_CONTROL work with remote targets Daniel Wagner
2026-11-04 16:44 ` [PATCH blktests 01/10] common/nvme: pass --ctrlkey to the target control script Daniel Wagner
2026-11-04 16:44 ` [PATCH blktests 02/10] common/nvme: wait for the namespace of a remote target Daniel Wagner
2026-11-04 16:44 ` [PATCH blktests 03/10] common/nvme: check the subsystem in _nvmet_target_add_ports Daniel Wagner
2026-11-04 16:44 ` [PATCH blktests 04/10] nvme: skip the tests which need the kernel target with a remote target Daniel Wagner
2026-11-04 16:44 ` [PATCH blktests 05/10] nvme/029: skip if the I/O exceeds the maximum transfer size Daniel Wagner
2026-11-04 16:44 ` [PATCH blktests 06/10] contrib: make nvme-target-control a standalone project Daniel Wagner
2026-11-04 16:44 ` [PATCH blktests 07/10] common/nvme: support the ports of a remote target Daniel Wagner
2026-11-11 10:30   ` Shin'ichiro Kawasaki
2026-11-04 16:44 ` [PATCH blktests 08/10] nvme/rc: change the host keys on " Daniel Wagner
2026-11-04 16:44 ` [PATCH blktests 09/10] nvme: skip the tests which need a feature the remote target lacks Daniel Wagner
2026-11-11 10:33   ` Shin'ichiro Kawasaki [this message]
2026-11-12  9:17     ` Daniel Wagner
2026-11-04 16:44 ` [PATCH blktests 10/10] contrib/nvme-target-control: add a NetApp ONTAP target Daniel Wagner
2026-11-11 10:36 ` [PATCH blktests 00/10] nvme: make NVME_TARGET_CONTROL work with remote targets Shin'ichiro Kawasaki
2026-11-12  9:19   ` Daniel Wagner

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=avRD23enUQ1UfQpj@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