summaryrefslogtreecommitdiffstats
path: root/tests/bugs/glusterd/bug-1507466-reset-brick-commit-force.t
blob: 764399dfab99bd63255388c94d39563bc9d674b2 (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
#!/bin/bash
. $(dirname $0)/../../include.rc
. $(dirname $0)/../../cluster.rc
cleanup;

function check_peers {
        $CLI_1 peer status | grep 'Peer in Cluster (Connected)' | wc -l
}

TEST launch_cluster 3
TEST $CLI_1 peer probe $H2;
EXPECT_WITHIN $PROBE_TIMEOUT 1 check_peers

TEST $CLI_1 volume create $V0 replica 2 $H1:$B0/${V0} $H2:$B0/${V0}
TEST $CLI_1 volume start $V0

# Negative case with brick not killed && volume-id xattrs present
TEST ! $CLI_1 volume reset-brick $V0 $H1:$B0/${V0} $H1:$B0/${V0} commit force

TEST $CLI_1 volume reset-brick $V0 $H1:$B0/${V0} start
# Now test if reset-brick commit force works
TEST $CLI_1 volume reset-brick $V0 $H1:$B0/${V0} $H1:$B0/${V0} commit force

cleanup;