From b3f89663ba23ca9465bb2da8e7326d87ada04cb0 Mon Sep 17 00:00:00 2001 From: Michal Berger Date: Wed, 1 Dec 2021 15:15:12 +0100 Subject: [PATCH] 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 Change-Id: I5b222f1152f2a799b0d600ca19ad13eda009878a Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/10503 Tested-by: SPDK CI Jenkins Community-CI: Broadcom CI Reviewed-by: Jim Harris Reviewed-by: Paul Luse Reviewed-by: Tomasz Zawadzki --- test/nvme/nvme.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/nvme/nvme.sh b/test/nvme/nvme.sh index 8c8708e18..ffde62d32 100755 --- a/test/nvme/nvme.sh +++ b/test/nvme/nvme.sh @@ -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