From nobody Fri May 3 20:36:20 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1557484228; cv=none; d=zoho.com; s=zohoarc; b=Fxb7IElilyIaCgA89ct9vruAyFEOksxsVxSVXtdknTAJH4UzPzw9KUQV2xoXG3xQmAp363yXXUPnPVAn+8VB3Xq3vq08MTBYLLmtDFEbAEtgGSTs21hoU/rsrb9NlUHpAA0+F0n6/QD7a903t5gGmH5p6a2sYXTzDx+tgMZwjgI= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1557484228; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Sender:Subject:To:ARC-Authentication-Results; bh=auocvdW0EldqE7PJbYf+YXK+U72ZdztjsoSifzZ1BvU=; b=YEZoa3kmeCJDotlxiCTm7fuCZHY0XY2Z6FaRmSTJx0OB9hz8ULzb8n+u2UaXK5meV81MFiBcRhdUauyyvjy8JkMSHbFtuHEP1FGJQ59ia8gL79fTIabwuaoQe5MhFhI/fcsznwlul66BWSVvDZeD8lcMhsgfAw5recRMXif9LXA= ARC-Authentication-Results: i=1; mx.zoho.com; dkim=fail; spf=pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail header.from= (p=none dis=none) header.from= Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1557484228107863.3218846527909; Fri, 10 May 2019 03:30:28 -0700 (PDT) Received: from localhost ([127.0.0.1]:40778 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hP2nH-0000Qm-U1 for importer@patchew.org; Fri, 10 May 2019 06:30:23 -0400 Received: from eggs.gnu.org ([209.51.188.92]:57031) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hP2mN-0008UE-NZ for qemu-devel@nongnu.org; Fri, 10 May 2019 06:29:29 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1hP2mM-0002FW-DC for qemu-devel@nongnu.org; Fri, 10 May 2019 06:29:27 -0400 Received: from mail-wm1-x342.google.com ([2a00:1450:4864:20::342]:51730) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1hP2mM-0002EW-4x for qemu-devel@nongnu.org; Fri, 10 May 2019 06:29:26 -0400 Received: by mail-wm1-x342.google.com with SMTP id o189so6980092wmb.1 for ; Fri, 10 May 2019 03:29:25 -0700 (PDT) Received: from zen.linaroharston ([81.128.185.34]) by smtp.gmail.com with ESMTPSA id d11sm3369109wmb.39.2019.05.10.03.29.23 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Fri, 10 May 2019 03:29:23 -0700 (PDT) Received: from zen.linaroharston. (localhost [127.0.0.1]) by zen.linaroharston (Postfix) with ESMTP id 117701FF87; Fri, 10 May 2019 11:29:23 +0100 (BST) 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=auocvdW0EldqE7PJbYf+YXK+U72ZdztjsoSifzZ1BvU=; b=RyCnxBMH5YbUSRstC/CfnwE72TS+QMrZf50tHluTFZKGunXYGl3nlBCiX/R0YFgO0z HWvfNbnSHy0HUjnU7/Ak0yyom0LBAdni55NFIVXKpO2LRrysUp0VlHOoRS8llEbQcJKb DNGpGki/ap9C6SsTC4VzHu5x12nBcIg1dS352SrsCV/rFHzUgrRiby9qAp07BlW+yqGQ KKkDeorq58iWpw5ko0Z21/3pDAXspIvR/RgIxLJU6bDzl7bgi84oKfibkDxQbWEuE+Zc 2Vl/NI+kE/zFp1Ie/gJg2yStiD+OthjMSuU8pjpIezWYSU+OssjMdSW/HfaqLLgQuwFQ fkPg== 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=auocvdW0EldqE7PJbYf+YXK+U72ZdztjsoSifzZ1BvU=; b=i7QuhVdjao2nngAIhHeGkrgS+bB+ogHIMS3x21f/YtMmDCE6z5nbac90KDx2xXg9jf S2zGWmeGGxwlNrqv2/lz15ar2RGKezz2N8VPE0GHXB8F87ve4lnnxYQE+X7MvdQrnzwR gFDZlZWab21R2BSviaiyTRX1Egpzd9y4R1px3plOr1LTSpazilF4+Ixe/7CcKHiXHELO 3pLONAYVV4P643mnnqBXkoPtggIHqqSceGsqVIgTSaym8jIsy7wg3u/4oXtBntkFQA6W aqDT004Gh508xrMpl0o+Uq2DjGvq70hSuTcTGltehz2LohFndKEra7PQP9nyPm91NUuv cVqg== X-Gm-Message-State: APjAAAU8KKYwUihuPeQpo5sBXkXcDApxyrMt+HY97ktxKeLgImy5xSpp QBHgoK2CpUqmgqdREJaDw9vQzw== X-Google-Smtp-Source: APXvYqzaobI31aTHzDZsydkyVLuQUoD8uhEq3/2Ixs7/gl7MGkXn1BQOtaxoAA/+SyCL5hILXWpylQ== X-Received: by 2002:a1c:1a47:: with SMTP id a68mr6736796wma.88.1557484164423; Fri, 10 May 2019 03:29:24 -0700 (PDT) From: =?UTF-8?q?Alex=20Benn=C3=A9e?= To: qemu-devel@nongnu.org Date: Fri, 10 May 2019 11:29:18 +0100 Message-Id: <20190510102918.2705-1-alex.bennee@linaro.org> X-Mailer: git-send-email 2.20.1 MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable 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] [PATCH v3] 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=20Benn=C3=A9e?= Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) 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=C3=A9e Message-Id: <20190503143904.31211-1-alex.bennee@linaro.org> --- v3 - revert echo to printf - add _report_test_start --- tests/qemu-iotests/check | 101 ++++++++++++++++++++++++++------------- 1 file changed, 68 insertions(+), 33 deletions(-) diff --git a/tests/qemu-iotests/check b/tests/qemu-iotests/check index 922c5d1d3d3..ac481f905bf 100755 --- a/tests/qemu-iotests/check +++ b/tests/qemu-iotests/check @@ -27,6 +27,7 @@ bad=3D"" notrun=3D"" casenotrun=3D"" interrupt=3Dtrue +pretty=3Dfalse =20 # by default don't output timestamps timestamp=3D${TIMESTAMP:=3Dfalse} @@ -88,6 +89,22 @@ _full_platform_details() echo "$os/$platform $host $kernel" } =20 +_full_env_details() +{ + cat </dev/null 2>&1 && diff=3Dxxdiff fi ;; - + -pretty) # pretty print output + pretty=3Dtrue + xpand=3Dfalse + ;; -n) # show me, don't do it showme=3Dtrue xpand=3Dfalse @@ -704,23 +725,30 @@ END { if (NR > 0) { =20 trap "_wrapup; exit \$status" 0 1 2 3 15 =20 +# Report the test start and results, optionally pretty printing for make +# args: $seq +_report_test_start() +{ + if $pretty; then + printf " TEST iotest: %s" "$1" + else + printf "%s" "$1" + fi +} +# args: output +_report_test_result() +{ + printf "%s\n" "$1" +} + [ -f $TIMESTAMP_FILE ] || touch $TIMESTAMP_FILE =20 FULL_IMGFMT_DETAILS=3D$(_full_imgfmt_details) FULL_HOST_DETAILS=3D$(_full_platform_details) =20 -cat <= $TESTS_REMAINING_LOG.tmp mv $TESTS_REMAINING_LOG.tmp $TESTS_REMAINING_LOG @@ -738,7 +769,6 @@ do =20 if $showme then - echo continue elif [ -f expunged ] && $expunge && egrep "^$seq([ ]|\$)" expu= nged >/dev/null then @@ -753,17 +783,11 @@ do # really going to try and run this one # rm -f $seq.out.bad - lasttime=3D$(sed -n -e "/^$seq /s/.* //p" <$TIMESTAMP_FILE) - if [ "X$lasttime" !=3D X ]; then - printf %s " ${lasttime}s ..." - else - printf " " # prettier output with timestamps. - fi rm -f core $seq.notrun rm -f $seq.casenotrun =20 start=3D$(_wallclock) - $timestamp && printf %s " [$(date "+%T")]" + $timestamp && _timestamp =20 if [ "$(head -n 1 "$source_iotests/$seq")" =3D=3D "#!/usr/bin/env = python" ]; then run_command=3D"$PYTHON $seq" @@ -786,21 +810,19 @@ do =20 if [ -f core ] then - printf " [dumped core]" mv core $seq.core + reason=3D"[dumped core] $seq.core" err=3Dtrue fi =20 if [ -f $seq.notrun ] then - $timestamp || printf " [not run] " - $timestamp && echo " [not run]" && printf %s " $seq -- " - cat $seq.notrun - notrun=3D"$notrun $seq" + # overwrites timestamp output + results=3D"[not run] $(cat $seq.notrun)" else if [ $sts -ne 0 ] then - printf %s " [failed, exit status $sts]" + reason=3D$(printf %s "[failed, exit status $sts]") err=3Dtrue fi =20 @@ -821,22 +843,29 @@ do =20 if [ ! -f "$reference" ] then - echo " - no qualified output" + reason=3D"- no qualified output" err=3Dtrue 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=3D$(sed -n -e "/^$seq /s/.* //p" <$TIMEST= AMP_FILE) + thistime=3D$(expr $stop - $start) + echo "$seq $thistime" >>$tmp.time + + if [ "X$lasttime" !=3D X ]; then + results=3D"${results}${thistime}s (last ${last= time}s)" + else + results=3D"${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=3D"- output mismatch (see $seq.out.bad)" err=3Dtrue fi fi @@ -852,9 +881,15 @@ do # if $err then + _report_test_result " FAILED $reason" + if $pretty; then + _full_env_details + fi bad=3D"$bad $seq" n_bad=3D$(expr $n_bad + 1) quick=3Dfalse + else + _report_test_result " $results" fi [ -f $seq.notrun ] || try=3D$(expr $try + 1) =20 --=20 2.20.1