summaryrefslogtreecommitdiffstats
path: root/tests/bugs
diff options
context:
space:
mode:
authorPranith Kumar K <pkarampu@redhat.com>2019-09-11 14:41:28 +0530
committerPranith Kumar K <pkarampu@redhat.com>2019-09-11 14:46:03 +0530
commit0e37cdf271a48d3e58c212e95664a2aa34da3940 (patch)
tree7b97e103fae067d4516ece447f6d583c6bc73ff6 /tests/bugs
parent0af88a6c33e8fd57745997afb7c68e4ef6023fbf (diff)
tests: Fix spurious failure
If heal from next brick starts after the first brick completes heal, then opendir on the brick can change atime leading to failure of the test. When ctime is disabled it is better to just check mtime to be same after heal. fixes: bz#1751134 Change-Id: Ia03e30fd547e6bbe85c1e299845ffa122f3a2692 Signed-off-by: Pranith Kumar K <pkarampu@redhat.com>
Diffstat (limited to 'tests/bugs')
-rw-r--r--tests/bugs/replicate/bug-1734370-entry-heal-restore-time.t22
1 files changed, 20 insertions, 2 deletions
diff --git a/tests/bugs/replicate/bug-1734370-entry-heal-restore-time.t b/tests/bugs/replicate/bug-1734370-entry-heal-restore-time.t
index 26f3b26..4310022 100644
--- a/tests/bugs/replicate/bug-1734370-entry-heal-restore-time.t
+++ b/tests/bugs/replicate/bug-1734370-entry-heal-restore-time.t
@@ -21,7 +21,23 @@ function time_stamps_match {
then
echo "Y"
else
- echo "N"
+ echo "Mtimes: $mtime_source_b0:$mtime_sink_b1:$mtime_source_b2 Atimes: $atime_source_b0:$atime_sink_b1:$atime_source_b2"
+ fi
+
+}
+
+function mtimes_match {
+ path=$1
+ mtime_source_b0=$(get_mtime $B0/${V0}0/$path)
+ mtime_source_b2=$(get_mtime $B0/${V0}2/$path)
+ mtime_sink_b1=$(get_mtime $B0/${V0}1/$path)
+
+ if [[ ( $mtime_source_b0 -eq $mtime_sink_b1) || \
+ ( $mtime_source_b2 -eq $mtime_sink_b1) ]]
+ then
+ echo "Y"
+ else
+ echo "Mtimes: $mtime_source_b0:$mtime_sink_b1:$mtime_source_b2"
fi
}
@@ -70,9 +86,11 @@ 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
EXPECT_WITHIN $CHILD_UP_TIMEOUT "1" afr_child_up_status_in_shd $V0 2
TEST $CLI volume heal $V0
+#Executing parallel heal may lead to changing atime after heal. So better
+#to test just the mtime
EXPECT_WITHIN $HEAL_TIMEOUT "0" get_pending_heal_count $V0
-EXPECT "Y" time_stamps_match DIR2
+EXPECT "Y" mtimes_match DIR2
TEST rm $GET_MDATA_PATH/get-mdata-xattr
cleanup;