diff options
author | Atin Mukherjee <amukherj@redhat.com> | 2015-06-03 10:40:36 +0530 |
---|---|---|
committer | Krishnan Parthasarathi <kparthas@redhat.com> | 2015-06-16 03:01:03 -0700 |
commit | f65490c5d87c4282717b7f28cfcd1fe9380c6154 (patch) | |
tree | 4e1bd0c3b00d39ccbfba8785e90133120eb42b79 /tests/bugs/glusterd/bug-857330 | |
parent | 8e81dccfce17db2d388de95b0b009478cc7d0d4d (diff) | |
download | glusterfs-f65490c5d87c4282717b7f28cfcd1fe9380c6154.tar.gz glusterfs-f65490c5d87c4282717b7f28cfcd1fe9380c6154.tar.xz glusterfs-f65490c5d87c4282717b7f28cfcd1fe9380c6154.zip |
tests: fix spurious failure in bug-857330/xml.t
get-task-status () used to always return 0 *until and unless* the CLI command
itself fails which is unlikely. However if the CLI command fails due to some
reason EXPECT_WITHIN will abort.
Change-Id: Ibe54dcdccc26b3ee003677fc3516cfed98b5c06f
BUG: 1227590
Signed-off-by: Atin Mukherjee <amukherj@redhat.com>
Reviewed-on: http://review.gluster.org/11054
Tested-by: NetBSD Build System <jenkins@build.gluster.org>
Tested-by: Gluster Build System <jenkins@build.gluster.com>
Reviewed-by: Krishnan Parthasarathi <kparthas@redhat.com>
Diffstat (limited to 'tests/bugs/glusterd/bug-857330')
-rw-r--r-- | tests/bugs/glusterd/bug-857330/common.rc | 10 | ||||
-rwxr-xr-x | tests/bugs/glusterd/bug-857330/normal.t | 4 | ||||
-rwxr-xr-x | tests/bugs/glusterd/bug-857330/xml.t | 4 |
3 files changed, 10 insertions, 8 deletions
diff --git a/tests/bugs/glusterd/bug-857330/common.rc b/tests/bugs/glusterd/bug-857330/common.rc index 8342dccb44..d0aa4b1a64 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 6377b59070..c575038b84 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 7d04fe199d..c25a8a6325 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 |