]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
tests: tiering health report reworked 4662/head
authorLoic Dachary <ldachary@redhat.com>
Wed, 13 May 2015 08:39:37 +0000 (10:39 +0200)
committerLoic Dachary <ldachary@redhat.com>
Wed, 13 May 2015 08:39:37 +0000 (10:39 +0200)
Instead of

* setting limit
* populate the cache
* check the health warnings

do the following

* populate the cache
* set limits below the content of the cache
* check the health warnings

The problem with the former approach is that the limits stored by the
OSD internally do not exactly match the one set by the user: they are
converted in ratios and there may be rounding errors.

Also replace the busy loop waiting for pg stats to flush with

  ceph tell osd.* flush_pg_stats || true

for simplicity.

Signed-off-by: Loic Dachary <ldachary@redhat.com>
qa/workunits/cephtool/test.sh

index 435a69cf85bea735f34e2da9108d99cced2e6b8d..15d4e733d90cb69637e6c00799bd945bb4597717 100755 (executable)
@@ -364,20 +364,20 @@ function test_tiering()
   ceph osd tier cache-mode cache4 writeback
   tmpfile=$(mktemp|grep tmp)
   dd if=/dev/zero of=$tmpfile  bs=4K count=1
-  ceph osd pool set cache4 target_max_objects 5
-  #4096 * 5 = 20480, 20480 near/at 21000,
-  ceph osd pool set cache4 target_max_bytes 21000
-  for f in `seq 1 5` ; do
-    rados -p cache4 put foo$f $tmpfile
-  done
+  ceph osd pool set cache4 target_max_objects 200
+  ceph osd pool set cache4 target_max_bytes 1000000
+  rados -p cache4 put foo1 $tmpfile
+  rados -p cache4 put foo2 $tmpfile
   rm -f $tmpfile
-  while ! ceph df | grep cache4 | grep ' 5 ' ; do
-    echo waiting for pg stats to flush
-    sleep 2
-  done
+  ceph tell osd.* flush_pg_stats || true
+  ceph df | grep cache4 | grep ' 2 '
+  local max_objects=1
+  ceph osd pool set cache4 target_max_objects $max_objects
+  local max_bytes=1024
+  ceph osd pool set cache4 target_max_bytes $max_bytes
   ceph health | grep WARN | grep cache4
-  ceph health detail | grep cache4 | grep 'target max' | grep objects
-  ceph health detail | grep cache4 | grep 'target max' | grep 'B'
+  ceph health detail | grep cache4 | grep 'target max' | grep "${max_objects} objects"
+  ceph health detail | grep cache4 | grep 'target max' | grep "${max_bytes}B"
   ceph osd tier remove-overlay datapool
   ceph osd tier remove datapool cache4
   ceph osd pool delete cache4 cache4 --yes-i-really-really-mean-it