From mboxrd@z Thu Jan 1 00:00:00 1970 From: Andrew Jones Subject: Re: [PATCH kvm-unit-tests 4/6] run_tests: generalize check Date: Mon, 14 Dec 2015 16:11:29 -0600 Message-ID: <20151214221129.GE3633@hawk.localdomain> References: <1450128261-21170-1-git-send-email-rkrcmar@redhat.com> <1450128261-21170-5-git-send-email-rkrcmar@redhat.com> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: QUOTED-PRINTABLE Cc: kvm@vger.kernel.org, Paolo Bonzini To: Radim =?utf-8?B?S3LEjW3DocWZ?= Return-path: Received: from mx1.redhat.com ([209.132.183.28]:53015 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753527AbbLNWLf (ORCPT ); Mon, 14 Dec 2015 17:11:35 -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 2DD1FC0A5273 for ; Mon, 14 Dec 2015 22:11:35 +0000 (UTC) Content-Disposition: inline In-Reply-To: <1450128261-21170-5-git-send-email-rkrcmar@redhat.com> Sender: kvm-owner@vger.kernel.org List-ID: On Mon, Dec 14, 2015 at 10:24:19PM +0100, Radim Kr=C4=8Dm=C3=A1=C5=99 w= rote: > config attribute "check" is currently unused. > Provide a simple implementation instead of removing it. >=20 > Signed-off-by: Radim Kr=C4=8Dm=C3=A1=C5=99 > --- > run_tests.sh | 15 ++++----------- > 1 file changed, 4 insertions(+), 11 deletions(-) >=20 > diff --git a/run_tests.sh b/run_tests.sh > index 4d813b9a7084..b0b064f2e341 100755 > --- a/run_tests.sh > +++ b/run_tests.sh > @@ -35,17 +35,10 @@ function run() > return > fi > =20 > - # check a file for a particular value before running a test > - # the check line can contain multiple files to check separated b= y a space > - # but each check parameter needs to be of the form =3D > - for check_param in ${check[@]}; do > - path=3D${check_param%%=3D*} > - value=3D${check_param#*=3D} > - if [ "$path" ] && [ "$(cat $path)" !=3D "$value" ]; then > - echo "skip $1 ($path not equal to $value)" > - return > - fi > - done > + eval $check || { > + echo "skip $1 (failed \$($check))" > + return > + } I think we should use "\e[33mSKIP\e[0m" for skip. Maybe we should creat= e pass(),fail(),skip() functions in order to make sure all callers use th= e same prefix with the same color. > =20 > cmdline=3D"TESTNAME=3D$testname ACCEL=3D$accel ./$TEST_DIR-run $= kernel -smp $smp $opts" > if [ $verbose !=3D 0 ]; then > --=20 > 2.6.4 >=20 > -- > 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