From 6d083f47e1399c58da02836f33fdb7d9c31fd689 Mon Sep 17 00:00:00 2001 From: Jeff Darcy Date: Mon, 30 Mar 2015 13:22:45 -0400 Subject: 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 Reviewed-on: http://review.gluster.org/10053 Tested-by: Gluster Build System Reviewed-by: Kaleb KEITHLEY Reviewed-by: Vijay Bellur --- tests/volume.rc | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) (limited to 'tests/volume.rc') diff --git a/tests/volume.rc b/tests/volume.rc index 741d2b81c15..59a66142e9e 100644 --- a/tests/volume.rc +++ b/tests/volume.rc @@ -402,13 +402,12 @@ function delete_volumes() { } function volume_exists() { - local volname=$1 - $CLI volume info $volname 2>&1 | grep -q 'does not exist' - if [ $? -eq 0 ]; then - return 1 - else - return 0 - fi + $CLI volume info $1 > /dev/null 2>&1 + if [ $? -eq 0 ]; then + echo "Y" + else + echo "N" + fi } function afr_get_index_count { -- cgit