]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
qa/workunits/cephtool/test.sh: fix flush_pg_stats usage
authorSage Weil <sage@redhat.com>
Thu, 18 May 2017 22:34:34 +0000 (18:34 -0400)
committerSage Weil <sage@redhat.com>
Fri, 2 Jun 2017 17:02:45 +0000 (13:02 -0400)
Use a helper.

Signed-off-by: Sage Weil <sage@redhat.com>
qa/workunits/cephtool/test.sh

index cf696573e923b43f31a2e724c63b4fd65369683e..c67e7a6de49a281c46032ff0cea83635ecae10e8 100755 (executable)
@@ -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