summaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
Diffstat (limited to 'tests')
-rw-r--r--tests/bugs/cli/bug-1077682.t10
-rw-r--r--tests/bugs/glusterd/bug-857330/common.rc10
-rwxr-xr-xtests/bugs/glusterd/bug-857330/normal.t4
-rwxr-xr-xtests/bugs/glusterd/bug-857330/xml.t4
4 files changed, 10 insertions, 18 deletions
diff --git a/tests/bugs/cli/bug-1077682.t b/tests/bugs/cli/bug-1077682.t
index 6b6d71eeb46..eab5d86d04b 100644
--- a/tests/bugs/cli/bug-1077682.t
+++ b/tests/bugs/cli/bug-1077682.t
@@ -3,16 +3,6 @@
. $(dirname $0)/../../include.rc
. $(dirname $0)/../../volume.rc
-function get-task-status()
-{
- $CLI $COMMAND | grep -o $PATTERN
- if [ ${PIPESTATUS[0]} -ne 0 ];
- then
- return 1
- fi
- return 0
-}
-
cleanup;
TEST glusterd
diff --git a/tests/bugs/glusterd/bug-857330/common.rc b/tests/bugs/glusterd/bug-857330/common.rc
index 8342dccb442..d0aa4b1a640 100644
--- a/tests/bugs/glusterd/bug-857330/common.rc
+++ b/tests/bugs/glusterd/bug-857330/common.rc
@@ -47,9 +47,11 @@ function get-task-id-xml()
function get-task-status()
{
- $CLI $COMMAND | grep -o $PATTERN
- if [ ${PIPESTATUS[0]} -ne 0 ]; then
- return 1
+ pattern=$1
+ val=1
+ test=$(gluster $COMMAND | grep -o $pattern 2>&1)
+ if [ $? -eq 0 ]; then
+ val=0
fi
- return 0
+ echo $val
}
diff --git a/tests/bugs/glusterd/bug-857330/normal.t b/tests/bugs/glusterd/bug-857330/normal.t
index 6377b59070d..c575038b840 100755
--- a/tests/bugs/glusterd/bug-857330/normal.t
+++ b/tests/bugs/glusterd/bug-857330/normal.t
@@ -34,7 +34,7 @@ EXPECT $TASK_ID get-task-id
COMMAND="volume rebalance $V0 status"
PATTERN="completed"
-EXPECT_WITHIN 300 $PATTERN get-task-status
+EXPECT_WITHIN $REBALANCE_TIMEOUT "0" get-task-status $PATTERN
###################
## Replace-brick ##
@@ -56,7 +56,7 @@ EXPECT $TASK_ID get-task-id
COMMAND="volume remove-brick $V0 $H0:$B0/${V0}3 status"
PATTERN="completed"
-EXPECT_WITHIN 300 $PATTERN get-task-status
+EXPECT_WITHIN $REBALANCE_TIMEOUT "0" get-task-status $PATTERN
TEST $CLI volume remove-brick $V0 $H0:$B0/${V0}3 commit
diff --git a/tests/bugs/glusterd/bug-857330/xml.t b/tests/bugs/glusterd/bug-857330/xml.t
index 7d04fe199d3..c25a8a63251 100755
--- a/tests/bugs/glusterd/bug-857330/xml.t
+++ b/tests/bugs/glusterd/bug-857330/xml.t
@@ -42,7 +42,7 @@ EXPECT $TASK_ID get-task-id-xml
COMMAND="volume rebalance $V0 status"
PATTERN="completed"
-EXPECT_WITHIN 300 $PATTERN get-task-status
+EXPECT_WITHIN $REBALANCE_TIMEOUT "0" get-task-status $PATTERN
###################
## Replace-brick ##
@@ -66,7 +66,7 @@ EXPECT $TASK_ID get-task-id-xml
COMMAND="volume remove-brick $V0 $H0:$B0/${V0}3 status"
PATTERN="completed"
-EXPECT_WITHIN 300 $PATTERN get-task-status
+EXPECT_WITHIN $REBALANCE_TIMEOUT "0" get-task-status $PATTERN
## TODO: Add tests for remove-brick stop