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: Michal Berger <michalx.berger@intel.com>
Change-Id: I5b222f1152f2a799b0d600ca19ad13eda009878a
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/10503
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Community-CI: Broadcom CI <spdk-ci.pdl@broadcom.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Paul Luse <paul.e.luse@intel.com>
Reviewed-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
This commit is contained in:
Michal Berger 2021-12-01 15:15:12 +01:00 committed by Tomasz Zawadzki
parent 9b631aa6c1
commit 2a1e635f49

View File

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