bc092b
From 6dec3a26b37e128ded5d912e08abc5cee1592499 Mon Sep 17 00:00:00 2001
bc092b
From: Vladimir Serbinenko <phcoder@gmail.com>
bc092b
Date: Mon, 23 Jan 2017 21:24:05 +0300
31cddd
Subject: [PATCH] Don't retrieve fstime when it's not useful.
bc092b
bc092b
---
bc092b
 tests/util/grub-fs-tester.in | 48 ++++++++++++++++++++++----------------------
bc092b
 1 file changed, 24 insertions(+), 24 deletions(-)
bc092b
bc092b
diff --git a/tests/util/grub-fs-tester.in b/tests/util/grub-fs-tester.in
ec4acb
index 4515d165e6e..bf47305f3e8 100644
bc092b
--- a/tests/util/grub-fs-tester.in
bc092b
+++ b/tests/util/grub-fs-tester.in
bc092b
@@ -1328,31 +1328,31 @@ for LOGSECSIZE in $(range "$MINLOGSECSIZE" "$MAXLOGSECSIZE" 1); do
bc092b
 		    ;;
bc092b
 	    esac
bc092b
 
bc092b
-	    case x$fs in
bc092b
-		xiso9660 | xziso9660 | xrockridge | xjoliet | xrockridge_joliet | xiso9660_1999 | xrockridge_1999 | xjoliet_1999 | xrockridge_joliet_1999)
bc092b
-		    FSTIME="$(date -d "$(echo ${FSUUID} | awk -F - '{ print $1"-"$2"-"$3" "$4":"$5":"$6 ;}')" '+%Y-%m-%d %H:%M:%S')";;
bc092b
-		xlvm*|xmdraid*)
bc092b
-		    # With some abstractions like mdraid flushing to disk
bc092b
-		    # may be delayed for a long time.
bc092b
-		    FSTIME="$UMOUNT_TIME";;
bc092b
-		*)
bc092b
-		    FSTIME="$(TZ=UTC ls --time-style="+%Y-%m-%d_%H:%M:%S" -l -d "${FSIMAGEP}0.img"|awk '{print $6; }'|sed 's,_, ,g')";;
bc092b
-	    esac
bc092b
-	    # With some abstractions like mdraid computing of UMOUNT_TIME
bc092b
-	    # is not precise. Account for small difference here.
bc092b
-	    FSTIMEM1="$(date -d "$FSTIME UTC -1 second" -u "+%Y-%m-%d %H:%M:%S")"
bc092b
-	    FSTIMEM2="$(date -d "$FSTIME UTC -2 second" -u "+%Y-%m-%d %H:%M:%S")"
bc092b
-	    FSTIMEM3="$(date -d "$FSTIME UTC -3 second" -u "+%Y-%m-%d %H:%M:%S")"
bc092b
+	    if [ x$NOFSTIME != xy ]; then
bc092b
+		case x$fs in
bc092b
+		    xiso9660 | xziso9660 | xrockridge | xjoliet | xrockridge_joliet | xiso9660_1999 | xrockridge_1999 | xjoliet_1999 | xrockridge_joliet_1999)
bc092b
+			FSTIME="$(date -d "$(echo ${FSUUID} | awk -F - '{ print $1"-"$2"-"$3" "$4":"$5":"$6 ;}')" '+%Y-%m-%d %H:%M:%S')";;
bc092b
+		    xlvm*|xmdraid*)
bc092b
+			# With some abstractions like mdraid flushing to disk
bc092b
+			# may be delayed for a long time.
bc092b
+			FSTIME="$UMOUNT_TIME";;
bc092b
+		    *)
bc092b
+			FSTIME="$(TZ=UTC ls --time-style="+%Y-%m-%d_%H:%M:%S" -l -d "${FSIMAGEP}0.img"|awk '{print $6; }'|sed 's,_, ,g')";;
bc092b
+		esac
bc092b
+		# With some abstractions like mdraid computing of UMOUNT_TIME
bc092b
+		# is not precise. Account for small difference here.
bc092b
+		FSTIMEM1="$(date -d "$FSTIME UTC -1 second" -u "+%Y-%m-%d %H:%M:%S")"
bc092b
+		FSTIMEM2="$(date -d "$FSTIME UTC -2 second" -u "+%Y-%m-%d %H:%M:%S")"
bc092b
+		FSTIMEM3="$(date -d "$FSTIME UTC -3 second" -u "+%Y-%m-%d %H:%M:%S")"
bc092b
 
bc092b
-	    if [ x$NOFSTIME = xy ]; then
bc092b
-		:
bc092b
-	    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
bc092b
-		:
bc092b
-	    else
bc092b
-		echo FSTIME FAIL
bc092b
-		echo "$FSTIME"
bc092b
-		echo "$LSOUT"
bc092b
-		exit 1
bc092b
+		if 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
bc092b
+		    :
bc092b
+		else
bc092b
+		    echo FSTIME FAIL
bc092b
+		    echo "$FSTIME"
bc092b
+		    echo "$LSOUT"
bc092b
+		    exit 1
bc092b
+		fi
bc092b
 	    fi
bc092b
 
bc092b
 	    if [ x$NOHARDLINK != xy ]; then