From: Sage Weil Date: Thu, 18 May 2017 22:34:34 +0000 (-0400) Subject: qa/workunits/cephtool/test.sh: fix flush_pg_stats usage X-Git-Tag: ses5-milestone6~8^2~19^2~65 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=cd00aae1c33f70f09f69797abf19a37034af9658;p=ceph.git qa/workunits/cephtool/test.sh: fix flush_pg_stats usage Use a helper. Signed-off-by: Sage Weil --- diff --git a/qa/workunits/cephtool/test.sh b/qa/workunits/cephtool/test.sh index cf696573e923..c67e7a6de49a 100755 --- a/qa/workunits/cephtool/test.sh +++ b/qa/workunits/cephtool/test.sh @@ -292,6 +292,24 @@ function test_tiering_agent() ceph osd pool delete $slow $slow --yes-i-really-really-mean-it } +function flush_pg_stats() +{ + ids=`ceph osd ls` + seqs='' + for osd in $ids + do + seq=`ceph tell osd.$osd flush_pg_stats` + seqs="$seqs $osd-$seq" + done + for s in $seqs + do + osd=`echo $s | cut -d - -f 1` + seq=`echo $s | cut -d - -f 2` + echo "waiting osd.$osd seq $seq" + while test $(ceph osd last-stat-seq $osd) -lt $seq; do sleep 1 ; done + done +} + function test_tiering_1() { # tiering @@ -320,6 +338,7 @@ function test_tiering_1() # tier pool currently set to 'writeback' rados -p cache put /etc/passwd /etc/passwd ceph tell osd.\* flush_pg_stats || true + ceph tell mgr mgr report-mon # 1 dirty object in pool 'cache' ceph osd tier cache-mode cache proxy expect_false ceph osd tier cache-mode cache none @@ -329,6 +348,7 @@ function test_tiering_1() rados -p cache rm /etc/passwd rados -p cache cache-flush-evict-all ceph tell osd.\* flush_pg_stats || true + ceph tell mgr mgr report-mon # no dirty objects in pool 'cache' ceph osd tier cache-mode cache proxy ceph osd tier cache-mode cache none @@ -478,6 +498,7 @@ function test_tiering_8() rados -p cache4 put foo2 $tmpfile rm -f $tmpfile ceph tell osd.\* flush_pg_stats || true + ceph tell mgr mgr report-mon ceph df | grep datapool | grep ' 2 ' ceph osd tier remove-overlay datapool ceph osd tier remove datapool cache4