From 537e88ec7df995c9071ef5daa1bc767a6b8e53d1 Mon Sep 17 00:00:00 2001 From: Jianpeng Ma Date: Fri, 20 Mar 2015 09:55:39 +0800 Subject: [PATCH] qa/cephtool: Using add-cache rather than add to test ceph health. Don't forget set cachemode. By the way, For test max_target_bytes, don't reply on /etc/passwd because different host have different size of /etc/passwd. Avoid met this bug, i create a tmp file. Signed-off-by: Jianpeng Ma --- qa/workunits/cephtool/test.sh | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/qa/workunits/cephtool/test.sh b/qa/workunits/cephtool/test.sh index d52a99a439b..08b18f34a1e 100755 --- a/qa/workunits/cephtool/test.sh +++ b/qa/workunits/cephtool/test.sh @@ -335,8 +335,7 @@ function test_tiering() ceph osd pool create cachepool 2 ceph osd tier add-cache datapool cachepool 1024000 ceph osd tier cache-mode cachepool writeback - dd if=/dev/zero of=/tmp/add-cache bs=4K count=1 - rados -p datapool put object /tmp/add-cache + rados -p datapool put object /etc/passwd rados -p cachepool stat object rados -p cachepool cache-flush object rados -p datapool stat object @@ -344,7 +343,6 @@ function test_tiering() ceph osd tier remove datapool cachepool ceph osd pool delete cachepool cachepool --yes-i-really-really-mean-it ceph osd pool delete datapool datapool --yes-i-really-really-mean-it - rm -rf /tmp/add-cache # protection against pool removal when used as tiers ceph osd pool create datapool 2 @@ -362,12 +360,17 @@ function test_tiering() # check health check ceph osd pool create datapool 2 ceph osd pool create cache4 2 - ceph osd tier add datapool cache4 + ceph osd tier add-cache datapool cache4 1024000 + 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 - ceph osd pool set cache4 target_max_bytes 1000 + #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 /etc/passwd + rados -p cache4 put foo$f $tmpfile done + rm -f $tmpfile while ! ceph df | grep cache4 | grep ' 5 ' ; do echo waiting for pg stats to flush sleep 2 @@ -375,6 +378,7 @@ function test_tiering() 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 osd tier remove-overlay datapool ceph osd tier remove datapool cache4 ceph osd pool delete cache4 cache4 --yes-i-really-really-mean-it ceph osd pool delete datapool datapool --yes-i-really-really-mean-it