]> git.apps.os.sepia.ceph.com Git - ceph-ci.git/commitdiff
test: Add test support for deep-scrub
authorDavid Zafman <dzafman@redhat.com>
Wed, 8 Jun 2016 16:48:00 +0000 (09:48 -0700)
committerDavid Zafman <dzafman@redhat.com>
Tue, 8 Nov 2016 23:16:52 +0000 (15:16 -0800)
Signed-off-by: David Zafman <dzafman@redhat.com>
qa/workunits/ceph-helpers.sh

index bb180111bf964fc27a1110bfe4274f432cddec8d..90880926ef910945bb4cd9541b7014dfbd14f7ec 100755 (executable)
@@ -1027,8 +1027,9 @@ function test_get_num_pgs() {
 #
 function get_last_scrub_stamp() {
     local pgid=$1
+    local sname=${2:-last_scrub_stamp}
     ceph --format xml pg dump pgs 2>/dev/null | \
-        $XMLSTARLET sel -t -m "//pg_stat[pgid='$pgid']/last_scrub_stamp" -v .
+        $XMLSTARLET sel -t -m "//pg_stat[pgid='$pgid']/$sname" -v .
 }
 
 function test_get_last_scrub_stamp() {
@@ -1167,6 +1168,13 @@ function pg_scrub() {
     wait_for_scrub $pgid "$last_scrub"
 }
 
+function pg_deep_scrub() {
+    local pgid=$1
+    local last_scrub=$(get_last_scrub_stamp $pgid last_deep_scrub_stamp)
+    ceph pg deep-scrub $pgid
+    wait_for_scrub $pgid "$last_scrub" last_deep_scrub_stamp
+}
+
 function test_pg_scrub() {
     local dir=$1
 
@@ -1246,9 +1254,10 @@ function test_expect_failure() {
 function wait_for_scrub() {
     local pgid=$1
     local last_scrub="$2"
+    local sname=${3:-last_scrub_stamp}
 
     for ((i=0; i < $TIMEOUT; i++)); do
-        if test "$last_scrub" != "$(get_last_scrub_stamp $pgid)" ; then
+        if test "$last_scrub" != "$(get_last_scrub_stamp $pgid $sname)" ; then
             return 0
         fi
         sleep 1