From patchwork Fri May 3 14:39:04 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Alex_Benn=C3=A9e?= X-Patchwork-Id: 10928897 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id ED3EE1390 for ; Fri, 3 May 2019 14:39:55 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id D1B89274D0 for ; Fri, 3 May 2019 14:39:55 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id C562228397; Fri, 3 May 2019 14:39:55 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-5.0 required=2.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,MAILING_LIST_MULTI,RCVD_IN_DNSWL_MED autolearn=ham version=3.3.1 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 3B8E5274D0 for ; Fri, 3 May 2019 14:39:55 +0000 (UTC) Received: from localhost ([127.0.0.1]:41569 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hMZLu-00040U-AA for patchwork-qemu-devel@patchwork.kernel.org; Fri, 03 May 2019 10:39:54 -0400 Received: from eggs.gnu.org ([209.51.188.92]:48513) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hMZLE-0003cM-D0 for qemu-devel@nongnu.org; Fri, 03 May 2019 10:39:13 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1hMZLD-00075B-4g for qemu-devel@nongnu.org; Fri, 03 May 2019 10:39:12 -0400 Received: from mail-wm1-x342.google.com ([2a00:1450:4864:20::342]:35504) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1hMZLC-00071s-QY for qemu-devel@nongnu.org; Fri, 03 May 2019 10:39:11 -0400 Received: by mail-wm1-x342.google.com with SMTP id y197so7034540wmd.0 for ; Fri, 03 May 2019 07:39:10 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=PGqJkjCBNOGw04Ltrq56HoeA7c2401B0UKpQKkw6gjE=; b=hsgOOJ3vvPnvHaLUuG468wtWRgtKXpiUpaI6TRwrvNw3n1fDjjv8PiOHFAiSM142bj 0NunyoSlUYFSEeSLw4at1c3TYfbiU3d8NDhCNLwt/1CZq4CZDOUPQrvwUGShXlWKOPnK uyDcpnw6CdsXkDAEGSLDJZBBfiNTWEu4niFg0AdChJMpbIT4MoRgeXiPeyPwdnKQT9gb A9wfagCzNIaNJ4BvVhK8RyF5H2tZnyDtCkwVpHVcOIzt+0IHqNdUdAvu7Q88Qa7LezeU mWzKgLb58dhejpboWrm3VK+M27L4Zk14lD/VgMCT5mB4OvP7BQmnDvW264hJ5uZFZFWm qZdA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=PGqJkjCBNOGw04Ltrq56HoeA7c2401B0UKpQKkw6gjE=; b=kyIpB8O1FS4d+o3Hby+vKG73hZmdoHOxsaZ4cu08ysIgOnBJATlWOj8ZBQNO/dzhvF 3+SLlXTFseRKl9dufXxPeZloNUmB1F5xVehVXJ18K4GCC1b/0nQgeMB2XnKP9gzy0DAp j4RVHOD6jLUEmFXtMgznD8tCDUKSYb1iDE+ERQ5th95R3/oQGABL6KpFOgY1fBHVlKLp 7oxXcVUNie7IMZ7Tik9cKm5Vfg9ZuVJGuaCxwtTAboPhwFougamKCjJr9R9Dz3PSTZ6f Vweb+HuF2+evMPCLZxDLDjaOC9wBQ6EPONlJzVCFK99PqDyME6zstRqOKdxsrIjMiY7C +HDA== X-Gm-Message-State: APjAAAVUO+UjNjsalWj5is6CXH3DlXmch7sajLU1cSE1ZA2lz1MmRa3h aJse8PudAZEVfo0sQMKYihQSkw== X-Google-Smtp-Source: APXvYqy3oBarCkQmE2FC44G3x4WpfH5CZQPPeOH3MDyJJtV0BpukuEkCyLYGxYpXRAuXT56RwvAFtQ== X-Received: by 2002:a1c:7e87:: with SMTP id z129mr1784480wmc.145.1556894349224; Fri, 03 May 2019 07:39:09 -0700 (PDT) Received: from zen.linaroharston ([81.128.185.34]) by smtp.gmail.com with ESMTPSA id o16sm2869845wro.63.2019.05.03.07.39.08 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Fri, 03 May 2019 07:39:08 -0700 (PDT) Received: from zen.linaroharston. (localhost [127.0.0.1]) by zen.linaroharston (Postfix) with ESMTP id 0AFF01FF87; Fri, 3 May 2019 15:39:08 +0100 (BST) From: =?utf-8?q?Alex_Benn=C3=A9e?= To: thuth@redhat.com Date: Fri, 3 May 2019 15:39:04 +0100 Message-Id: <20190503143904.31211-1-alex.bennee@linaro.org> X-Mailer: git-send-email 2.20.1 MIME-Version: 1.0 X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2a00:1450:4864:20::342 Subject: [Qemu-devel] [RFC PATCH] tests/qemu-iotests: re-format output to for make check-block X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Kevin Wolf , =?utf-8?q?Alex_Benn=C3=A9e?= , qemu-devel@nongnu.org, "open list:Block layer core" , Max Reitz Errors-To: qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Sender: "Qemu-devel" X-Virus-Scanned: ClamAV using ClamSMTP This attempts to clean-up the output to better match the output of the rest of the QEMU check system. This includes: - formatting as " TEST iotest: nnn" - calculating time diff at the end - only dumping config on failure Signed-off-by: Alex Bennée Tested-by: Thomas Huth --- tests/qemu-iotests/check | 71 +++++++++++++++++++--------------------- 1 file changed, 34 insertions(+), 37 deletions(-) diff --git a/tests/qemu-iotests/check b/tests/qemu-iotests/check index 922c5d1d3d..2ffc14113e 100755 --- a/tests/qemu-iotests/check +++ b/tests/qemu-iotests/check @@ -633,12 +633,6 @@ _wallclock() date "+%H %M %S" | awk '{ print $1*3600 + $2*60 + $3 }' } -_timestamp() -{ - now=$(date "+%T") - printf %s " [$now]" -} - _wrapup() { if $showme @@ -709,19 +703,6 @@ trap "_wrapup; exit \$status" 0 1 2 3 15 FULL_IMGFMT_DETAILS=$(_full_imgfmt_details) FULL_HOST_DETAILS=$(_full_platform_details) -cat < $TESTS_REMAINING_LOG @@ -729,7 +710,9 @@ seq="check" for seq in $list do err=false - printf %s "$seq" + reason="" + times="" + if [ -n "$TESTS_REMAINING_LOG" ] ; then sed -e "s/$seq//" -e 's/ / /' -e 's/^ *//' $TESTS_REMAINING_LOG > $TESTS_REMAINING_LOG.tmp mv $TESTS_REMAINING_LOG.tmp $TESTS_REMAINING_LOG @@ -738,7 +721,7 @@ do if $showme then - echo + echo " TEST iotest: $seq (not actually run)" continue elif [ -f expunged ] && $expunge && egrep "^$seq([ ]|\$)" expunged >/dev/null then @@ -753,17 +736,11 @@ do # really going to try and run this one # rm -f $seq.out.bad - lasttime=$(sed -n -e "/^$seq /s/.* //p" <$TIMESTAMP_FILE) - if [ "X$lasttime" != X ]; then - printf %s " ${lasttime}s ..." - else - printf " " # prettier output with timestamps. - fi rm -f core $seq.notrun rm -f $seq.casenotrun start=$(_wallclock) - $timestamp && printf %s " [$(date "+%T")]" + $timestamp && times="[$(date "+%T")]" if [ "$(head -n 1 "$source_iotests/$seq")" == "#!/usr/bin/env python" ]; then run_command="$PYTHON $seq" @@ -781,26 +758,26 @@ do $run_command >$tmp.out 2>&1) fi sts=$? - $timestamp && _timestamp + $timestamp && times="$times -> [$(date "+%T")]" stop=$(_wallclock) if [ -f core ] then - printf " [dumped core]" mv core $seq.core + reason="dumped core $seq.core" err=true fi if [ -f $seq.notrun ] then - $timestamp || printf " [not run] " - $timestamp && echo " [not run]" && printf %s " $seq -- " + $timestamp || reason="[not run]" + $timestamp && reason="[not run] $seq -- " cat $seq.notrun notrun="$notrun $seq" else if [ $sts -ne 0 ] then - printf %s " [failed, exit status $sts]" + reason=$(printf %s "[failed, exit status $sts]") err=true fi @@ -821,22 +798,27 @@ do if [ ! -f "$reference" ] then - echo " - no qualified output" + reason=" - no qualified output" err=true else if diff -w "$reference" $tmp.out >/dev/null 2>&1 then - echo "" if $err then : else - echo "$seq $(expr $stop - $start)" >>$tmp.time + lasttime=$(sed -n -e "/^$seq /s/.* //p" <$TIMESTAMP_FILE) + thistime=$(expr $stop - $start) + echo "$seq $thistime" >>$tmp.time + + if [ "X$lasttime" != X ]; then + times="$times ${thistime}s (last ${lasttime}s)" + fi fi else - echo " - output mismatch (see $seq.out.bad)" mv $tmp.out $seq.out.bad $diff -w "$reference" "$PWD"/$seq.out.bad + reason=" - output mismatch (see $seq.out.bad)" err=true fi fi @@ -852,9 +834,24 @@ do # if $err then + echo " TEST iotest: $seq FAILED $reason" + cat <