diff --git a/test/common/autotest_common.sh b/test/common/autotest_common.sh index 17a80794ae..2fb9e1862b 100755 --- a/test/common/autotest_common.sh +++ b/test/common/autotest_common.sh @@ -1240,7 +1240,12 @@ function opal_revert_cleanup() { # uio-pci-generic or vfio-pci function get_nvme_bdfs() { xtrace_disable - jq -r .config[].params.traddr <<< $($rootdir/scripts/gen_nvme.sh --json) + bdfs=$(jq -r .config[].params.traddr <<< $($rootdir/scripts/gen_nvme.sh --json)) + if [[ -z $bdfs ]]; then + echo "No devices to test on!" + exit 1 + fi + echo "$bdfs" xtrace_restore }