From patchwork Fri May 10 13:52:47 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: 163864 Delivered-To: patch@linaro.org Received: by 2002:a05:6e02:142:0:0:0:0 with SMTP id j2csp2401415ilr; Fri, 10 May 2019 06:54:23 -0700 (PDT) X-Google-Smtp-Source: APXvYqxeOd8hd2dHfpeemDp8QBOJpa+RchCre1ridqZJ/8YZCQXawwVO0aAIUwdGdJZ8eIkotGqj X-Received: by 2002:adf:e908:: with SMTP id f8mr1796188wrm.124.1557496463568; Fri, 10 May 2019 06:54:23 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1557496463; cv=none; d=google.com; s=arc-20160816; b=vZi9GN7coP28syU5t4P8sTS8/3SkWButrx3myOe9y8UvDLAx0m/PteJ3wylPmn+y2S onRZEg0pt6ht2OBxVpC3a/xu/hOtfB3z9cUyKGkDNaSwqV5qD/qpUIMtnAN3jo16hSwm AGtjYtji8T1I+Bzfg0hcOIXUZ+JUKGK09axa8r+yKMpaewfe32Ty1CTDVKxCQTFoep9L o0cdpofhSna7dYYQcoRI0nBQLaq3IMIixvX75AeGdCRlFrUUyrdkRgXFMOFDnEXf04QC 5yFoO1eq3tVkBK6MIFpy0B/bGUj3GsDjezM7b3LbnO1D2mWPjRtdLUBfmJ+3IxyRtCVQ D6yw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:cc:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:subject :content-transfer-encoding:mime-version:message-id:date:to:from :dkim-signature; bh=jfSwc9LRx9QPkyAHO04GkTeKX0/bTGx9eU2qXNzcOcc=; b=RbVYo19yNw/8nC+AuwoUiNSICeWYzskcfq5h9+gTP2baJtDPHh+CjQRUtwULAumbTg /fu3MQJIPNW3DAL+9H/nwHwDIlL3kpVZjUOQaVM+1VcS6AtK8In94tJnKMx6YCAM4K/G n0hjaOsGkQkgrVf4Fc7MVq1d55P3l9rdwCJzc1k35XJ0onV5PFB8ZwqwUL0Ivgow9BJH rIKAyUk4sLXYlnnDUnnwSj+jCYdR5ihs84JaLPwz0OwuhKsll3owUndAdt9+yQtARAHT VOKrvSZRh8iEwCQqO6gDd9XdZ0WU5d9nJQp9eYnC+FqxClMWc6Af4syt0DQAAi3K/vSM mXLA== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=BTTNcnLw; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id j131si3741340wmb.32.2019.05.10.06.54.23 for (version=TLS1 cipher=AES128-SHA bits=128/128); Fri, 10 May 2019 06:54:23 -0700 (PDT) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=BTTNcnLw; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from localhost ([127.0.0.1]:43769 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hP5yg-0001Ik-Gc for patch@linaro.org; Fri, 10 May 2019 09:54:22 -0400 Received: from eggs.gnu.org ([209.51.188.92]:38566) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hP5xI-0000bi-Od for qemu-devel@nongnu.org; Fri, 10 May 2019 09:52:59 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1hP5xH-0004nI-EX for qemu-devel@nongnu.org; Fri, 10 May 2019 09:52:56 -0400 Received: from mail-wr1-x444.google.com ([2a00:1450:4864:20::444]:35705) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1hP5xH-0004la-7R for qemu-devel@nongnu.org; Fri, 10 May 2019 09:52:55 -0400 Received: by mail-wr1-x444.google.com with SMTP id w12so8048709wrp.2 for ; Fri, 10 May 2019 06:52:55 -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=jfSwc9LRx9QPkyAHO04GkTeKX0/bTGx9eU2qXNzcOcc=; b=BTTNcnLw0LV5voOfmb1iz3qEDQ/Mx3OchKekmqs41EfKYK77NWuKn+GR8vq0/+IBIY 4N6CCVmnl5coQaxTN0rO+yywyo1+o6y9uVx8bVdU0dKOEZJdarnpA4EVA3qanIyJQHV6 YhAwrJEGxsQwoFMAw4XoBfd6pUB4d27qaRJeVceRPao70C6vLE0JQNpAVErad86ouVRt g8wRU9C4oxuUUueAldUpSnG47AArqQFOVHEtuYSr2V78Am0EAfl/XcXyt7jMQLA42ZWQ NlMNYDy76icbUz54kwo/bJvI1ME0wUEinURzYdD2AGiPSJmGw0Xkq5w7KXUBHyanLBgB rHKg== 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=jfSwc9LRx9QPkyAHO04GkTeKX0/bTGx9eU2qXNzcOcc=; b=FAc2bT4w2i4DaYGQlFfVHiGKNCvLqeKFGTVmtifbVIzGuUPQSMvWTH8jO0KoIv7+kK XAvOm3BIkT4iRjqjMlp2asF+cwhsg1d5n3QZBQ77J8u/xl+Lrx2UAPpj6zB6kkkqZqHC 4GhhSzPpHB94JCEaHKBFm9o1ELO0DDyXAF7ndeSNFYVdYabLkWZc4sMH15K/xl2hkRpz azzytkpvEmsQM7zsTJTSAeUEf8Nzztx694aj1Fk0D+fzyXG2QDDGv/OF60DTQa8wntuS lj8REOUsjdi5QQCgAefnxtGO4Tgf+UfEuaewAzRnwVbhEy7jdavlOhSZKPaNE9O8gnUL 68lQ== X-Gm-Message-State: APjAAAWsIDLrlM3Ht9EJsx9FG5K1jQicftXrS+1Ylnu6PFrtG367wgyG mOHiiBPQQQ54xd706UZBVbBwDw== X-Received: by 2002:adf:dccf:: with SMTP id x15mr8041075wrm.139.1557496373976; Fri, 10 May 2019 06:52:53 -0700 (PDT) Received: from zen.linaroharston ([81.128.185.34]) by smtp.gmail.com with ESMTPSA id z74sm11937877wmc.2.2019.05.10.06.52.53 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Fri, 10 May 2019 06:52:53 -0700 (PDT) Received: from zen.linaroharston. (localhost [127.0.0.1]) by zen.linaroharston (Postfix) with ESMTP id A9C591FF87; Fri, 10 May 2019 14:52:51 +0100 (BST) From: =?utf-8?q?Alex_Benn=C3=A9e?= To: qemu-devel@nongnu.org Date: Fri, 10 May 2019 14:52:47 +0100 Message-Id: <20190510135247.31278-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::444 Subject: [Qemu-devel] [PATCH v4] 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: kwolf@redhat.com, thuth@redhat.com, qemu-block@nongnu.org, mreitz@redhat.com, =?utf-8?q?Alex_Benn=C3=A9e?= Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" This attempts to clean-up the output to better match the output of the rest of the QEMU check system when called with -pretty. This includes: - formatting as " TEST iotest: nnn" - calculating time diff at the end - only dumping config on failure (when -pretty enabled) The existing output is mostly preserved although the dumping of the old time at the start "Ns ..." was removed to keep the logic simple. The timestamp mode can still be used to see which tests are "hanging". Signed-off-by: Alex Bennée Message-Id: <20190503143904.31211-1-alex.bennee@linaro.org> --- v3 - revert echo to printf - add _report_test_start v4 - -pretty -> -makecheck - keep all output together for makecheck --- tests/qemu-iotests/check | 104 ++++++++++++++++++++++++++------------- 1 file changed, 71 insertions(+), 33 deletions(-) -- 2.20.1 diff --git a/tests/qemu-iotests/check b/tests/qemu-iotests/check index 922c5d1d3d3..dc7468c1b1e 100755 --- a/tests/qemu-iotests/check +++ b/tests/qemu-iotests/check @@ -27,6 +27,7 @@ bad="" notrun="" casenotrun="" interrupt=true +makecheck=false # by default don't output timestamps timestamp=${TIMESTAMP:=false} @@ -88,6 +89,22 @@ _full_platform_details() echo "$os/$platform $host $kernel" } +_full_env_details() +{ + cat </dev/null 2>&1 && diff=xxdiff fi ;; - + -makecheck) # makecheck friendly output + makecheck=true + xpand=false + ;; -n) # show me, don't do it showme=true xpand=false @@ -704,23 +725,33 @@ END { if (NR > 0) { trap "_wrapup; exit \$status" 0 1 2 3 15 +# Report the test start and results. For makecheck we want to pretty +# print the whole report at the end of the execution. +# args: $seq +_report_test_start() +{ + if ! $makecheck; then + printf "%s" "$1" + fi +} +# args:$seq $output +_report_test_result() +{ + if $makecheck; then + printf " TEST iotest-$IMGFMT: %s %s\n" "$1" "$2" + else + printf " %s\n" "$2" + fi +} + [ -f $TIMESTAMP_FILE ] || touch $TIMESTAMP_FILE FULL_IMGFMT_DETAILS=$(_full_imgfmt_details) FULL_HOST_DETAILS=$(_full_platform_details) -cat < $TESTS_REMAINING_LOG.tmp mv $TESTS_REMAINING_LOG.tmp $TESTS_REMAINING_LOG @@ -738,7 +772,6 @@ do if $showme then - echo continue elif [ -f expunged ] && $expunge && egrep "^$seq([ ]|\$)" expunged >/dev/null then @@ -753,17 +786,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 && _timestamp if [ "$(head -n 1 "$source_iotests/$seq")" == "#!/usr/bin/env python" ]; then run_command="$PYTHON $seq" @@ -786,21 +813,19 @@ do 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 -- " - cat $seq.notrun - notrun="$notrun $seq" + # overwrites timestamp output + results="[not run] $(cat $seq.notrun)" else if [ $sts -ne 0 ] then - printf %s " [failed, exit status $sts]" + reason=$(printf %s "[failed, exit status $sts]") err=true fi @@ -821,22 +846,29 @@ 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 + results="${results}${thistime}s (last ${lasttime}s)" + else + results="${results}${thistime}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 +884,15 @@ do # if $err then + _report_test_result $seq "FAILED $reason" + if $makecheck; then + _full_env_details + fi bad="$bad $seq" n_bad=$(expr $n_bad + 1) quick=false + else + _report_test_result $seq "$results" fi [ -f $seq.notrun ] || try=$(expr $try + 1)