[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[CI 03/17] tests: When checking squashfs fstime, use superblock last mod
From: |
Glenn Washburn |
Subject: |
[CI 03/17] tests: When checking squashfs fstime, use superblock last modified time |
Date: |
Thu, 18 Feb 2021 20:59:22 -0600 |
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 low power 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 bfc425e1f..4213b7bfc 100644
--- a/tests/util/grub-fs-tester.in
+++ b/tests/util/grub-fs-tester.in
@@ -1351,6 +1351,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
- [CI 00/17] Gitlab CI and test framework improvements, Glenn Washburn, 2021/02/18
- [CI 01/17] tests: Make sure LANG is set properly for iso9660_test, Glenn Washburn, 2021/02/18
- [CI 02/17] tests: Fix partmap_test for arm*-efi, disk numbering has changed, Glenn Washburn, 2021/02/18
- [CI 03/17] tests: When checking squashfs fstime, use superblock last modified time,
Glenn Washburn <=
- [CI 04/17] tests: Fail immediately when grub-shell fails and do not occlude the error code, Glenn Washburn, 2021/02/18
- [CI 05/17] grub-shell: Allow specifying non-default trim line contents, Glenn Washburn, 2021/02/18
- [CI 07/17] grub-shell: Only show grub-mkrescue output if it returns an error, Glenn Washburn, 2021/02/18
- [CI 08/17] grub-shell: Allow setting default timeout via GRUB_SHELL_DEFAULT_TIMEOUT envvar, Glenn Washburn, 2021/02/18
- [CI 06/17] grub-shell: Trim line should always be matched from the beginning of the line, Glenn Washburn, 2021/02/18
- [CI 10/17] grub-shell: Add grub output logfile with grub-shell --debug, Glenn Washburn, 2021/02/18
- [CI 11/17] grub-shell: Set exit status to qemu exit status, Glenn Washburn, 2021/02/18
- [CI 12/17] tests: Allow turning on shell tracing from environment variables, Glenn Washburn, 2021/02/18
- [CI 13/17] grub-shell: Add --verbose to mkrescue when $debug is greater than 2, Glenn Washburn, 2021/02/18
- [CI 09/17] grub-shell: Put all generated files into working dir and use better file names, Glenn Washburn, 2021/02/18