summaryrefslogtreecommitdiffstats
path: root/tests/bugs
diff options
context:
space:
mode:
authorPranith Kumar K <pkarampu@redhat.com>2014-06-15 07:54:02 +0530
committerVijay Bellur <vbellur@redhat.com>2014-06-15 08:16:48 -0700
commit056b99bfbc181a88579b8139d444f7dd2fa3b19e (patch)
tree13b41ee183c7837af5d4d7a2e863cac5bdc45dce /tests/bugs
parent72c7afcd091605e06a02e7c5de0eff18f0690a82 (diff)
tests: Fix spurious failure for tests/bugs/bug-918437-sh-mtime.t
Change-Id: I355ae02bed54753480279ddb058cc4b19ace6792 BUG: 1092850 Signed-off-by: Pranith Kumar K <pkarampu@redhat.com> Reviewed-on: http://review.gluster.org/8068 Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Vijay Bellur <vbellur@redhat.com>
Diffstat (limited to 'tests/bugs')
-rw-r--r--tests/bugs/bug-918437-sh-mtime.t14
1 files changed, 12 insertions, 2 deletions
diff --git a/tests/bugs/bug-918437-sh-mtime.t b/tests/bugs/bug-918437-sh-mtime.t
index e541a81d642..366785bef50 100644
--- a/tests/bugs/bug-918437-sh-mtime.t
+++ b/tests/bugs/bug-918437-sh-mtime.t
@@ -7,6 +7,10 @@ function get_mtime {
local f=$1
stat $f | grep Modify | awk '{print $2 $3}' | cut -f1 -d'.'
}
+
+function file_exists {
+ if [ -f $1 ]; then echo "Y"; else echo "N"; fi
+}
cleanup;
## Tests if mtime is correct after self-heal.
@@ -39,11 +43,17 @@ EXPECT_WITHIN $CHILD_UP_TIMEOUT "1" afr_child_up_status $V0 0
EXPECT_WITHIN $CHILD_UP_TIMEOUT "1" afr_child_up_status $V0 1
TEST $CLI volume set $V0 cluster.self-heal-daemon on
-sleep 1
+EXPECT_WITHIN $PROCESS_UP_TIMEOUT "Y" glustershd_up_status
+EXPECT_WITHIN $CHILD_UP_TIMEOUT "1" afr_child_up_status_in_shd $V0 0
+EXPECT_WITHIN $CHILD_UP_TIMEOUT "1" afr_child_up_status_in_shd $V0 1
+
TEST gluster volume heal $V0 full
+EXPECT_WITHIN $HEAL_TIMEOUT "Y" file_exists $B0/gfs0/brick01/a
+EXPECT_WITHIN $HEAL_TIMEOUT "Y" file_exists $B0/gfs0/brick01/b
+EXPECT_WITHIN $HEAL_TIMEOUT 0 afr_get_pending_heal_count $V0
size=`stat -c '%s' /etc/passwd`
-EXPECT_WITHIN $HEAL_TIMEOUT $size stat -c '%s' $B0/gfs0/brick01/a
+EXPECT $size stat -c '%s' $B0/gfs0/brick01/a
TEST modify_atstamp1=$(get_mtime $B0/gfs0/brick01/a)
TEST modify_atstamp2=$(get_mtime $B0/gfs0/brick02/a)