From nobody Thu May 2 07:27:56 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=1557496545; cv=none; d=zoho.com; s=zohoarc; b=HwuMTwbAy8BNfpuqKbQFx5Co+8aIz1kpSdRqpFjtUC99PUjq8d+QweechkxQP3GjUbnnuZO02BcxENgKb7EeMQPb8z/JHms4WoHc6dghHJlOrS9pTYv3R2/17jwnP070FgBBmY3dsi7/VBwh0GcmMwD54iupzaJM2ktVtUiDPqU= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1557496545; 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=jfSwc9LRx9QPkyAHO04GkTeKX0/bTGx9eU2qXNzcOcc=; b=juEjonjH0eB7DDumd7LjTzGyg/MYIRjLaddE0UwWApgqH1h5xpfoFxKD7+vZweVrdbUffpLkwc5YCiOhh6+F1g789WTM+Lkc06cbPDAKa6YNuMbB+mnRU/kQDB6ys5hCB6BdPPAgK2Lt46hvvF2iqGmoqQd949auwD7Vwosx/XA= 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 1557496544966866.7632653815459; Fri, 10 May 2019 06:55:44 -0700 (PDT) Received: from localhost ([127.0.0.1]:43774 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hP5zb-0001ho-Jg for importer@patchew.org; Fri, 10 May 2019 09:55:19 -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) 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) 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-Google-Smtp-Source: APXvYqxW9Xbfg+U26Mv6Zq7T44OdffOTSo3bGZJYTOjfh6EpBS/DOdZTu6WcUBoQLAVVmc1vigKoMA== X-Received: by 2002:adf:dccf:: with SMTP id x15mr8041075wrm.139.1557496373976; Fri, 10 May 2019 06:52:53 -0700 (PDT) From: =?UTF-8?q?Alex=20Benn=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 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::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=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 v4 - -pretty -> -makecheck - keep all output together for makecheck --- tests/qemu-iotests/check | 104 ++++++++++++++++++++++++++------------- 1 file changed, 71 insertions(+), 33 deletions(-) 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=3D"" notrun=3D"" casenotrun=3D"" interrupt=3Dtrue +makecheck=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 ;; - + -makecheck) # makecheck friendly output + makecheck=3Dtrue + xpand=3Dfalse + ;; -n) # show me, don't do it showme=3Dtrue xpand=3Dfalse @@ -704,23 +725,33 @@ END { if (NR > 0) { =20 trap "_wrapup; exit \$status" 0 1 2 3 15 =20 +# 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 =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 +772,6 @@ do =20 if $showme then - echo continue elif [ -f expunged ] && $expunge && egrep "^$seq([ ]|\$)" expu= nged >/dev/null then @@ -753,17 +786,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 +813,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 +846,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 +884,15 @@ do # if $err then + _report_test_result $seq "FAILED $reason" + if $makecheck; then + _full_env_details + fi bad=3D"$bad $seq" n_bad=3D$(expr $n_bad + 1) quick=3Dfalse + else + _report_test_result $seq "$results" fi [ -f $seq.notrun ] || try=3D$(expr $try + 1) =20 --=20 2.20.1