diff --git a/test/common/autotest_common.sh b/test/common/autotest_common.sh index 1c740a503..f5b06e591 100644 --- a/test/common/autotest_common.sh +++ b/test/common/autotest_common.sh @@ -657,6 +657,22 @@ function waitforblk() return 0 } +function waitforblk_disconnect() +{ + local i=0 + while lsblk -l -o NAME | grep -q -w $1; do + [ $i -lt 15 ] || break + i=$[$i+1] + sleep 1 + done + + if lsblk -l -o NAME | grep -q -w $1; then + return 1 + fi + + return 0 +} + function fio_config_gen() { local config_file=$1