From mboxrd@z Thu Jan 1 00:00:00 1970 From: =?UTF-8?q?Radim=20Kr=C4=8Dm=C3=A1=C5=99?= Subject: [PATCH kvm-unit-tests v2 08/12] scripts/run: generalize check Date: Thu, 17 Dec 2015 18:53:39 +0100 Message-ID: <1450374823-7648-9-git-send-email-rkrcmar@redhat.com> References: <1450374823-7648-1-git-send-email-rkrcmar@redhat.com> Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: QUOTED-PRINTABLE Cc: Paolo Bonzini , Andrew Jones To: kvm@vger.kernel.org Return-path: Received: from mx1.redhat.com ([209.132.183.28]:46046 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754284AbbLQRyT (ORCPT ); Thu, 17 Dec 2015 12:54:19 -0500 Received: from int-mx11.intmail.prod.int.phx2.redhat.com (int-mx11.intmail.prod.int.phx2.redhat.com [10.5.11.24]) by mx1.redhat.com (Postfix) with ESMTPS id 0C57C36B1DB for ; Thu, 17 Dec 2015 17:54:19 +0000 (UTC) In-Reply-To: <1450374823-7648-1-git-send-email-rkrcmar@redhat.com> Sender: kvm-owner@vger.kernel.org List-ID: config attribute "check" is currently unused. Provide a simple implementation instead of removing it. Signed-off-by: Radim Kr=C4=8Dm=C3=A1=C5=99 --- v2: - update scripts/mkstandalone.sh [Drew] - don't print too much [Drew] - log the output of check command - use $testname =20 scripts/run.bash | 16 +++++----------- 1 file changed, 5 insertions(+), 11 deletions(-) diff --git a/scripts/run.bash b/scripts/run.bash index b92611c29fbb..f532cb9e8b1c 100644 --- a/scripts/run.bash +++ b/scripts/run.bash @@ -22,17 +22,11 @@ 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 by = 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_log "$check" || { + __eval_log 'echo "skipped $testname (check returned $?)"' + echo "skip $testname (failed check)" + return + } =20 cmdline=3D"TESTNAME=3D$testname ACCEL=3D$accel __run $kernel -smp = $smp $opts" if [ "$verbose" -a "$verbose" !=3D 0 ]; then --=20 2.6.4