test: add helper function to wait until file is created

Signed-off-by: Jim Harris <james.r.harris@intel.com>
Change-Id: Ib706727c680471334b90960148ee1a637561cf64

Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/452805
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
This commit is contained in:
Jim Harris 2019-05-01 14:51:54 -07:00
parent f5fbac9195
commit b118729feb

View File

@ -675,6 +675,22 @@ function waitforblk_disconnect()
return 0
}
function waitforfile()
{
local i=0
while [ ! -f $1 ]; do
[ $i -lt 200 ] || break
i=$[$i+1]
sleep 0.1
done
if [ ! -f $1 ]; then
return 1
fi
return 0
}
function fio_config_gen()
{
local config_file=$1