[PATCH blktests v2 3/3] nvme/047: Test different queue counts

Shinichiro Kawasaki shinichiro.kawasaki at wdc.com
Thu Mar 23 03:55:48 PDT 2023


On Mar 22, 2023 / 11:16, Daniel Wagner wrote:
> Test if the transport are handling the different queues correctly.
> 
> We also issue some I/O to make sure that not just the plain connect
> works. For this we have to use a file system which supports direct I/O
> and hence we use a device backend.
> 
> Signed-off-by: Daniel Wagner <dwagner at suse.de>
> ---
>  tests/nvme/047     | 65 ++++++++++++++++++++++++++++++++++++++++++++++
>  tests/nvme/047.out |  2 ++
>  2 files changed, 67 insertions(+)
>  create mode 100755 tests/nvme/047
>  create mode 100644 tests/nvme/047.out
> 
> diff --git a/tests/nvme/047 b/tests/nvme/047
> new file mode 100755
> index 000000000000..6a37f7a569b7
> --- /dev/null
> +++ b/tests/nvme/047
> @@ -0,0 +1,65 @@
> +#!/bin/bash
> +# SPDX-License-Identifier: GPL-2.0+

FYI, GPL-2.0+ is ok for blktests files, but GPL-3.0+ is the majority.
If you do not have preference, I suggest GPL-3.0+.

> +# Copyright (C) 2023 SUSE LLC
> +#
> +# Test NVMe queue counts.

Can we have some more description in the comment block above? I suggest to
copy and paste the first line of the commit message.

> +
> +. tests/nvme/rc
> +. common/xfs
> +
> +DESCRIPTION="test NVMe queue counts"
> +
> +requires() {
> +	_nvme_requires
> +	_have_xfs
> +	_have_fio
> +	_require_nvme_trtype_is_fabrics
> +}

Do you think this test runs on older kernel versions? If you have any specific
kernel version for this test case, _have_kver can be added in requires().

> +
> +test() {
> +	echo "Running ${TEST_NAME}"
> +
> +	_setup_nvmet
> +
> +	local port
> +	local nvmedev
> +	local loop_dev
> +	local file_path="$TMPDIR/img"
> +	local subsys_name="blktests-subsystem-1"
> +
> +	truncate -s 512M "${file_path}"
> +
> +	loop_dev="$(losetup -f --show "${file_path}")"
> +
> +	_create_nvmet_subsystem "${subsys_name}" "${loop_dev}" \
> +		"91fdba0d-f87b-4c25-b80f-db7be1418b9e"
> +	port="$(_create_nvmet_port "${nvme_trtype}")"
> +	_add_nvmet_subsys_to_port "${port}" "${subsys_name}"
> +
> +	_nvme_connect_subsys "${nvme_trtype}" "${subsys_name}" \
> +		--nr-write-queues 1
> +
> +	nvmedev=$(_find_nvme_dev "${subsys_name}")
> +
> +	_xfs_run_fio_verify_io /dev/"${nvmedev}n1" "1m"
> +
> +	_nvme_disconnect_subsys "${subsys_name}" >> "$FULL" 2>&1
> +
> +	_nvme_connect_subsys "${nvme_trtype}" "${subsys_name}" \
> +		--nr-write-queues 1 \
> +		--nr-poll-queues 1
> +
> +	_xfs_run_fio_verify_io /dev/"${nvmedev}n1" "1m"
> +
> +	_nvme_disconnect_subsys "${subsys_name}" >> "$FULL" 2>&1
> +
> +	_remove_nvmet_subsystem_from_port "${port}" "${subsys_name}"
> +	_remove_nvmet_subsystem "${subsys_name}"
> +	_remove_nvmet_port "${port}"
> +
> +	losetup -d "${loop_dev}"
> +
> +	rm "${file_path}"
> +
> +	echo "Test complete"
> +}
> diff --git a/tests/nvme/047.out b/tests/nvme/047.out
> new file mode 100644
> index 000000000000..915d0a2389ca
> --- /dev/null
> +++ b/tests/nvme/047.out
> @@ -0,0 +1,2 @@
> +Running nvme/047
> +Test complete
> -- 
> 2.40.0
> 

-- 
Shin'ichiro Kawasaki


More information about the Linux-nvme mailing list