test: fix nbd test typo and add check

Change-Id: I5120baff8d2de3ef639d7b3c66d51002838c3f3c
Signed-off-by: Liu Xiaodong <xiaodong.liu@intel.com>
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/8439
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Ziye Yang <ziye.yang@intel.com>
Reviewed-by: Changpeng Liu <changpeng.liu@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
This commit is contained in:
Liu Xiaodong 2021-06-21 09:00:49 -04:00 committed by Jim Harris
parent bbf52bd340
commit 3a2a1d80e0

View File

@ -153,7 +153,11 @@ function nbd_function_test() {
local conf=$1
local nbd_all=($(ls /dev/nbd* | grep -v p))
local bdev_all=($bdevs_name)
local nbd_num=${#bdevs_all[@]}
local nbd_num=${#bdev_all[@]}
if ((nbd_num < 1)); then
# There should be at least one bdev and one valid nbd device
return 1
fi
if [ ${#nbd_all[@]} -le $nbd_num ]; then
nbd_num=${#nbd_all[@]}
fi