]>
Commit | Line | Data |
---|---|---|
f6b5b4d7 TL |
1 | #!/usr/bin/env bash |
2 | ||
3 | source $CEPH_ROOT/qa/standalone/ceph-helpers.sh | |
4 | ||
5 | mon_port=$(get_unused_port) | |
6 | ||
7 | function run() { | |
8 | local dir=$1 | |
9 | shift | |
10 | ||
11 | export CEPH_MON="127.0.0.1:$mon_port" | |
12 | export CEPH_ARGS | |
13 | CEPH_ARGS+="--fsid=$(uuidgen) --auth-supported=none " | |
14 | CEPH_ARGS+="--mon-host=$CEPH_MON " | |
15 | set -e | |
16 | ||
17 | local funcs=${@:-$(set | sed -n -e 's/^\(TEST_[0-9a-z_]*\) .*/\1/p')} | |
18 | for func in $funcs ; do | |
19 | setup $dir || return 1 | |
20 | $func $dir || return 1 | |
21 | teardown $dir || return 1 | |
22 | done | |
23 | } | |
24 | ||
25 | function TEST_bad_inc_map() { | |
26 | local dir=$1 | |
27 | ||
28 | run_mon $dir a | |
29 | run_mgr $dir x | |
30 | run_osd $dir 0 | |
31 | run_osd $dir 1 | |
32 | run_osd $dir 2 | |
33 | ||
34 | ceph config set osd.2 osd_inject_bad_map_crc_probability 1 | |
35 | ||
36 | # osd map churn | |
37 | create_pool foo 8 | |
38 | ceph osd pool set foo min_size 1 | |
39 | ceph osd pool set foo min_size 2 | |
40 | ||
41 | sleep 5 | |
42 | ||
43 | # make sure all the OSDs are still up | |
44 | TIMEOUT=10 wait_for_osd up 0 | |
45 | TIMEOUT=10 wait_for_osd up 1 | |
46 | TIMEOUT=10 wait_for_osd up 2 | |
47 | ||
48 | # check for the signature in the log | |
49 | grep "injecting map crc failure" $dir/osd.2.log || return 1 | |
50 | grep "bailing because last" $dir/osd.2.log || return 1 | |
51 | ||
52 | echo success | |
53 | ||
54 | delete_pool foo | |
55 | kill_daemons $dir || return 1 | |
56 | } | |
57 | ||
58 | main bad-inc-map "$@" | |
59 | ||
60 | # Local Variables: | |
61 | # compile-command: "make -j4 && ../qa/run-standalone.sh bad-inc-map.sh" | |
62 | # End: |