]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
qa/workunits: cephtool: test for 'osd pool {get,set}-quota'
authorJoao Eduardo Luis <joao.luis@inktank.com>
Fri, 27 Jun 2014 21:20:51 +0000 (22:20 +0100)
committerSage Weil <sage@redhat.com>
Fri, 1 Aug 2014 23:58:29 +0000 (16:58 -0700)
Signed-off-by: Joao Eduardo Luis <joao.luis@inktank.com>
(cherry picked from commit b927c0de7d5c7a78bf3c133be52cbc1d769974bb)

qa/workunits/cephtool/test.sh

index 51a40ee639d5b18568ea48426b1e819ca9978e70..8c55bc07e594c29fa859ea55b02ab5f8a96f7ddf 100755 (executable)
@@ -510,6 +510,52 @@ function test_mon_osd_pool()
   ceph osd pool delete replicated replicated --yes-i-really-really-mean-it
 }
 
+function test_mon_osd_pool_quota()
+{
+  #
+  # test osd pool set/get quota
+  #
+
+  # create tmp pool
+  ceph osd pool create tmp-quota-pool 36
+  #
+  # set erroneous quotas
+  #
+  expect_false ceph osd pool set-quota tmp-quota-pool max_fooness 10
+  expect_false ceph osd pool set-quota tmp-quota-pool max_bytes -1
+  expect_false ceph osd pool set-quota tmp-quota-pool max_objects aaa
+  #
+  # set valid quotas
+  #
+  ceph osd pool set-quota tmp-quota-pool max_bytes 10
+  ceph osd pool set-quota tmp-quota-pool max_objects 10M
+  #
+  # get quotas
+  #
+  ceph osd pool get-quota tmp-quota-pool | grep 'max bytes.*10B'
+  ceph osd pool get-quota tmp-quota-pool | grep 'max objects.*10240k objects'
+  #
+  # get quotas in json-pretty format
+  #
+  ceph osd pool get-quota tmp-quota-pool --format=json-pretty | \
+    grep '"quota_max_objects":.*10485760'
+  ceph osd pool get-quota tmp-quota-pool --format=json-pretty | \
+    grep '"quota_max_bytes":.*10'
+  #
+  # reset pool quotas
+  #
+  ceph osd pool set-quota tmp-quota-pool max_bytes 0
+  ceph osd pool set-quota tmp-quota-pool max_objects 0
+  #
+  # test N/A quotas
+  #
+  ceph osd pool get-quota tmp-quota-pool | grep 'max bytes.*N/A'
+  ceph osd pool get-quota tmp-quota-pool | grep 'max objects.*N/A'
+  #
+  # cleanup tmp pool
+  ceph osd pool delete tmp-quota-pool tmp-quota-pool --yes-i-really-really-mean-it
+}
+
 function test_mon_pg()
 {
   ceph pg debug unfound_objects_exist
@@ -776,6 +822,7 @@ TESTS=(
   mon_mon
   mon_osd
   mon_osd_pool
+  mon_osd_pool_quota
   mon_pg
   mon_osd_pool_set
   mon_osd_erasure_code