]> git.proxmox.com Git - ceph.git/blobdiff - ceph/qa/standalone/osd/osd-recovery-prio.sh
update sources to ceph Nautilus 14.2.1
[ceph.git] / ceph / qa / standalone / osd / osd-recovery-prio.sh
index 25ecb2651248e44b5ee20be00bf4b75974baa36f..9b017800f674e55881f67391e6cca79fb49af8df 100755 (executable)
@@ -44,6 +44,7 @@ function TEST_recovery_priority() {
     local dir=$1
     local pools=10
     local OSDS=5
+    local max_tries=10
 
     run_mon $dir a || return 1
     run_mgr $dir x || return 1
@@ -154,8 +155,15 @@ function TEST_recovery_priority() {
     CEPH_ARGS='' ceph --admin-daemon $(get_asok_path osd.${chk_osd1_1}) dump_reservations || return 1
 
     # 3. Item is in progress, adjust priority with no higher priority waiting
-    while(ceph pg force-recovery $PG3 2>&1 | grep -q "doesn't require recovery")
+    for i in $(seq 1 $max_tries)
     do
+      if ! ceph pg force-recovery $PG3 2>&1 | grep -q "doesn't require recovery"; then
+        break
+      fi
+      if [ "$i" = "$max_tries" ]; then
+        echo "ERROR: Didn't appear to be able to force-recovery"
+        ERRORS=$(expr $ERRORS + 1)
+      fi
       sleep 2
     done
     flush_pg_stats || return 1
@@ -197,8 +205,15 @@ function TEST_recovery_priority() {
     fi
 
     # 1. Item is queued, re-queue with new priority
-    while(ceph pg force-recovery $PG2 2>&1 | grep -q "doesn't require recovery")
+    for i in $(seq 1 $max_tries)
     do
+      if ! ceph pg force-recovery $PG2 2>&1 | grep -q "doesn't require recovery"; then
+        break
+      fi
+      if [ "$i" = "$max_tries" ]; then
+        echo "ERROR: Didn't appear to be able to force-recovery"
+        ERRORS=$(expr $ERRORS + 1)
+      fi
       sleep 2
     done
     sleep 2