From 907e79e2b77835d1aca9e8ba2fae5fa2fd437e5a Mon Sep 17 00:00:00 2001 From: David Zafman Date: Wed, 8 Jun 2016 09:48:00 -0700 Subject: [PATCH] test: Add test support for deep-scrub Signed-off-by: David Zafman --- qa/workunits/ceph-helpers.sh | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/qa/workunits/ceph-helpers.sh b/qa/workunits/ceph-helpers.sh index bb180111bf9..90880926ef9 100755 --- a/qa/workunits/ceph-helpers.sh +++ b/qa/workunits/ceph-helpers.sh @@ -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 -- 2.39.5