From: Joao Eduardo Luis Date: Fri, 27 Jun 2014 21:20:51 +0000 (+0100) Subject: qa/workunits: cephtool: test for 'osd pool {get,set}-quota' X-Git-Tag: v0.84~134^2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=refs%2Fpull%2F2029%2Fhead;p=ceph.git qa/workunits: cephtool: test for 'osd pool {get,set}-quota' Signed-off-by: Joao Eduardo Luis --- diff --git a/qa/workunits/cephtool/test.sh b/qa/workunits/cephtool/test.sh index 0b3fdbc199d..80d1d3ea0a0 100755 --- a/qa/workunits/cephtool/test.sh +++ b/qa/workunits/cephtool/test.sh @@ -557,6 +557,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 @@ -827,6 +873,7 @@ TESTS=( mon_mon mon_osd mon_osd_pool + mon_osd_pool_quota mon_pg mon_osd_pool_set mon_osd_erasure_code