From: David Zafman Date: Wed, 8 Jun 2016 16:48:00 +0000 (-0700) Subject: test: Add test support for deep-scrub X-Git-Tag: v10.2.7~24^2~14 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=ba84ca9fa391d963d1d4e46fbf27ce3dbff397be;p=ceph.git test: Add test support for deep-scrub Signed-off-by: David Zafman (cherry picked from commit 907e79e2b77835d1aca9e8ba2fae5fa2fd437e5a) --- diff --git a/qa/workunits/ceph-helpers.sh b/qa/workunits/ceph-helpers.sh index 994721759114..3178cd58c71c 100755 --- a/qa/workunits/ceph-helpers.sh +++ b/qa/workunits/ceph-helpers.sh @@ -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