nvme/test: Fix NVMe & setup.sh mounts test

We should brake through both loops of tests, but
currently we break only through one. Also change the
way the blk name is assigned to not overwrite it.

Signed-off-by: Maciej Szwed <maciej.szwed@intel.com>
Change-Id: I9a4ce004e1115301080c86ceb9a429cd6fc831e3
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/461250
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Reviewed-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-by: Darek Stojaczyk <dariusz.stojaczyk@intel.com>
This commit is contained in:
Maciej Szwed 2019-07-10 13:27:45 +02:00 committed by Darek Stojaczyk
parent 0901744bb1
commit 0c7ce64f3a

View File

@ -42,13 +42,12 @@ if [ $(uname) = Linux ]; then
# note: more work probably needs to be done to properly handle devices with multiple
# namespaces
for bdf in $(iter_pci_class_code 01 08 02); do
for blkname in $(get_nvme_name_from_bdf $bdf); do
if [ "$blkname" != "" ]; then
mountpoints=$(lsblk /dev/$blkname --output MOUNTPOINT -n | wc -w)
for name in $(get_nvme_name_from_bdf $bdf); do
if [ "$name" != "" ]; then
mountpoints=$(lsblk /dev/$name --output MOUNTPOINT -n | wc -w)
if [ "$mountpoints" = "0" ]; then
break
else
blkname=''
blkname=$name
break 2
fi
fi
done