From: Andrew Jones Subject: Re: [kvm-unit-tests PATCH 3/3] add timeout support Date: Mon, 21 Dec 2015 13:45:48 -0600 Message-ID: <20151221194548.GB5123@hawk.localdomain> References: <1450383054-9724-1-git-send-email-drjones@redhat.com> <1450383054-9724-4-git-send-email-drjones@redhat.com> <20151221170419.GA12725@potion.redhat.com> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: QUOTED-PRINTABLE Cc: kvm@vger.kernel.org, pbonzini@redhat.com To: Radim =?utf-8?B?S3LEjW3DocWZ?= Return-path: Received: from mx1.redhat.com ([209.132.183.28]:40493 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751166AbbLUTpx (ORCPT ); Mon, 21 Dec 2015 14:45:53 -0500 Received: from int-mx09.intmail.prod.int.phx2.redhat.com (int-mx09.intmail.prod.int.phx2.redhat.com [10.5.11.22]) by mx1.redhat.com (Postfix) with ESMTPS id 486CDC0B7E09 for ; Mon, 21 Dec 2015 19:45:53 +0000 (UTC) Content-Disposition: inline In-Reply-To: <20151221170419.GA12725@potion.redhat.com> Sender: kvm-owner@vger.kernel.org List-ID: On Mon, Dec 21, 2015 at 06:04:20PM +0100, Radim Kr=C4=8Dm=C3=A1=C5=99 w= rote: > 2015-12-17 14:10-0600, Andrew Jones: > > Signed-off-by: Andrew Jones > > --- > > diff --git a/arm/run b/arm/run > > @@ -75,10 +75,14 @@ chr_testdev+=3D' -device virtconsole,chardev=3D= ctd -chardev testdev,id=3Dctd' > > M+=3D",accel=3D$ACCEL" > > command=3D"$qemu $M -cpu $processor $chr_testdev" > > command+=3D" -display none -serial stdio -kernel" > > -echo $command "$@" > > + > > +if [ "$TIMEOUT" ]; then > > + timeout_cmd=3D"timeout --foreground $TIMEOUT" >=20 > (command=3D"timeout --foreground $TIMEOUT $command" # to keep the clu= tter > down.) >=20 > > +fi >=20 > (We paste it three times, so I'd rather see this abstracted in a > "scripts/" library.) Sounds good >=20 > > diff --git a/run_tests.sh b/run_tests.sh > > @@ -21,6 +21,7 @@ function run() > > + local timeout=3D"${9:-$TIMEOUT}" > > diff --git a/scripts/mkstandalone.sh b/scripts/mkstandalone.sh > > @@ -97,8 +98,12 @@ if [ "\$QEMU" ]; then > > +if [ "$timeout" ]; then > > + timeout_cmd=3D'timeout --foreground $timeout' >=20 > Both would be nicer if they took the TIMEOUT variable as an override. Everything already takes TIMEOUT as an override, i.e. TIMEOUT=3D3 ./run_tests.sh and TIMEOUT=3D3 arm/run arm/test.flat will both already set a timeout for any test that didn't have a timeout set in unittests.cfg, or wasn't run with run()/unittests.cfg. Or, did you mean that you'd prefer TIMEOUT to override the timeout in unittests.cfg? That does make some sense, in the case the one in the config is longer than desired, however it also makes sense the way I have it now when the one in the config is shorter than TIMEOUT (the fallback default). I think I like it this way better. > We already don't do that for accel and the patch seems ok in other > regards, Hmm, for accel I see a need for a patch allowing us to do ACCEL=3D?? ./run_tests.sh as I already have for TIMEOUT. Also, for both I should add a mkstandalone patch allowing TIMEOUT=3D? ACCEL=3D? make standalone Thanks, drew >=20 > Reviewed-by: Radim Kr=C4=8Dm=C3=A1=C5=99 > -- > To unsubscribe from this list: send the line "unsubscribe kvm" in > the body of a message to majordomo@vger.kernel.org > More majordomo info at http://vger.kernel.org/majordomo-info.html