blob: 829d2b12b6c615e33a44ba4d5a70bfcde6100f77 (
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
|
#!/bin/bash
. $(dirname $0)/../../include.rc
. $(dirname $0)/../../cluster.rc
. $(dirname $0)/../../volume.rc
get_rebalance_status() {
$CLI volume status $V0 | egrep ^"Status " | awk '{print $3}'
}
run_rebal_check_status() {
TEST $CLI volume rebalance $V0 start
EXPECT_WITHIN $REBALANCE_TIMEOUT "completed" rebalance_status_field $V0
REBAL_STATE=$(get_rebalance_status)
TEST [ $REBAL_STATE == "completed" ]
}
replace_brick_check_status() {
TEST $CLI volume replace-brick $V0 $H0:$B0/${V0}1 $H0:$B0/${V0}1_replace commit force
REBAL_STATE=$(get_rebalance_status)
TEST [ $REBAL_STATE == "reset" ]
}
reset_brick_check_status() {
TEST $CLI volume reset-brick $V0 $H0:$B0/${V0}2 start
TEST $CLI volume reset-brick $V0 $H0:$B0/${V0}2 $H0:$B0/${V0}2 commit force
REBAL_STATE=$(get_rebalance_status)
TEST [ $REBAL_STATE == "reset" ]
}
cleanup;
TEST glusterd;
TEST pidof glusterd;
TEST $CLI volume info;
TEST $CLI volume create $V0 replica 3 $H0:$B0/${V0}{1..6} force;
TEST $CLI volume start $V0;
run_rebal_check_status;
replace_brick_check_status;
reset_brick_check_status;
cleanup;
|