]> git.proxmox.com Git - ceph.git/blobdiff - ceph/qa/standalone/ceph-helpers.sh
update ceph source to reef 18.2.1
[ceph.git] / ceph / qa / standalone / ceph-helpers.sh
index 9f93be9233739272856946f3ef0cc8931849bc62..bf2c91bc04274d09b2c97bd18b36ff48c7015f1e 100755 (executable)
@@ -1747,6 +1747,29 @@ function test_wait_for_peered() {
 
 #######################################################################
 
+##
+# Wait until the cluster's health condition disappeared.
+# $TIMEOUT default
+#
+# @param string to grep for in health detail
+# @return 0 if the cluster health doesn't matches request,
+# 1 otherwise if after $TIMEOUT seconds health condition remains.
+#
+function wait_for_health_gone() {
+    local grepstr=$1
+    local -a delays=($(get_timeout_delays $TIMEOUT .1))
+    local -i loop=0
+
+    while ceph health detail | grep "$grepstr" ; do
+       if (( $loop >= ${#delays[*]} )) ; then
+            ceph health detail
+            return 1
+        fi
+        sleep ${delays[$loop]}
+        loop+=1
+    done
+}
+
 ##
 # Wait until the cluster has health condition passed as arg
 # again for $TIMEOUT seconds.