qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Qemu-devel] [PATCH 1/6] iotests: throw away test timings if args change


From: Daniel P. Berrange
Subject: [Qemu-devel] [PATCH 1/6] iotests: throw away test timings if args change
Date: Mon, 19 Sep 2016 18:35:39 +0100

The 'check' program records timings for each test that
is run. These timings are only valid, however, for a
particular format/protocol combination. So if frequently
running 'check' with a variety of different formats or
protocols, the times printed can be very misleading.

Record the protocol/format in the check.time file and
throw it away if it doesn't mach the current run args.

Signed-off-by: Daniel P. Berrange <address@hidden>
---
 tests/qemu-iotests/check | 21 +++++++++++++++++++--
 1 file changed, 19 insertions(+), 2 deletions(-)

diff --git a/tests/qemu-iotests/check b/tests/qemu-iotests/check
index 4cba215..1a9bbb7 100755
--- a/tests/qemu-iotests/check
+++ b/tests/qemu-iotests/check
@@ -142,6 +142,11 @@ _timestamp()
     echo -n " [$now]"
 }
 
+_timestamp_args()
+{
+    echo "# ARGS: protocol=$IMGPROTO, format=$IMGFMT"
+}
+
 _wrapup()
 {
     # for hangcheck ...
@@ -158,13 +163,14 @@ _wrapup()
         if [ -f check.time -a -f $tmp.time ]
         then
             cat check.time $tmp.time \
-            | $AWK_PROG '
+            | grep -v '# ' | $AWK_PROG '
         { t[$1] = $2 }
 END        { if (NR > 0) {
             for (i in t) print i " " t[i]
           }
         }' \
             | sort -n >$tmp.out
+            _timestamp_args >> $tmp.out
             mv $tmp.out check.time
         fi
 
@@ -223,7 +229,18 @@ echo "preamble" > "${TEST_DIR}"/check.sts
 # don't leave old full output behind on a clean run
 rm -f check.full
 
-[ -f check.time ] || touch check.time
+# Check if previously recorded times were for the same
+# image format/protocol, otherwise discard them
+if test -f check.time
+then
+   OLDARGS=`grep ARGS check.time`
+   NEWARGS=`_timestamp_args`
+   if test "x$OLDARGS" != "x$NEWARGS"
+   then
+       rm -f check.time
+   fi
+fi
+touch check.time
 
 FULL_IMGFMT_DETAILS=`_full_imgfmt_details`
 FULL_IMGPROTO_DETAILS=`_full_imgproto_details`
-- 
2.7.4




reply via email to

[Prev in Thread] Current Thread [Next in Thread]