[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH v4 2/9] tests: When checking squashfs fstime, use superblock last
From: |
Glenn Washburn |
Subject: |
[PATCH v4 2/9] tests: When checking squashfs fstime, use superblock last modified time |
Date: |
Tue, 12 Oct 2021 19:39:56 -0500 |
Currently, the filesystem timestamp check in grub-fs-tester uses the
squashfs image file's last modified timestamp and checks to see if that
time stamp is within 3 seconds of the superblock timestamp as determined by
grub. The image file's timestamp could be more than 3 seconds off if
mksquashfs takes more than 3 seconds to generate the image, as is the case
on a virtual machine. Instead use squashfs tools to get the filesystem
timestamp directly.
Signed-off-by: Glenn Washburn <development@efficientek.com>
---
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 a28e07295..cba94233d 100644
--- a/tests/util/grub-fs-tester.in
+++ b/tests/util/grub-fs-tester.in
@@ -1356,6 +1356,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";;
+ xsquash*)
+ # Creating the squash image may take more than a few
+ # seconds. Use the more accurate timestamp from the
+ # superblock.
+ FSTIME="$(unsquashfs -s "${FSIMAGEP}0.img" | grep
^Creation | awk '{print $6 " " $7 " " $8 " " $9 " " $10; }')"
+ FSTIME="$(date -d "$FSTIME" -u '+%Y-%m-%d %H:%M:%S')";;
*)
FSTIME="$(TZ=UTC ls --time-style="+%Y-%m-%d_%H:%M:%S"
-l -d "${FSIMAGEP}0.img"|awk '{print $6; }'|sed 's,_, ,g')";;
esac
--
2.27.0
- [PATCH v4 0/9] Various fixes/improvements for tests, Glenn Washburn, 2021/10/12
- [PATCH v4 7/9] tests: A failure of mktemp should cause the test script to exit with code 99, Glenn Washburn, 2021/10/12
- [PATCH v4 8/9] tests: Exit with skipped exit code when test not performed, Glenn Washburn, 2021/10/12
- [PATCH v4 3/9] tests: Add set -e to missing tests, Glenn Washburn, 2021/10/12
- [PATCH v4 5/9] tests: Do not occlude grub-shell return code, Glenn Washburn, 2021/10/12
- [PATCH v4 1/9] tests: Fix partmap_test for arm*-efi, disk numbering has changed, Glenn Washburn, 2021/10/12
- [PATCH v4 2/9] tests: When checking squashfs fstime, use superblock last modified time,
Glenn Washburn <=
- [PATCH v4 4/9] tests: Do not occlude subshell error codes when used as input to the test command, Glenn Washburn, 2021/10/12
- [PATCH v4 6/9] tests: Make setup errors in grub-fs-tester hard errors, Glenn Washburn, 2021/10/12
- [PATCH v4 9/9] tests: Use @BUILD_SHEBANG@ autoconf var instead of literal shell, Glenn Washburn, 2021/10/12