test/setup: Fix dm_mount test for slow hosts

on some hosts, it might take 1 or 2 seconds for the
mapper device to appear on /dev
in this case, the test will fail
because we check if the device exists immediately.
by giving it chance to get up the test will pass.

Signed-off-by: Amir Haroush <amir.haroush@huawei.com>
Signed-off-by: Shai Fultheim <shai.fultheim@huawei.com>
Change-Id: I996d84861333d29d5c9370a2c5a471e7962d91b1
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/17912
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
This commit is contained in:
Amir Haroush 2023-05-01 23:35:39 +03:00 committed by David Ko
parent c9b802ca49
commit 6be9d04cb5

View File

@ -160,6 +160,10 @@ dm_mount() {
1048576 1048576 linear /dev/$pv1 0 1048576 1048576 linear /dev/$pv1 0
DM_TABLE DM_TABLE
for t in {1..5}; do
if [[ -e /dev/mapper/$dm_name ]]; then break; fi
sleep 1
done
[[ -e /dev/mapper/$dm_name ]] [[ -e /dev/mapper/$dm_name ]]
dm=$(readlink -f "/dev/mapper/$dm_name") dm=$(readlink -f "/dev/mapper/$dm_name")
dm=${dm##*/} dm=${dm##*/}