3 source $CEPH_ROOT/qa
/standalone
/ceph-helpers.sh
9 export CEPH_MON
="127.0.0.1:7143" # git grep '\<714\>' : there must be only one
11 CEPH_ARGS
+="--fsid=$(uuidgen) --auth-supported=none --mon-pg-warn-min-per-osd 0 --mon-max-pg-per-osd 1000 "
12 CEPH_ARGS
+="--mon-host=$CEPH_MON "
14 local funcs
=${@:-$(set | sed -n -e 's/^\(TEST_[0-9a-z_]*\) .*/\1/p')}
15 for func
in $funcs ; do
16 setup
$dir ||
return 1
17 $func $dir ||
return 1
18 teardown
$dir ||
return 1
22 function TEST_mute
() {
24 setup
$dir ||
return 1
28 run_mon
$dir a ||
return 1
29 run_mgr
$dir x ||
return 1
30 run_osd
$dir 0 ||
return 1
31 run_osd
$dir 1 ||
return 1
32 run_osd
$dir 2 ||
return 1
34 ceph osd pool create foo
8
35 ceph osd pool application
enable foo rbd
--yes-i-really-mean-it
36 wait_for_clean ||
return 1
39 ceph health |
grep HEALTH_OK ||
return 1
40 # test warning on setting pool size=1
41 ceph osd pool
set foo size
1
43 ceph health |
grep HEALTH_WARN ||
return 1
44 ceph health detail |
grep POOL_NO_REDUNDANCY ||
return 1
45 ceph health mute POOL_NO_REDUNDANCY
47 ceph health |
grep HEALTH_OK |
grep POOL_NO_REDUNDANCY ||
return 1
48 ceph health unmute POOL_NO_REDUNDANCY
50 ceph health |
grep HEALTH_WARN ||
return 1
51 # restore pool size to default
52 ceph osd pool
set foo size
3
54 ceph health |
grep HEALTH_OK ||
return 1
57 ceph health detail |
grep OSDMAP_FLAGS ||
return 1
60 ceph health detail |
grep OSD_DOWN ||
return 1
61 ceph health detail |
grep HEALTH_WARN ||
return 1
63 ceph health mute OSD_DOWN
64 ceph health mute OSDMAP_FLAGS
66 ceph health |
grep HEALTH_OK |
grep OSD_DOWN |
grep OSDMAP_FLAGS ||
return 1
67 ceph health unmute OSD_DOWN
69 ceph health |
grep HEALTH_WARN ||
return 1
72 ceph health mute OSD_DOWN
10s
74 ceph health |
grep HEALTH_OK ||
return 1
77 ceph health |
grep HEALTH_WARN ||
return 1
80 ceph health mute OSDMAP_FLAGS
--sticky
84 ceph health |
grep OSDMAP_FLAGS ||
return 1
87 ceph health |
grep HEALTH_OK ||
return 1
89 # rachet down on OSD_DOWN count
92 ceph health detail |
grep OSD_DOWN ||
return 1
94 ceph health mute OSD_DOWN
95 kill_daemons
$dir TERM osd
.0
99 ceph health detail |
grep OSD_DOWN ||
return 1
100 ceph health detail |
grep '1 osds down' ||
return 1
101 ceph health |
grep HEALTH_OK ||
return 1
103 sleep 10 # give time for mon tick to rachet the mute
105 ceph health mute OSDMAP_FLAGS
108 ceph health |
grep HEALTH_OK ||
return 1
113 ceph health detail |
grep '2 osds down' ||
return 1
115 sleep 10 # give time for mute to clear
118 ceph health |
grep HEALTH_WARN ||
return 1
119 ceph health detail |
grep '2 osds down' ||
return 1
121 teardown
$dir ||
return 1
124 main health-mute
"$@"