From: Vladimir Serbinenko Date: Fri, 27 Jan 2017 17:58:15 +0000 (+0000) Subject: grub-fs-tester: Accomodate for slower systems. X-Git-Tag: 2.02-rc1~37 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=cde63a3bb0e213386a5d836911f0e1d71b504620;p=thirdparty%2Fgrub.git grub-fs-tester: Accomodate for slower systems. fstime can be more different with xz squashfs. Allow difference up to 3 seconds. This code is ugly now but rewriting it now is not on the table. --- diff --git a/tests/util/grub-fs-tester.in b/tests/util/grub-fs-tester.in index 986f6677a..1111c4b7d 100644 --- a/tests/util/grub-fs-tester.in +++ b/tests/util/grub-fs-tester.in @@ -1304,10 +1304,11 @@ for ((LOGSECSIZE=MINLOGSECSIZE;LOGSECSIZE<=MAXLOGSECSIZE;LOGSECSIZE=LOGSECSIZE + # is not precise. Account for small difference here. FSTIMEM1="$(date -d "$FSTIME UTC -1 second" -u "+%Y-%m-%d %H:%M:%S")" FSTIMEM2="$(date -d "$FSTIME UTC -2 second" -u "+%Y-%m-%d %H:%M:%S")" + FSTIMEM3="$(date -d "$FSTIME UTC -3 second" -u "+%Y-%m-%d %H:%M:%S")" if [ x$NOFSTIME = xy ]; then : - elif echo "$LSOUT" | grep -F 'Last modification time '"$FSTIME" > /dev/null || echo "$LSOUT" | grep -F 'Last modification time '"$FSTIMEM1" > /dev/null || echo "$LSOUT" | grep -F 'Last modification time '"$FSTIMEM2" > /dev/null; then + elif echo "$LSOUT" | grep -F 'Last modification time '"$FSTIME" > /dev/null || echo "$LSOUT" | grep -F 'Last modification time '"$FSTIMEM1" > /dev/null || echo "$LSOUT" | grep -F 'Last modification time '"$FSTIMEM2" || echo "$LSOUT" | grep -F 'Last modification time '"$FSTIMEM3" > /dev/null; then : else echo FSTIME FAIL