Skip to content

Commit

Permalink
qa,cephtool: add test case for 'ceph osd tier add-cache'
Browse files Browse the repository at this point in the history
Signed-off-by: Jianpeng Ma <[email protected]>
  • Loading branch information
majianpeng authored and liewegas committed Mar 11, 2015
1 parent 83d0581 commit 5a8d4c5
Showing 1 changed file with 20 additions and 0 deletions.
20 changes: 20 additions & 0 deletions qa/workunits/cephtool/test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -319,6 +319,9 @@ function test_tiering()
ceph osd pool create cache3 2
ceph osd tier add-cache slow cache3 1024000
ceph osd dump | grep cache3 | grep bloom | grep 'false_positive_probability: 0.05' | grep 'target_bytes 1024000' | grep '1200s x4'
ceph osd tier remove slow cache3 2> $TMPFILE || true
check_response "EBUSY: tier pool 'cache3' is the overlay for 'slow'; please remove-overlay first"
ceph osd tier remove-overlay slow
ceph osd tier remove slow cache3
ceph osd pool ls | grep cache3
ceph osd pool delete cache3 cache3 --yes-i-really-really-mean-it
Expand All @@ -327,6 +330,22 @@ function test_tiering()
ceph osd pool delete slow2 slow2 --yes-i-really-really-mean-it
ceph osd pool delete slow slow --yes-i-really-really-mean-it

# check add-cache whether work
ceph osd pool create datapool 2
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 cachepool stat object
rados -p cachepool cache-flush object
rados -p datapool stat object
ceph osd tier remove-overlay datapool
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
ceph osd pool create cachepool 2
Expand All @@ -335,6 +354,7 @@ function test_tiering()
check_response "EBUSY: pool 'cachepool' is a tier of 'datapool'"
ceph osd pool delete datapool datapool --yes-i-really-really-mean-it 2> $TMPFILE || true
check_response "EBUSY: pool 'datapool' has tiers cachepool"
ceph osd tier remove-overlay datapool
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
Expand Down

0 comments on commit 5a8d4c5

Please sign in to comment.