From: David Zafman Date: Sat, 26 Jan 2019 00:03:30 +0000 (-0800) Subject: test: Add option to wait_for_clean() to execute at every sleep X-Git-Tag: v12.2.12~40^2~3 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=dfbbd778bc96106757f5ec7da6a3b38fb2358af2;p=ceph.git test: Add option to wait_for_clean() to execute at every sleep Signed-off-by: David Zafman (cherry picked from commit 70b51362084d2ae5f2a6e9e5856f17452c53e3f3) --- diff --git a/qa/standalone/ceph-helpers.sh b/qa/standalone/ceph-helpers.sh index c2d724629cc..9a4bae2a584 100755 --- a/qa/standalone/ceph-helpers.sh +++ b/qa/standalone/ceph-helpers.sh @@ -1422,6 +1422,7 @@ function test_get_timeout_delays() { # @return 0 if the cluster is clean, 1 otherwise # function wait_for_clean() { + local cmd=$1 local num_active_clean=-1 local cur_active_clean local -a delays=($(get_timeout_delays $TIMEOUT .1)) @@ -1447,6 +1448,8 @@ function wait_for_clean() { ceph report return 1 fi + # eval is a no-op if cmd is empty + eval $cmd sleep ${delays[$loop]} loop+=1 done