summaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorSachin Pandit <spandit@redhat.com>2015-03-10 10:19:51 +0530
committerRaghavendra Bhat <raghavendra@redhat.com>2015-03-13 00:36:37 -0700
commit263e23c52fb66b218d85254dcb2b54ab51832ba4 (patch)
tree24996277a43b31105d5854d29a12e63e80381a71 /tests
parent57d2ba0582010a45fa286e22ad4b9e2a6e3d3bae (diff)
tests : Fix spurious failure in uss.t.
Problem : When we change the USS working directory, the change is reflected in the volfile. So whenever snapd tries to fetch the current USS directory there is some delay and because of that if any lookup operation comes at that time on new USS directory there might be chances of failure. Solution : Check whether the directory exits in "EXPECT_WITHIN" as we can check few time if change is getting reflected. ================================================== ok 84 ok 85 ok 86 ok 87 ls: cannot access /mnt/glusterfs/0/.history: No such file or directory not ok 88 FAILED COMMAND: ls /mnt/glusterfs/0/.history ok 89 ok 90 ok 91 ok 92 ok 93 =================================================== Change-Id: Id739a929198829d9980ee4af44248c9e426caabe BUG: 1165938 Signed-off-by: Sachin Pandit <spandit@redhat.com> Reviewed-on: http://review.gluster.org/9850 Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Atin Mukherjee <amukherj@redhat.com> Reviewed-by: Raghavendra Bhat <raghavendra@redhat.com>
Diffstat (limited to 'tests')
-rw-r--r--tests/basic/uss.t15
1 files changed, 15 insertions, 0 deletions
diff --git a/tests/basic/uss.t b/tests/basic/uss.t
index eeccb28be05..0e2b669ee7a 100644
--- a/tests/basic/uss.t
+++ b/tests/basic/uss.t
@@ -12,6 +12,17 @@ function check_readonly()
return $?
}
+function lookup()
+{
+ ls $1
+ if [ "$?" == "0" ]
+ then
+ echo "Y"
+ else
+ echo "N"
+ fi
+}
+
cleanup;
TESTS_EXPECTED_IN_LOOP=10
@@ -177,6 +188,10 @@ TEST fd_close $fd3;
# test 73
TEST $CLI volume set $V0 "features.snapshot-directory" .history
+# snapd client might take fraction of time to compare the volfile from
+# glusterd. hence a EXPECT_WITHIN is a better choice here
+EXPECT_WITHIN 2 "Y" lookup "$M0/.history";
+
TEST ls $M0/.history;
NUM_SNAPS=$(ls $M0/.history | wc -l);