All of lore.kernel.org
 help / color / mirror / Atom feed
From: Glenn Washburn <development@efficientek.com>
To: grub-devel@gnu.org, Daniel Kiper <daniel.kiper@oracle.com>
Cc: Glenn Washburn <development@efficientek.com>
Subject: [PATCH v2 3/8] tests: When checking squashfs fstime, use superblock last modified time
Date: Wed, 25 Aug 2021 02:03:57 -0500	[thread overview]
Message-ID: <066486e22c757aada6ec05914f900923cbddfd07.1629874373.git.development@efficientek.com> (raw)
In-Reply-To: <cover.1629874373.git.development@efficientek.com>

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 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



  parent reply	other threads:[~2021-08-25  7:05 UTC|newest]

Thread overview: 31+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-08-25  7:03 [PATCH v2 0/8] Various fixes/improvements for tests Glenn Washburn
2021-08-25  7:03 ` [PATCH v2 1/8] tests: Make sure LANG is set properly for iso9660_test Glenn Washburn
2021-08-25  9:34   ` Thomas Schmitt
2021-08-25 19:49     ` Glenn Washburn
2021-08-26  6:53       ` Thomas Schmitt
2021-08-26 17:06         ` Glenn Washburn
2021-08-26 17:49         ` Thomas Schmitt
2021-08-26 20:16           ` Glenn Washburn
2021-08-26 21:28             ` Thomas Schmitt
2021-08-26 22:30               ` Glenn Washburn
2021-08-27 19:13                 ` Thomas Schmitt
2021-08-27 20:03                   ` Glenn Washburn
2021-08-27 21:23                     ` Thomas Schmitt
2021-08-25  7:03 ` [PATCH v2 2/8] tests: Fix partmap_test for arm*-efi, disk numbering has changed Glenn Washburn
2021-10-06 13:45   ` Daniel Kiper
2021-08-25  7:03 ` Glenn Washburn [this message]
2021-10-06 13:46   ` [PATCH v2 3/8] tests: When checking squashfs fstime, use superblock last modified time Daniel Kiper
2021-08-25  7:03 ` [PATCH v2 4/8] tests: Fail immediately when grub-shell fails and do not occlude the error code Glenn Washburn
2021-10-06 13:57   ` Daniel Kiper
2021-10-06 20:05     ` Glenn Washburn
2021-10-07 12:37       ` Daniel Kiper
2021-10-07 15:35         ` Glenn Washburn
2021-08-25  7:03 ` [PATCH v2 5/8] tests: Make setup errors in grub-fs-tester hard errors Glenn Washburn
2021-10-06 15:26   ` Daniel Kiper
2021-08-25  7:04 ` [PATCH v2 6/8] tests: A failure of mktemp should cause the test script to exit with code 99 Glenn Washburn
2021-10-06 15:28   ` Daniel Kiper
2021-08-25  7:04 ` [PATCH v2 7/8] tests: Exit with skipped exit code when test not performed Glenn Washburn
2021-09-17 21:42   ` Glenn Washburn
2021-10-06 15:34     ` Daniel Kiper
2021-08-25  7:04 ` [PATCH v2 8/8] tests: Use @BUILD_SHEBANG@ autoconf var instead of literal shell Glenn Washburn
2021-10-06 15:37   ` Daniel Kiper

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=066486e22c757aada6ec05914f900923cbddfd07.1629874373.git.development@efficientek.com \
    --to=development@efficientek.com \
    --cc=daniel.kiper@oracle.com \
    --cc=grub-devel@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.