Commit 0ebb0460 authored by Seth Howell's avatar Seth Howell Committed by Tomasz Zawadzki
Browse files

test/nvme.sh: rewrite nvme_fio test to find namespaces using identify



The old version of this test was using a function
that only detects NVMe drives bound to the kernel
driver so it was not finding any work to do.

Instead use identify to find NVMe namespaces.

Signed-off-by: default avatarSeth Howell <seth.howell@intel.com>
Change-Id: I937fc364254a926b8d251ec0cb38ea026593d977
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/2788


Tested-by: default avatarSPDK CI Jenkins <sys_sgci@intel.com>
Community-CI: Mellanox Build Bot
Reviewed-by: default avatarChangpeng Liu <changpeng.liu@intel.com>
Reviewed-by: default avatarShuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
parent 4c21ef36
Loading
Loading
Loading
Loading
+12 −7
Original line number Diff line number Diff line
@@ -24,11 +24,16 @@ function nvme_perf() {
}

function nvme_fio_test() {
	PLUGIN_DIR=$rootdir/examples/nvme/fio_plugin
	ran_fio=false
	for bdf in $(get_nvme_bdfs); do
		for blkname in $(get_nvme_name_from_bdf $bdf); do
			fio_nvme $rootdir/examples/nvme/fio_plugin/example_config.fio --filename="trtype=PCIe traddr=${bdf//:/.} ns=${blkname##*n}"
		done
		if $SPDK_EXAMPLE_DIR/identify -r "trtype:PCIe traddr:${bdf}" | grep -E "^Number of Namespaces" - | grep -q "0" -; then
			continue
		fi
		fio_nvme $PLUGIN_DIR/example_config.fio --filename="trtype=PCIe traddr=${bdf//:/.}"
		ran_fio=true
	done
	$ran_fio || (echo "No valid NVMe drive found. Failing test." && false)
}

function nvme_multi_secondary() {
@@ -117,13 +122,13 @@ run_test "nvme_err_injection" $testdir/err_injection/err_injection
run_test "nvme_overhead" $testdir/overhead/overhead -s 4096 -t 1 -H
run_test "nvme_arbitration" $SPDK_EXAMPLE_DIR/arbitration -t 3 -i 0

if [[ $CONFIG_FIO_PLUGIN == y ]]; then
	run_test "nvme_fio" nvme_fio_test
fi

if [ $(uname) != "FreeBSD" ]; then
	run_test "nvme_startup" $testdir/startup/startup -t 1000000
	run_test "nvme_multi_secondary" nvme_multi_secondary
	trap - SIGINT SIGTERM EXIT
	kill_stub
fi

if [[ $CONFIG_FIO_PLUGIN == y ]]; then
	run_test "nvme_fio" nvme_fio_test
fi