[PATCH blktests v1 17/18] nvme: don't assume namespace id

Shinichiro Kawasaki shinichiro.kawasaki at wdc.com
Fri Mar 22 02:35:05 PDT 2024


On Mar 21, 2024 / 10:47, Daniel Wagner wrote:
> The tests assume that the namespace id is always 1. This might not be
> correct in future (e.g. running real targets), thus harden the test by
> using the uuid to lookup the correct namespace id.
> 
> The passthru test already do this, so it makes also sense to update the
> other tests as well.
> 
> Signed-off-by: Daniel Wagner <dwagner at suse.de>
> ---
>  tests/nvme/010 |  7 +++----
>  tests/nvme/011 |  7 +++----
>  tests/nvme/012 |  7 +++----
>  tests/nvme/013 |  7 +++----
>  tests/nvme/014 | 13 ++++++-------
>  tests/nvme/015 | 13 ++++++-------
>  tests/nvme/018 | 15 +++++++--------
>  tests/nvme/019 |  8 +++-----
>  tests/nvme/020 |  7 +++----
>  tests/nvme/021 |  7 +++----
>  tests/nvme/023 |  8 +++-----
>  tests/nvme/024 |  9 ++++-----
>  tests/nvme/025 |  7 +++----
>  tests/nvme/026 |  8 +++-----
>  tests/nvme/029 |  6 +-----
>  tests/nvme/040 |  4 +++-
>  tests/nvme/045 |  5 +++--
>  tests/nvme/047 | 10 +++++-----
>  tests/nvme/rc  | 18 ++++++++++++++++++
>  19 files changed, 83 insertions(+), 83 deletions(-)
> 
> diff --git a/tests/nvme/010 b/tests/nvme/010
> index 7d875989a01c..6feb39153e99 100755
> --- a/tests/nvme/010
> +++ b/tests/nvme/010
> @@ -20,17 +20,16 @@ test() {
>  
>  	_setup_nvmet
>  
> -	local nvmedev
> +	local ns
>  
>  	_nvmet_target_setup
>  
>  	_nvme_connect_subsys
>  
> -	nvmedev=$(_find_nvme_dev "${def_subsysnqn}")
> -	_check_uuid "${nvmedev}"
> +	ns=$(_find_nvme_ns "${def_subsys_uuid}")

Currently, _check_uuid() compares the uuid with wwid. On the other hand, the
modified _find_nvme_ns() does not refer wwid. This looks a relax of test
condition. Do you think this relax is fine?

>  
>  	_run_fio_verify_io --size="${nvme_img_size}" \
> -		--filename="/dev/${nvmedev}n1"
> +		--filename="/dev/${ns}"
>  
>  	_nvme_disconnect_subsys
>

[...]

> diff --git a/tests/nvme/047 b/tests/nvme/047
> index 7a2432a769e5..9bbe84d4f145 100755
> --- a/tests/nvme/047
> +++ b/tests/nvme/047
> @@ -22,7 +22,7 @@ test() {
>  
>  	_setup_nvmet
>  
> -	local nvmedev
> +	local ns
>  	local rand_io_size
>  
>  	_nvmet_target_setup
> @@ -30,18 +30,18 @@ test() {
>  	_nvme_connect_subsys \
>  		--nr-write-queues 1 || echo FAIL
>  
> -	nvmedev=$(_find_nvme_dev "${def_subsysnqn}")
> +	ns=$(_find_nvme_ns "${def_subsys_uuid}")
>  
>  	rand_io_size="$(_nvme_calc_rand_io_size 4M)"
> -	_run_fio_rand_io --filename="/dev/${nvmedev}n1" --size="${rand_io_size}"
> +	_run_fio_rand_io --filename="/dev/${ns}" --size="${rand_io_size}"
>  
> -	_nvme_disconnect_subsys "${def_subsysnqn}" >> "$FULL" 2>&1
> +	_nvme_disconnect_subsys >> "$FULL" 2>&1

This change above looks different from the purpose of this patch. It should move
to one of the previous patches, probably.


More information about the Linux-nvme mailing list