]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.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>
Thu, 9 Feb 2017 17:16:07 +0000 (09:16 -0800)
Signed-off-by: David Zafman <dzafman@redhat.com>
(cherry picked from commit 907e79e2b77835d1aca9e8ba2fae5fa2fd437e5a)

qa/workunits/ceph-helpers.sh

index 9947217591141f2c1373d23c2253dc9f7998b612..3178cd58c71c19095b14165bb80afe1696657592 100755 (executable)
@@ -1031,8 +1031,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() {
@@ -1171,6 +1172,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
 
@@ -1250,9 +1258,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