Commit 5232a73f authored by Seth Howell's avatar Seth Howell Committed by Jim Harris
Browse files

autotest_common: add waitforblk_disconnect



This is the functional opposite of waitforblk.

Change-Id: I5e9f77c9ea05b83b8dbfbf49bb3baa2ae8cc1086
Signed-off-by: default avatarSeth Howell <seth.howell@intel.com>
Reviewed-on: https://review.gerrithub.io/c/443316


Tested-by: default avatarSPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: default avatarBen Walker <benjamin.walker@intel.com>
Reviewed-by: default avatarShuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
parent 63de221b
Loading
Loading
Loading
Loading
+16 −0
Original line number Diff line number Diff line
@@ -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