fi
}
+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
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
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
#
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'
grep "$mymsg" $TMPDIR/$$
fi
kill $wpid
+}
+
+function test_mon_mds()
+{
ceph mds cluster_down
ceph mds cluster_up
# 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
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
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
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
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
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
# 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
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