summaryrefslogtreecommitdiffstats
path: root/tests/snapshot.rc
diff options
context:
space:
mode:
authorJeff Darcy <jdarcy@redhat.com>2015-03-30 13:22:45 -0400
committerVijay Bellur <vbellur@redhat.com>2015-04-01 01:49:37 -0700
commit6d083f47e1399c58da02836f33fdb7d9c31fd689 (patch)
tree638aea290e1d3cae4dbe3314e28cf8adcc915b06 /tests/snapshot.rc
parentef5c3182224940f76d9290c1c4d9cc8e78fbdb83 (diff)
tests: fix volume_exists to be used from EXPECT_WITHIN
Fixes the spurious volume-snapshot-clone.t regression failures. In brief, the problem is that the script wasn't waiting for config commands to complete, and would *sometimes* query the status of a volume while that volume was still being deleted. It turns out that "!" doesn't work properly from EXPECT_WITHIN, so there was a choice between changing that or changing volume_exists. This seemed less risky. Because of code duplication, two instances of the function had to be changed, and the other caller (volume-snapshot.t) did too. Change-Id: I766d4dc7c5b11038ede8e45d9d1f29cd02a622a0 BUG: 1163543 Signed-off-by: Jeff Darcy <jdarcy@redhat.com> Reviewed-on: http://review.gluster.org/10053 Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Kaleb KEITHLEY <kkeithle@redhat.com> Reviewed-by: Vijay Bellur <vbellur@redhat.com>
Diffstat (limited to 'tests/snapshot.rc')
-rw-r--r--tests/snapshot.rc11
1 files changed, 5 insertions, 6 deletions
diff --git a/tests/snapshot.rc b/tests/snapshot.rc
index defce07..d533237 100644
--- a/tests/snapshot.rc
+++ b/tests/snapshot.rc
@@ -314,12 +314,11 @@ function volinfo_field()
function volume_exists() {
- local volname=$1
- $CLI_1 volume info $volname 2>&1 | grep -q 'does not exist'
+ $CLI_1 volume info $1 > /dev/null 2>&1
if [ $? -eq 0 ]; then
- return 1
+ echo "Y"
else
- return 0
+ echo "N"
fi
}
@@ -407,6 +406,6 @@ NetBSD)
SKIP_TESTS
exit 0
;;
-*)
+*)
;;
-esac
+esac