]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
qa/workunits: cephtool: split into functions
authorJoao Eduardo Luis <joao.luis@inktank.com>
Wed, 25 Jun 2014 00:11:52 +0000 (01:11 +0100)
committerSage Weil <sage@redhat.com>
Fri, 1 Aug 2014 23:55:30 +0000 (16:55 -0700)
Signed-off-by: Joao Eduardo Luis <joao.luis@inktank.com>
(cherry picked from commit db6cc133ba4bb38b3c11eb835fd3983dc2f6b00e)

Conflicts:
qa/workunits/cephtool/test.sh

qa/workunits/cephtool/test.sh

index e7a19d43422116a5cd102a72d0f86e3a954f0b18..1f3fabbb82c4f949dba0255f9d239e6eb8439385 100755 (executable)
@@ -87,6 +87,8 @@ function expect_config_value()
 }
 
 
+function test_mon_injectargs_SI()
+{
 # Test SI units during injectargs and 'config set'
 # We only aim at testing the units are parsed accordingly
 # and don't intend to test whether the options being set
@@ -111,7 +113,10 @@ ceph tell mon.a injectargs '--mon_pg_warn_min_objects 1G'
 expect_config_value "mon.a" "mon_pg_warn_min_objects" 1073741824
 expect_false ceph injectargs mon.a '--mon_pg_warn_min_objects 10F'
 ceph daemon mon.a config set mon_pg_warn_min_objects $initial_value
+}
 
+function test_tiering()
+{
 # tiering
 ceph osd pool create cache 2
 ceph osd pool create cache2 2
@@ -215,7 +220,11 @@ 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 pool delete cache4 cache4 --yes-i-really-really-mean-it
+}
+
 
+function test_auth()
+{
 # Assumes there are at least 3 MDSes and two OSDs
 #
 
@@ -239,7 +248,11 @@ ceph auth export -o authfile2
 diff authfile authfile2
 rm authfile authfile2
 ceph auth del client.xx
+}
 
+
+function test_mon_misc()
+{
 # with and without verbosity
 ceph osd dump | grep '^epoch'
 ceph --concise osd dump | grep '^epoch'
@@ -277,7 +290,11 @@ if ! grep "$mymsg" $TMPDIR/$$; then
     grep "$mymsg" $TMPDIR/$$
 fi
 kill $wpid
+}
+
 
+function test_mon_mds()
+{
 ceph mds cluster_down
 ceph mds cluster_up
 
@@ -333,14 +350,20 @@ ceph mds stat
 # ceph mds rmfailed
 # ceph mds set_state
 # ceph mds stop
+}
 
+function test_mon_mon()
+{
 # no mon add/remove
 ceph mon dump
 ceph mon getmap -o $TMPDIR/monmap.$$
 [ -s $TMPDIR/monmap.$$ ]
 # ceph mon tell
 ceph mon_status
+}
 
+function test_mon_osd()
+{
 bl=192.168.0.1:0/1000
 ceph osd blacklist add $bl
 ceph osd blacklist ls | grep $bl
@@ -452,7 +475,10 @@ ceph osd dump | grep 'flags pauserd,pausewr'
 ceph osd unpause
 
 ceph osd tree
+}
 
+function test_mon_osd_pool()
+{
 ceph osd pool mksnap data datasnap
 rados -p data lssnap | grep datasnap
 ceph osd pool rmsnap data datasnap
@@ -472,7 +498,10 @@ ceph osd lspools | grep replicated
 ceph osd pool delete replicated replicated --yes-i-really-really-mean-it
 
 ceph osd stat | grep up,
+}
 
+function test_mon_pg()
+{
 ceph pg debug unfound_objects_exist
 ceph pg debug degraded_pgs_exist
 ceph pg deep-scrub 0.0
@@ -536,6 +565,10 @@ expect_false ceph osd pg-temp 0.0 asdf
 expect_false ceph osd pg-temp 0.0
 
 # don't test ceph osd primary-temp for now
+}
+
+function test_mon_osd_pool_set()
+{
 
 for s in pg_num pgp_num size min_size crash_replay_interval crush_ruleset; do
        ceph osd pool get data $s
@@ -594,7 +627,10 @@ ceph osd pool set rbd cache_min_flush_age 123
 ceph osd pool set rbd cache_min_evict_age 234
 
 ceph osd pool get rbd crush_ruleset | grep 'crush_ruleset: 0'
+}
 
+function test_mon_osd_erasure_code()
+{
 
 ceph osd erasure-code-profile set fooprofile a=b c=d
 ceph osd erasure-code-profile set fooprofile a=b c=d
@@ -602,8 +638,10 @@ expect_false ceph osd erasure-code-profile set fooprofile a=b c=d e=f
 ceph osd erasure-code-profile set fooprofile a=b c=d e=f --force
 ceph osd erasure-code-profile set fooprofile a=b c=d e=f
 expect_false ceph osd erasure-code-profile set fooprofile a=b c=d e=f g=h
+}
 
-
+function test_mon_osd_misc()
+{
 set +e
 
 # expect error about missing 'pool' argument
@@ -617,15 +655,21 @@ ceph pg set_full_ratio 95 2>$TMPFILE; check_response 'not in range' $? 22
 
 # expect "not in range" for invalid overload percentage
 ceph osd reweight-by-utilization 80 2>$TMPFILE; check_response 'not in range' $? 22
+set -e
+}
 
+function test_mon_heap_profiler()
+{
 # expect 'heap' commands to be correctly parsed
 ceph heap stats
 ceph heap start_profiler
 ceph heap dump
 ceph heap stop_profiler
 ceph heap release
+}
 
-
+function test_osd_bench()
+{
 # test osd bench limits
 # As we should not rely on defaults (as they may change over time),
 # lets inject some values and perform some simple tests
@@ -662,5 +706,21 @@ ceph tell osd.0 bench 409600 4096
 expect_false ceph tell osd.0 bench 51 2097152
 # but 50 must succeed
 ceph tell osd.0 bench 50 2097152
+}
+
+test_mon_injectargs_SI ;
+test_tiering ;
+test_auth ;
+test_mon_misc ;
+test_mon_mds ;
+test_mon_mon ;
+test_mon_osd ;
+test_mon_osd_pool ;
+test_mon_pg ;
+test_mon_osd_pool_set ;
+test_mon_osd_erasure_code ;
+test_mon_osd_misc ;
+test_mon_heap_profiler ;
+test_osd_bench ;
 
 echo OK