[PATCH v3 4/4] tests/erofs_test: Improve accuracy of FSTIME check

Glenn Washburn <[email protected]>
Newsgroups org.gnu.grub-devel
Message-ID <46dd18499a81d9b3a48b57fccb05aeab0c5333a0.1763003164.git.development@efficientek.com>
On resource constrained test runs, the last modification time on the
image is an unreliable date to check against the filesystem creation
time. Use dump.erofs to get the filesystem creation time from the
superblock. This should get the timestamp as shown by GRUB's ls -l.

Signed-off-by: Glenn Washburn <[email protected]>
Reviewed-by: Daniel Kiper <[email protected]>
---
 tests/util/grub-fs-tester.in | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/tests/util/grub-fs-tester.in b/tests/util/grub-fs-tester.in
index ef0d7e08593e..00e5e22e1793 100644
--- a/tests/util/grub-fs-tester.in
+++ b/tests/util/grub-fs-tester.in
@@ -1495,6 +1495,12 @@ for LOGSECSIZE in $(range "$MINLOGSECSIZE" "$MAXLOGSECSIZE" 1); do
 			# With some abstractions like mdraid flushing to disk
 			# may be delayed for a long time.
 			FSTIME="$UMOUNT_TIME";;
+		    x"erofs_"*)
+			# Creating the erofs image may take more than a few
+			# seconds. Use the more accurate timestamp from the
+			# superblock.
+			FSTIME="$(dump.erofs -s "${FSIMAGEP}0.img" | grep ^"Filesystem created:" | (read _ _ REST; echo $REST) )"
+			FSTIME="$(date -d "$FSTIME" -u '+%Y-%m-%d %H:%M:%S')";;
 		    xsquash*)
 			# Creating the squash image may take more than a few
 			# seconds. Use the more accurate timestamp from the
-- 
2.34.1


_______________________________________________
Grub-devel mailing list
[email protected]
https://lists.gnu.org/mailman/listinfo/grub-devel
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.