summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAvra Sengupta <asengupt@redhat.com>2015-05-04 14:19:36 +0530
committerVijay Bellur <vbellur@redhat.com>2015-05-06 02:13:18 -0700
commit424189775e847b5dda223434f7ec4e0a98938822 (patch)
treec3fbffcb41cea0dc3bb2b8395194138786d26da2
parent42d113f59099ecac4335cf9d3d2a6364511350f8 (diff)
snapshot/uss: fix regression failure in bug-1162498.t
.snaps seems to take some time, before it is available based on the state of the system. Using EXPECT_WITHIN instead of TEST to check the contents of .snaps, hence giving it some time to come up. Change-Id: Iac166500d5a09ba8bab00d994c27a9ad0a01b9c3 BUG: 1218576 Signed-off-by: Avra Sengupta <asengupt@redhat.com> Reviewed-on: http://review.gluster.org/10518 Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Rajesh Joseph <rjoseph@redhat.com> Reviewed-by: Pranith Kumar Karampuri <pkarampu@redhat.com> Reviewed-on: http://review.gluster.org/10561
-rw-r--r--tests/basic/uss.t4
-rwxr-xr-x[-rw-r--r--]tests/bugs/snapshot/bug-1162498.t5
-rw-r--r--tests/snapshot.rc4
3 files changed, 6 insertions, 7 deletions
diff --git a/tests/basic/uss.t b/tests/basic/uss.t
index da195a949e2..c41217ca025 100644
--- a/tests/basic/uss.t
+++ b/tests/basic/uss.t
@@ -23,10 +23,6 @@ function lookup()
fi
}
-count_snaps () {
- ls $1/.snaps | wc -l
-}
-
cleanup;
TESTS_EXPECTED_IN_LOOP=10
diff --git a/tests/bugs/snapshot/bug-1162498.t b/tests/bugs/snapshot/bug-1162498.t
index 665d60fd0bf..afc065000d5 100644..100755
--- a/tests/bugs/snapshot/bug-1162498.t
+++ b/tests/bugs/snapshot/bug-1162498.t
@@ -41,9 +41,9 @@ TEST glusterfs -s $H0 --volfile-id=$V0 $M0
#Dir xyz exists in snap1
EXPECT_WITHIN $PROCESS_UP_TIMEOUT "0" STAT $M0/xyz
-TEST ls $M0/xyz/.snaps/
+EXPECT_WITHIN $PROCESS_UP_TIMEOUT "3" count_snaps $M0/xyz
TEST mkdir $M0/abc
-TEST ls $M0/abc/.snaps/
+EXPECT_WITHIN $PROCESS_UP_TIMEOUT "3" count_snaps $M0/abc
#Clean up
TEST $CLI snapshot delete snap1
@@ -53,4 +53,3 @@ TEST $CLI volume stop $V0 force
TEST $CLI volume delete $V0
cleanup;
-
diff --git a/tests/snapshot.rc b/tests/snapshot.rc
index d5332377ede..7fe9b39cd7c 100644
--- a/tests/snapshot.rc
+++ b/tests/snapshot.rc
@@ -16,6 +16,10 @@ function init_n_bricks() {
done
}
+count_snaps () {
+ ls $1/.snaps | wc -l
+}
+
function init_lvm() {
if [ "$1" == "" ]; then
echo "Error: Invalid argument supplied"