From mboxrd@z Thu Jan 1 00:00:00 1970 From: Radim =?utf-8?B?S3LEjW3DocWZ?= Subject: Re: [PATCH kvm-unit-tests v2 02/12] run_tests: prepare for changes in scripts/mkstandalone Date: Fri, 18 Dec 2015 11:49:08 +0100 Message-ID: <20151218104907.GA21525@potion.brq.redhat.com> References: <1450374823-7648-1-git-send-email-rkrcmar@redhat.com> <1450374823-7648-3-git-send-email-rkrcmar@redhat.com> <20151217185339.GB14168@hawk.localdomain> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: QUOTED-PRINTABLE Cc: kvm@vger.kernel.org, Paolo Bonzini To: Andrew Jones Return-path: Received: from mx1.redhat.com ([209.132.183.28]:46432 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750767AbbLRKtL (ORCPT ); Fri, 18 Dec 2015 05:49:11 -0500 Received: from int-mx10.intmail.prod.int.phx2.redhat.com (int-mx10.intmail.prod.int.phx2.redhat.com [10.5.11.23]) by mx1.redhat.com (Postfix) with ESMTPS id 5AFD9693D7 for ; Fri, 18 Dec 2015 10:49:11 +0000 (UTC) Content-Disposition: inline In-Reply-To: <20151217185339.GB14168@hawk.localdomain> Sender: kvm-owner@vger.kernel.org List-ID: 2015-12-17 12:53-0600, Andrew Jones: > On Thu, Dec 17, 2015 at 06:53:33PM +0100, Radim Kr=C4=8Dm=C3=A1=C5=99= wrote: >> mkstandalone has a different mechanism for running tests as well as = a >> different handling of output and return codes. >> - create two shell function to capture test execution and logging >> - return the return value of unit-test >> - cope with empty $verbose in `run` >>=20 >> Signed-off-by: Radim Kr=C4=8Dm=C3=A1=C5=99 >> --- >> v2: new (reused the bitshift and comment from v1) >> =20 >> diff --git a/run_tests.sh b/run_tests.sh >> - cmdline=3D"TESTNAME=3D$testname ACCEL=3D$accel ./$TEST_DIR-run = $kernel -smp $smp $opts" >> - if [ $verbose !=3D 0 ]; then >> + cmdline=3D"TESTNAME=3D$testname ACCEL=3D$accel __run $kernel -s= mp $smp $opts" >> + if [ "$verbose" -a "$verbose" !=3D 0 ]; then >=20 > For bash bools I prefer just doing 'if [ "$verbose" =3D "yes" ]', all= owing it > to be empty. Yeah, I guess it's a bit better. (I prefer just [ "$verbose" ].) >> # extra_params in the config file may contain backticks that ne= ed to be >> # expanded, so use eval to start qemu >> - eval $cmdline >> test.log >> + __eval_log "$cmdline" >> + # The first bit of return value is too hard to use, just skip i= t. >> + # Unit-tests' return value is shifted by one. >> + ret=3D$(($? >> 1)) >=20 > I just wrote a patch, inspired by reviewing your v1 of this series, t= hat > tackles the ambiguous exit code problem. I'll post it now, but obviou= sly > we'll need to rebase one or the other of our run_tests.sh series'. Nice, I'll review it later today (I'll travel for most of the afternoon= ).