summaryrefslogtreecommitdiffstats
path: root/tests/bugs/bug-861945.t
blob: 29ccb33c8b11199a5b29cb6e62fd6a1f315c2251 (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
#!/bin/bash

. $(dirname $0)/../include.rc

cleanup;

function georep_start_and_check()
{
    local master=$1
    local slave=$2

    $CLI volume geo-replication $master $slave start
}

function georep_stop()
{
    local master=$1
    local slave=$2

    $CLI volume geo-replication $master $slave stop
}

TEST glusterd
TEST pidof glusterd
TEST $CLI volume create $V0 $H0:$B0/brick0 $H0:$B0/brick1
TEST $CLI volume start $V0

sleep 5

slave=`mktemp -d`
mkdir -p $slave

# check normal functionality of geo-replication
EXPECT_KEYWORD "successful" georep_start_and_check $V0 $slave
TEST georep_stop $V0 $slave

# now invoke replace brick
TEST $CLI volume replace-brick $V0 $H0:$B0/brick1 $H0:$B0/brick2 start

# check if CLI refuses to start geo replication
EXPECT_KEYWORD "failed" georep_start_and_check $V0 $slave

# commit replace brick operation
TEST $CLI volume replace-brick $V0 $H0:$B0/brick1 $H0:$B0/brick2 commit

# geo replication should work as usual
EXPECT_KEYWORD "successful" georep_start_and_check $V0 $slave
TEST georep_stop $V0 $slave

rm -rf $slave
cleanup