blob: d393e5c6834f4bcc4433e30d71653c3459b3a92b (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
|
#!/usr/bin/env bash
set -uex
# number of osds = 10
crushtool -o crushmap --build --num_osds 10 host straw 2 rack straw 2 row straw 2 root straw 0
ceph osd setcrushmap -i crushmap
ceph osd tree
ceph tell osd.* injectargs --osd_max_markdown_count 1024 --osd_max_markdown_period 1
ceph osd set noout
wait_for_healthy() {
while ceph health | grep down
do
sleep 1
done
}
test_mark_two_osds_same_host_down() {
ceph osd set noup
ceph osd down osd.0 osd.1
ceph health detail
ceph health | grep "1 host"
ceph health | grep "2 osds"
ceph health detail | grep "osd.0"
ceph health detail | grep "osd.1"
ceph osd unset noup
wait_for_healthy
}
test_mark_two_osds_same_rack_down() {
ceph osd set noup
ceph osd down osd.8 osd.9
ceph health detail
ceph health | grep "1 host"
ceph health | grep "1 rack"
ceph health | grep "1 row"
ceph health | grep "2 osds"
ceph health detail | grep "osd.8"
ceph health detail | grep "osd.9"
ceph osd unset noup
wait_for_healthy
}
test_mark_all_but_last_osds_down() {
ceph osd set noup
ceph osd down $(ceph osd ls | sed \$d)
ceph health detail
ceph health | grep "1 row"
ceph health | grep "2 racks"
ceph health | grep "4 hosts"
ceph health | grep "9 osds"
ceph osd unset noup
wait_for_healthy
}
test_mark_two_osds_same_host_down_with_classes() {
ceph osd set noup
ceph osd crush set-device-class ssd osd.0 osd.2 osd.4 osd.6 osd.8
ceph osd crush set-device-class hdd osd.1 osd.3 osd.5 osd.7 osd.9
ceph osd down osd.0 osd.1
ceph health detail
ceph health | grep "1 host"
ceph health | grep "2 osds"
ceph health detail | grep "osd.0"
ceph health detail | grep "osd.1"
ceph osd unset noup
wait_for_healthy
}
test_mark_two_osds_same_host_down
test_mark_two_osds_same_rack_down
test_mark_all_but_last_osds_down
test_mark_two_osds_same_host_down_with_classes
exit 0
|