diff options
author | Atin Mukherjee <amukherj@redhat.com> | 2015-06-03 10:40:36 +0530 |
---|---|---|
committer | Vijay Bellur <vbellur@redhat.com> | 2015-06-17 15:31:28 -0700 |
commit | 7255e567959ca6f0c211afff00e97a911b471b05 (patch) | |
tree | f1a55b20ae864fc780ab3add03e82435fe596db7 /tests/bugs/glusterd/bug-857330/common.rc | |
parent | 8a7dfb0d4b856578e89898c2bb84a0a675ade50b (diff) |
tests: fix spurious failure in bug-857330/xml.t
Backport of http://review.gluster.org/11054
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: 1232602
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>
Reviewed-on: http://review.gluster.org/11266
Reviewed-by: Vijay Bellur <vbellur@redhat.com>
Diffstat (limited to 'tests/bugs/glusterd/bug-857330/common.rc')
-rw-r--r-- | tests/bugs/glusterd/bug-857330/common.rc | 10 |
1 files changed, 6 insertions, 4 deletions
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 } |