diff options
Diffstat (limited to 'tests/dht.rc')
-rw-r--r-- | tests/dht.rc | 24 |
1 files changed, 22 insertions, 2 deletions
diff --git a/tests/dht.rc b/tests/dht.rc index bf5e08b645e..53b00645e66 100644 --- a/tests/dht.rc +++ b/tests/dht.rc @@ -66,13 +66,33 @@ function get_hashed_brick() } +function cluster_rebalance_completed() +{ + val=1 + + # Rebalance status will be either "failed" or "completed" + + test=$($CLI_1 volume rebalance $V0 status | grep "in progress" 2>&1) + if [ $? -ne 0 ] + then + val=0 + fi + + echo $val + # Do not *return* the value here. If it's non-zero, that will cause + # EXPECT_WITHIN (e.g. in bug-884455.t) to return prematurely, leading to + # a spurious test failure. Nothing else checks the return value anyway + # (they all check the output) so there's no need for it to be non-zero + # just because grep didn't find what we want. +} + function rebalance_completed() { val=1 - test=$(gluster volume rebalance $V0 status | grep localhost | grep "completed" 2>&1) + test=$($CLI volume rebalance $V0 status | grep localhost | grep "completed" 2>&1) if [ $? -eq 0 ] then - val=0 + val=0 fi echo $val |