[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH v14 09/10] tests: Fix timezone inconsistency in squashfs_test
From: |
Xiaotian Wu |
Subject: |
[PATCH v14 09/10] tests: Fix timezone inconsistency in squashfs_test |
Date: |
Sat, 8 Apr 2023 10:04:20 +0800 |
The image timestamp was not returned in UTC, but the following logic
expected and used UTC.
This patch fixes the test failure like described below:
unsquashfs -s
/tmp/grub-fs-tester.20230407111703613257436.squash4_gzip.9R4/squash4_gzip_512_4096_1_0.img
grep '^Creation'
awk '{print $6 " " $7 " " $8 " " $9 " " $10; }'
FSTIME='Fri Apr 7 11:17:05 2023'
date -d 'Fri Apr 7 11:17:05 2023' -u '+%Y-%m-%d %H:%M:%S'
FSTIME='2023-04-07 11:17:05'
date -d '2023-04-07 11:17:05 UTC -1 second' -u '+%Y-%m-%d %H:%M:%S'
FSTIMEM1='2023-04-07 11:17:04'
date -d '2023-04-07 11:17:05 UTC -2 second' -u '+%Y-%m-%d %H:%M:%S'
FSTIMEM2='2023-04-07 11:17:03'
date -d '2023-04-07 11:17:05 UTC -3 second' -u '+%Y-%m-%d %H:%M:%S'
FSTIMEM3='2023-04-07 11:17:02'
grep -F 'Last modification time 2023-04-07 11:17:05'
echo 'Device loop0: Filesystem type squash4 - Last modification time
2023-04-07 03:17:05 Friday - Sector size 512B - Total size 10680KiB'
echo 'Device loop0: Filesystem type squash4 - Last modification time
2023-04-07 03:17:05 Friday - Sector size 512B - Total size 10680KiB'
grep -F 'Last modification time 2023-04-07 11:17:04'
echo 'Device loop0: Filesystem type squash4 - Last modification time
2023-04-07 03:17:05 Friday - Sector size 512B - Total size 10680KiB'
grep -F 'Last modification time 2023-04-07 11:17:03'
echo 'Device loop0: Filesystem type squash4 - Last modification time
2023-04-07 03:17:05 Friday - Sector size 512B - Total size 10680KiB'
grep -F 'Last modification time 2023-04-07 11:17:02'
echo FSTIME FAIL
Signed-off-by: Xiaotian Wu <wuxiaotian@loongson.cn>
---
tests/util/grub-fs-tester.in | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/tests/util/grub-fs-tester.in b/tests/util/grub-fs-tester.in
index 064464eb2..64638d2e9 100644
--- a/tests/util/grub-fs-tester.in
+++ b/tests/util/grub-fs-tester.in
@@ -1454,7 +1454,7 @@ for LOGSECSIZE in $(range "$MINLOGSECSIZE"
"$MAXLOGSECSIZE" 1); do
# 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="$(unsquashfs -UTC -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')";;
--
2.39.2
- [PATCH v14 00/10] Add LoongArch support, Xiaotian Wu, 2023/04/07
- [PATCH v14 01/10] PE: Add LoongArch definitions, Xiaotian Wu, 2023/04/07
- [PATCH v14 02/10] ELF: Add LoongArch definitions, Xiaotian Wu, 2023/04/07
- [PATCH v14 03/10] LoongArch: Add setjmp implementation, Xiaotian Wu, 2023/04/07
- [PATCH v14 04/10] LoongArch: Add early startup code, Xiaotian Wu, 2023/04/07
- [PATCH v14 05/10] LoongArch: Add support for ELF psABI v1.00 relocations, Xiaotian Wu, 2023/04/07
- [PATCH v14 06/10] LoongArch: Add support for ELF psABI v2.00 relocations, Xiaotian Wu, 2023/04/07
- [PATCH v14 07/10] LoongArch: Add auxiliary files, Xiaotian Wu, 2023/04/07
- [PATCH v14 08/10] LoongArch: Add to build system, Xiaotian Wu, 2023/04/07
- [PATCH v14 09/10] tests: Fix timezone inconsistency in squashfs_test,
Xiaotian Wu <=
- [PATCH v14 10/10] tests: Add LoongArch to various test cases, Xiaotian Wu, 2023/04/07
- Re: [PATCH v14 10/10] tests: Add LoongArch to various test cases, Glenn Washburn, 2023/04/10
- Re: [PATCH v14 10/10] tests: Add LoongArch to various test cases, Xiaotian Wu, 2023/04/10
- Re: [PATCH v14 10/10] tests: Add LoongArch to various test cases, Xiaotian Wu, 2023/04/10
- Re: [PATCH v14 10/10] tests: Add LoongArch to various test cases, Xiaotian Wu, 2023/04/10
- Re: [PATCH v14 10/10] tests: Add LoongArch to various test cases, Glenn Washburn, 2023/04/12
- Re: [PATCH v14 10/10] tests: Add LoongArch to various test cases, Xiaotian Wu, 2023/04/14
- Re: [PATCH v14 10/10] tests: Add LoongArch to various test cases, Glenn Washburn, 2023/04/12
- Re: [PATCH v14 10/10] tests: Add LoongArch to various test cases, Glenn Washburn, 2023/04/12