]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
qa/workunits: cephtool: test get/set on both tier and non-tier pools
authorJoao Eduardo Luis <joao.luis@inktank.com>
Thu, 3 Jul 2014 14:32:46 +0000 (15:32 +0100)
committerJoao Eduardo Luis <joao.luis@inktank.com>
Thu, 10 Jul 2014 23:17:47 +0000 (00:17 +0100)
Make sure gets and sets of tiering-specific variables succeed on tier
pools and fail on non-tier pools.

Signed-off-by: Joao Eduardo Luis <joao.luis@inktank.com>
qa/workunits/cephtool/test.sh

index ff4aedc63e3549a0f0530536bd4103ec010d87e5..6c60b8ea97f5cdb9d2df3a32cb8a11088c5e0861 100755 (executable)
@@ -715,45 +715,88 @@ function test_mon_osd_pool_set()
 
 function test_mon_osd_tiered_pool_set()
 {
-  ceph osd pool set rbd hit_set_type explicit_hash
-  ceph osd pool get rbd hit_set_type | grep "hit_set_type: explicit_hash"
-  ceph osd pool set rbd hit_set_type explicit_object
-  ceph osd pool get rbd hit_set_type | grep "hit_set_type: explicit_object"
-  ceph osd pool set rbd hit_set_type bloom
-  ceph osd pool get rbd hit_set_type | grep "hit_set_type: bloom"
-  expect_false ceph osd pool set rbd hit_set_type i_dont_exist
-  ceph osd pool set rbd hit_set_period 123
-  ceph osd pool get rbd hit_set_period | grep "hit_set_period: 123"
-  ceph osd pool set rbd hit_set_count 12
-  ceph osd pool get rbd hit_set_count | grep "hit_set_count: 12"
-  ceph osd pool set rbd hit_set_fpp .01
-  ceph osd pool get rbd hit_set_fpp | grep "hit_set_fpp: 0.01"
-
-  ceph osd pool set rbd target_max_objects 123
-  ceph osd pool get rbd target_max_objects | \
+  # this is really a tier pool
+  ceph osd pool create real-tier 2
+  ceph osd tier add rbd real-tier
+
+  ceph osd pool set real-tier hit_set_type explicit_hash
+  ceph osd pool get real-tier hit_set_type | grep "hit_set_type: explicit_hash"
+  ceph osd pool set real-tier hit_set_type explicit_object
+  ceph osd pool get real-tier hit_set_type | grep "hit_set_type: explicit_object"
+  ceph osd pool set real-tier hit_set_type bloom
+  ceph osd pool get real-tier hit_set_type | grep "hit_set_type: bloom"
+  expect_false ceph osd pool set real-tier hit_set_type i_dont_exist
+  ceph osd pool set real-tier hit_set_period 123
+  ceph osd pool get real-tier hit_set_period | grep "hit_set_period: 123"
+  ceph osd pool set real-tier hit_set_count 12
+  ceph osd pool get real-tier hit_set_count | grep "hit_set_count: 12"
+  ceph osd pool set real-tier hit_set_fpp .01
+  ceph osd pool get real-tier hit_set_fpp | grep "hit_set_fpp: 0.01"
+
+  ceph osd pool set real-tier target_max_objects 123
+  ceph osd pool get real-tier target_max_objects | \
     grep 'target_max_objects:[ \t]\+123'
-  ceph osd pool set rbd target_max_bytes 123456
-  ceph osd pool get rbd target_max_bytes | \
+  ceph osd pool set real-tier target_max_bytes 123456
+  ceph osd pool get real-tier target_max_bytes | \
     grep 'target_max_bytes:[ \t]\+123456'
-  ceph osd pool set rbd cache_target_dirty_ratio .123
-  ceph osd pool get rbd cache_target_dirty_ratio | \
+  ceph osd pool set real-tier cache_target_dirty_ratio .123
+  ceph osd pool get real-tier cache_target_dirty_ratio | \
     grep 'cache_target_dirty_ratio:[ \t]\+0.123'
-  expect_false ceph osd pool set rbd cache_target_dirty_ratio -.2
-  expect_false ceph osd pool set rbd cache_target_dirty_ratio 1.1
-  ceph osd pool set rbd cache_target_full_ratio .123
-  ceph osd pool get rbd cache_target_full_ratio | \
+  expect_false ceph osd pool set real-tier cache_target_dirty_ratio -.2
+  expect_false ceph osd pool set real-tier cache_target_dirty_ratio 1.1
+  ceph osd pool set real-tier cache_target_full_ratio .123
+  ceph osd pool get real-tier cache_target_full_ratio | \
     grep 'cache_target_full_ratio:[ \t]\+0.123'
   ceph osd dump -f json-pretty | grep '"cache_target_full_ratio_micro": 123000'
-  ceph osd pool set rbd cache_target_full_ratio 1.0
-  ceph osd pool set rbd cache_target_full_ratio 0
-  expect_false ceph osd pool set rbd cache_target_full_ratio 1.1
-  ceph osd pool set rbd cache_min_flush_age 123
-  ceph osd pool get rbd cache_min_flush_age | \
+  ceph osd pool set real-tier cache_target_full_ratio 1.0
+  ceph osd pool set real-tier cache_target_full_ratio 0
+  expect_false ceph osd pool set real-tier cache_target_full_ratio 1.1
+  ceph osd pool set real-tier cache_min_flush_age 123
+  ceph osd pool get real-tier cache_min_flush_age | \
     grep 'cache_min_flush_age:[ \t]\+123'
-  ceph osd pool set rbd cache_min_evict_age 234
-  ceph osd pool get rbd cache_min_evict_age | \
+  ceph osd pool set real-tier cache_min_evict_age 234
+  ceph osd pool get real-tier cache_min_evict_age | \
     grep 'cache_min_evict_age:[ \t]\+234'
 
+  # this is not a tier pool
+  ceph osd pool create fake-tier 2
+
+  expect_false ceph osd pool set fake-tier hit_set_type explicit_hash
+  expect_false ceph osd pool get fake-tier hit_set_type
+  expect_false ceph osd pool set fake-tier hit_set_type explicit_object
+  expect_false ceph osd pool get fake-tier hit_set_type
+  expect_false ceph osd pool set fake-tier hit_set_type bloom
+  expect_false ceph osd pool get fake-tier hit_set_type
+  expect_false ceph osd pool set fake-tier hit_set_type i_dont_exist
+  expect_false ceph osd pool set fake-tier hit_set_period 123
+  expect_false ceph osd pool get fake-tier hit_set_period
+  expect_false ceph osd pool set fake-tier hit_set_count 12
+  expect_false ceph osd pool get fake-tier hit_set_count
+  expect_false ceph osd pool set fake-tier hit_set_fpp .01
+  expect_false ceph osd pool get fake-tier hit_set_fpp
+
+  expect_false ceph osd pool set fake-tier target_max_objects 123
+  expect_false ceph osd pool get fake-tier target_max_objects
+  expect_false ceph osd pool set fake-tier target_max_bytes 123456
+  expect_false ceph osd pool get fake-tier target_max_bytes
+  expect_false ceph osd pool set fake-tier cache_target_dirty_ratio .123
+  expect_false ceph osd pool get fake-tier cache_target_dirty_ratio
+  expect_false expect_false ceph osd pool set fake-tier cache_target_dirty_ratio -.2
+  expect_false expect_false ceph osd pool set fake-tier cache_target_dirty_ratio 1.1
+  expect_false ceph osd pool set fake-tier cache_target_full_ratio .123
+  expect_false ceph osd pool get fake-tier cache_target_full_ratio
+  expect_false ceph osd dump -f json-pretty
+  expect_false ceph osd pool set fake-tier cache_target_full_ratio 1.0
+  expect_false ceph osd pool set fake-tier cache_target_full_ratio 0
+  expect_false expect_false ceph osd pool set fake-tier cache_target_full_ratio 1.1
+  expect_false ceph osd pool set fake-tier cache_min_flush_age 123
+  expect_false ceph osd pool get fake-tier cache_min_flush_age
+  expect_false ceph osd pool set fake-tier cache_min_evict_age 234
+  expect_false ceph osd pool get fake-tier cache_min_evict_age
+
+  ceph osd tier remove rbd real-tier
+  ceph osd pool delete real-tier real-tier --yes-i-really-really-mean-it
+  ceph osd pool delete fake-tier fake-tier --yes-i-really-really-mean-it
 }
 
 function test_mon_osd_erasure_code()
@@ -879,6 +922,7 @@ TESTS=(
   mon_osd_pool_quota
   mon_pg
   mon_osd_pool_set
+  mon_osd_tiered_pool_set
   mon_osd_erasure_code
   mon_osd_misc
   mon_heap_profiler