3
#Test case: Create a distributed replicate volume, and remove multiple
4
#replica pairs in a single remove-brick command.
6
. $(dirname $0)/../include.rc
7
. $(dirname $0)/../volume.rc
16
#Create a 3X2 distributed-replicate volume
17
TEST $CLI volume create $V0 replica 2 $H0:$B0/${V0}{1..6};
18
TEST $CLI volume start $V0
20
# Mount FUSE and create files
21
TEST glusterfs -s $H0 --volfile-id $V0 $M0
22
TEST touch $M0/file{1..10}
24
# Remove bricks from two sub-volumes to make it a 1x2 vol.
25
# Bricks in question are given in a random order but from the same subvols.
26
function remove_brick_start_status {
27
$CLI volume remove-brick $V0 \
28
$H0:$B0/${V0}6 $H0:$B0/${V0}1 \
29
$H0:$B0/${V0}2 $H0:$B0/${V0}5 start 2>&1 |grep -oE "success|failed"
31
EXPECT "success" remove_brick_start_status;
33
# Wait for rebalance to complete
34
EXPECT_WITHIN 10 "completed" remove_brick_status_completed_field "$V0" "$H0:$B0/${V0}6 $H0:$B0/${V0}1 $H0:$B0/${V0}2 $H0:$B0/${V0}5"
37
function remove_brick_commit_status {
38
$CLI volume remove-brick $V0 \
39
$H0:$B0/${V0}6 $H0:$B0/${V0}1 \
40
$H0:$B0/${V0}2 $H0:$B0/${V0}5 commit 2>&1 |grep -oE "success|failed"
42
EXPECT "success" remove_brick_commit_status;
44
# Check the volume type
45
EXPECT "Replicate" echo `$CLI volume info |grep Type |awk '{print $2}'`
48
TEST $CLI volume stop $V0
49
TEST $CLI volume delete $V0;
50
TEST ! $CLI volume info $V0;