Commit 2a1e635f authored by Michal Berger's avatar Michal Berger Committed by Tomasz Zawadzki
Browse files

test/nvme: Check active namespaces instead of the number of reported namespaces



Upstream QEMU initializes the Number Of Namespaces (NN) on each of
the emulated nvme subsystems to NVME_MAX_NAMESPACES (256) - this is
the case even for a device which doesn't have any active namespaces.

In case nvme_fio_test() finds such a device (no active namespaces)
it still attempts to run fio against it due to a false positive which
comes from looking up the Number Of Namespaces.

Adjust the check to look for strings related to active namespaces
and pick devices which report any.

Signed-off-by: default avatarMichal Berger <michalx.berger@intel.com>
Change-Id: I5b222f1152f2a799b0d600ca19ad13eda009878a
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/10503


Tested-by: default avatarSPDK CI Jenkins <sys_sgci@intel.com>
Community-CI: Broadcom CI <spdk-ci.pdl@broadcom.com>
Reviewed-by: default avatarJim Harris <james.r.harris@intel.com>
Reviewed-by: default avatarPaul Luse <paul.e.luse@intel.com>
Reviewed-by: default avatarTomasz Zawadzki <tomasz.zawadzki@intel.com>
parent 9b631aa6
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -27,7 +27,7 @@ function nvme_fio_test() {
	PLUGIN_DIR=$rootdir/examples/nvme/fio_plugin
	ran_fio=false
	for bdf in $(get_nvme_bdfs); do
		if $SPDK_EXAMPLE_DIR/identify -r "trtype:PCIe traddr:${bdf}" | grep -E "^Number of Namespaces" - | grep -q "0" -; then
		if ! "$SPDK_EXAMPLE_DIR/identify" -r "trtype:PCIe traddr:${bdf}" | grep -qE "^Namespace ID:[0-9]+"; then
			continue
		fi
		if $SPDK_EXAMPLE_DIR/identify -r "trtype:PCIe traddr:${bdf}" | grep -q "Extended Data LBA"; then