summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--tests/basic/afr/split-brain-healing.t42
1 files changed, 36 insertions, 6 deletions
diff --git a/tests/basic/afr/split-brain-healing.t b/tests/basic/afr/split-brain-healing.t
index 403d08faab3..8b7eaffb268 100644
--- a/tests/basic/afr/split-brain-healing.t
+++ b/tests/basic/afr/split-brain-healing.t
@@ -167,9 +167,24 @@ fi
$CLI volume heal $V0 split-brain latest-mtime /file5
EXPECT "0" echo $?
-#TODO: Uncomment the below after posix_do_utimes() supports utimensat(2) accuracy
-#TEST [ $LATEST_MTIME -eq $mtime1 ]
-#TEST [ $LATEST_MTIME -eq $mtime2 ]
+if [ $subvolume == 0 ]
+then
+ mtime1_after_heal=$(stat -c %Y $B0/${V0}1/file5)
+ mtime2_after_heal=$(stat -c %Y $B0/${V0}2/file5)
+elif [ $subvolume == 1 ]
+then
+ mtime1_after_heal=$(stat -c %Y $B0/${V0}3/file5)
+ mtime2_after_heal=$(stat -c %Y $B0/${V0}4/file5)
+fi
+
+#TODO: To below comparisons on full sub-second resolution
+
+TEST [ $LATEST_MTIME -eq $mtime1_after_heal ]
+TEST [ $LATEST_MTIME -eq $mtime2_after_heal ]
+
+mtime_mount_after_heal=$(stat -c %Y file5)
+
+TEST [ $LATEST_MTIME -eq $mtime_mount_after_heal ]
################ Heal file6 using the latest-mtime option and its gfid ##############
subvolume=$(get_replicate_subvol_number file6)
@@ -190,9 +205,24 @@ GFIDSTR="gfid:$(gf_gfid_xattr_to_str $GFID)"
$CLI volume heal $V0 split-brain latest-mtime $GFIDSTR
EXPECT "0" echo $?
-#TODO: Uncomment the below after posix_do_utimes() supports utimensat(2) accuracy
-#TEST [ $LATEST_MTIME -eq $mtime1 ]
-#TEST [ $LATEST_MTIME -eq $mtime2 ]
+if [ $subvolume == 0 ]
+then
+ mtime1_after_heal=$(stat -c %Y $B0/${V0}1/file6)
+ mtime2_after_heal=$(stat -c %Y $B0/${V0}2/file6)
+elif [ $subvolume == 1 ]
+then
+ mtime1_after_heal=$(stat -c %Y $B0/${V0}3/file6)
+ mtime2_after_heal=$(stat -c %Y $B0/${V0}4/file6)
+fi
+
+#TODO: To below comparisons on full sub-second resolution
+
+TEST [ $LATEST_MTIME -eq $mtime1_after_heal ]
+TEST [ $LATEST_MTIME -eq $mtime2_after_heal ]
+
+mtime_mount_after_heal=$(stat -c %Y file6)
+
+TEST [ $LATEST_MTIME -eq $mtime_mount_after_heal ]
################ Heal remaining SB'ed files of replica_0 using B1 as source ##############
$CLI volume heal $V0 split-brain source-brick $H0:$B0/${V0}1