From mboxrd@z Thu Jan 1 00:00:00 1970 X-GM-THRID: 6550672687897772032 X-Received: by 2002:a2e:7e05:: with SMTP id z5-v6mr1081796ljc.9.1525249811090; Wed, 02 May 2018 01:30:11 -0700 (PDT) X-BeenThere: isar-users@googlegroups.com Received: by 2002:a2e:635a:: with SMTP id x87-v6ls1215885ljb.6.gmail; Wed, 02 May 2018 01:30:10 -0700 (PDT) X-Google-Smtp-Source: AB8JxZoBB1hngBK1By2AWFW6ssCDbPO3ItTzKR8fGJ5od2ivXuYiAGbL5QotFU55+0GI7+8CLY/n X-Received: by 2002:a2e:9750:: with SMTP id f16-v6mr1025419ljj.19.1525249810611; Wed, 02 May 2018 01:30:10 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1525249810; cv=none; d=google.com; s=arc-20160816; b=s4yT02TLtIrzMi02sQW5TPRPj/B7O/YZVYnjK6yGjFwUcrzIFukDVXOeWgpAiJuwAf NIUDUbxtEj6hgFaiM9BtYtKCY+eVL/dvzcroeTNvpW0E5SJwPmlSoYEQof8BkeIXlwiw m+MDpirCOffyutx1CILc250A1Qkexis1WFt8HtplPnpRJQCa8/J2yjRSKia1VpdvWr9x mE5bDZmpypswlZ4cQO0d91x6GvdxzEhvtnaO8OLgKH7B2Wx3kbruWAlS1Aht+aBavisU zQko5NLKm8qgG/fSEOkUG3fFqNJRiUI98nepcVUseKcROvEmBiVXjNXh9eu7PLXmBBaA nUbA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:subject:cc:to:from:date:arc-authentication-results; bh=NHtppY7FpiKcaNIaHEzaD4tACI+x9Y5ARm8PqPhpYys=; b=XOlPuA80uIc5tPH895J9AaEVScyRM7/3Z99k+jyiaIGKBPpgBzk1CDg2vqdmeI8lCx kwQw5SWPRWVPHHVdtDbh5e1CCXDPZn3IG6Av6JFzxVxMIJSDafp4MAnsxRfz38TWxWWG Y/PEYdEdXoluJ2QpR2xH0Q3xBdFC2jLPizS+yFzu+FYt8ZIYIjJIMfmgCdkO9uWY1wX7 d60rHdRIc6sl7H6zAtEML+4gX88atrJ+0PjtXw17ovC4wLo0J4dLLHw2sxXd3/GUg2yO ycq5JiksH8PzP1sHzK9oR8Jikp1rZbinnAt5N48MDIfizK2irAZ3hq7a6QYWzTdcEIrC fWbQ== ARC-Authentication-Results: i=1; gmr-mx.google.com; spf=pass (google.com: domain of henning.schild@siemens.com designates 192.35.17.28 as permitted sender) smtp.mailfrom=henning.schild@siemens.com Return-Path: Received: from goliath.siemens.de (goliath.siemens.de. [192.35.17.28]) by gmr-mx.google.com with ESMTPS id n5-v6si456437ljj.5.2018.05.02.01.30.10 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 02 May 2018 01:30:10 -0700 (PDT) Received-SPF: pass (google.com: domain of henning.schild@siemens.com designates 192.35.17.28 as permitted sender) client-ip=192.35.17.28; Authentication-Results: gmr-mx.google.com; spf=pass (google.com: domain of henning.schild@siemens.com designates 192.35.17.28 as permitted sender) smtp.mailfrom=henning.schild@siemens.com Received: from mail1.siemens.de (mail1.siemens.de [139.23.33.14]) by goliath.siemens.de (8.15.2/8.15.2) with ESMTPS id w428U9iu015224 (version=TLSv1.2 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Wed, 2 May 2018 10:30:09 +0200 Received: from md1pvb1c.ad001.siemens.net (md1pvb1c.ad001.siemens.net [139.25.68.40]) by mail1.siemens.de (8.15.2/8.15.2) with ESMTP id w428U9A9005882; Wed, 2 May 2018 10:30:09 +0200 Date: Wed, 2 May 2018 10:30:08 +0200 From: Henning Schild To: Alexander Smirnov Cc: Subject: Re: [PATCH 1/3] scripts/vm_smoke_test: Add verbosity parameter Message-ID: <20180502103008.1bb400ca@md1pvb1c.ad001.siemens.net> In-Reply-To: <20180501175511.26145-2-asmirnov@ilbers.de> References: <20180501175511.26145-1-asmirnov@ilbers.de> <20180501175511.26145-2-asmirnov@ilbers.de> X-Mailer: Claws Mail 3.15.0-dirty (GTK+ 2.24.31; x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-TUID: la5InCCS97xP Am Tue, 1 May 2018 20:55:09 +0300 schrieb Alexander Smirnov : > Issues: > 1. Currently this script displays boot log for all the images. This > could bring some inconviniences for users, who want to perform quick > test and get just messages FAILED/PASSED. > 2. Also the boot log is displayed if test case failed. So in the > worst case when all cases for current image failed, the boot log will > be displayed 3 times. Both are features not issues. If one really wants less output you could introduce an argument to reduce verbosity (-nv). Or please add the "-v" to your CI setup. A CI build takes quite some time/ressources so it is a good idea to keep logs by default to later understand why things failed. Henning > Solution: > 1. If at least one test case failed for current image, the boot log > will be displayed (only one time, despite on number of cases failed). > 2. Boot log is disabled by default. It could be enabled for all the > images by '-v' option passed to this script. > > Signed-off-by: Alexander Smirnov > --- > scripts/vm_smoke_test | 62 > ++++++++++++++++++++++++++++++++++++++++++++------- 1 file changed, > 54 insertions(+), 8 deletions(-) > > diff --git a/scripts/vm_smoke_test b/scripts/vm_smoke_test > index 274ec1d..92fda2d 100755 > --- a/scripts/vm_smoke_test > +++ b/scripts/vm_smoke_test > @@ -5,13 +5,19 @@ > > CONSOLE_OUTPUT=/tmp/isar_console > PID_FILE=/tmp/qemu.pid > +VERBOSE=0 > > -RET=0 > +# Error codes: > +ES_OK=0 > +ES_FAIL=1 > +ES_BUG=3 > + > +RET=$ES_OK > > dump_boot_log() { > - echo "Boot log: 8<--" > + echo "Boot log:\n8<--" > cat $CONSOLE_OUTPUT > - echo -e "\n8<--" > + echo "\n8<--" > } > > check_login_prompt() { > @@ -23,8 +29,8 @@ check_login_prompt() { > echo "PASSED" > else > echo "FAIL" > - dump_boot_log > - RET=1 > + RET=$ES_FAIL > + FAIL=1 > fi > } > > @@ -37,8 +43,8 @@ check_example_module() { > echo "PASSED" > else > echo "FAIL" > - dump_boot_log > - RET=1 > + RET=$ES_FAIL > + FAIL=1 > fi > } > > @@ -54,19 +60,59 @@ run_test () { > sleep 60 > kill `cat $PID_FILE` > > + FAIL=0 > + > # Check login prompt > check_login_prompt > > # Check kernel module > check_example_module > > - dump_boot_log > + [ $VERBOSE -eq 1 -o $FAIL -eq 1 ] && dump_boot_log > > # Clean up test artifacts > rm $CONSOLE_OUTPUT > rm $PID_FILE > } > > +show_help() { > + echo "This script tests all the default Isar images in QEMU." > + echo > + echo "Usage:" > + echo " $0 [params]" > + echo > + echo "Parameters:" > + echo " -v, --verbose display boot logs for all the > targets." > + echo " -h, --help display this message and exit." > + echo > + echo "Exit status:" > + echo " 0 if OK," > + echo " 1 if test failed," > + echo " 3 if invalid parameters are passed." > +} > + > +# Parse command line to get user configuration > +while [ $# -gt 0 ] > +do > + key="$1" > + > + case $key in > + -h|--help) > + show_help > + exit 0 > + ;; > + -v|--verbose) > + VERBOSE=1 > + ;; > + *) > + echo "error: invalid parameter '$key', please try '--help' > to get list of supported parameters" > + exit $ES_BUG > + ;; > + esac > + > + shift > +done > + > # ARM machine > run_test arm wheezy > run_test arm jessie