test/common: fail the tests if get_nvme_bdfs() returns no devices
Usual way to call get_nvme_bdfs() is to iterate over resulting bdfs. When no bdfs are returned, most of the scripts do no not execute tests at all and assume success. Instead of adding error checking for each and every script for no bdfs, this patch makes get_nvme_bdfs() exit with test failure. This assumes that there will never be a test that expects no devices to be present. Signed-off-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com> Change-Id: I1e41a885c76ce6cc248fb076bc4f4efd4695ff3c Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/2836 Tested-by: SPDK CI Jenkins <sys_sgci@intel.com> Community-CI: Mellanox Build Bot Reviewed-by: Jim Harris <james.r.harris@intel.com> Reviewed-by: Ben Walker <benjamin.walker@intel.com> Reviewed-by: Maciej Wawryk <maciejx.wawryk@intel.com> Reviewed-by: Karol Latecki <karol.latecki@intel.com>
This commit is contained in:
parent
9798e12bad
commit
6b19775bd9
@ -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
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user