]> git.proxmox.com Git - ceph.git/blob - ceph/qa/standalone/osd/ec-error-rollforward.sh
update sources to 12.2.7
[ceph.git] / ceph / qa / standalone / osd / ec-error-rollforward.sh
1 #!/usr/bin/env bash
2
3 source $CEPH_ROOT/qa/standalone/ceph-helpers.sh
4
5 function run() {
6 local dir=$1
7 shift
8
9 # Fix port????
10 export CEPH_MON="127.0.0.1:7132" # git grep '\<7132\>' : there must be only one
11 export CEPH_ARGS
12 CEPH_ARGS+="--fsid=$(uuidgen) --auth-supported=none "
13 CEPH_ARGS+="--mon-host=$CEPH_MON --osd-objectstore filestore"
14 export margin=10
15 export objects=200
16 export poolname=test
17
18 local funcs=${@:-$(set | sed -n -e 's/^\(TEST_[0-9a-z_]*\) .*/\1/p')}
19 for func in $funcs ; do
20 setup $dir || return 1
21 $func $dir || return 1
22 teardown $dir || return 1
23 done
24 }
25
26 function TEST_ec_error_rollforward() {
27 local dir=$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
33 run_osd $dir 3 || return 1
34
35 ceph osd erasure-code-profile set ec-profile m=2 k=2 crush-failure-domain=osd
36 ceph osd pool create ec 1 1 erasure ec-profile
37
38 rados -p ec put foo /etc/passwd
39
40 kill -STOP `cat $dir/osd.2.pid`
41
42 rados -p ec rm foo &
43 sleep 1
44 rados -p ec rm a &
45 rados -p ec rm b &
46 rados -p ec rm c &
47 sleep 1
48 kill -9 `cat $dir/osd.?.pid`
49 kill %1 %2 %3 %4
50
51 run_osd $dir 0 || return 1
52 run_osd $dir 1 || return 1
53 run_osd $dir 2 || return 1
54 run_osd $dir 3 || return 1
55
56 wait_for_clean || return 1
57 }
58
59 main ec-error-rollforward "$@"