From: Naresh Kamboju <naresh.kamboju@linaro.org>
To: Hangbin Liu <liuhangbin@gmail.com>
Cc: "open list:KERNEL SELFTEST FRAMEWORK"
<linux-kselftest@vger.kernel.org>, Shuah Khan <shuah@kernel.org>,
Jonathan Corbet <corbet@lwn.net>,
linux-doc@vger.kernel.org,
open list <linux-kernel@vger.kernel.org>,
Tim.Bird@sony.com, lkft-triage@lists.linaro.org,
Kees Cook <keescook@chromium.org>,
Anders Roxell <anders.roxell@linaro.org>,
Justin Cook <justin.cook@linaro.org>,
Linux-Next Mailing List <linux-next@vger.kernel.org>
Subject: Re: [PATCHv5 kselftest next] selftests/run_kselftest.sh: make each test individually selectable
Date: Fri, 25 Sep 2020 13:51:53 +0530 [thread overview]
Message-ID: <CA+G9fYvT6Mw2BamoiVyw=wLUqD-3LB2oaDqcuabOyWfFxEN1qg@mail.gmail.com> (raw)
In-Reply-To: <20200914022227.437143-1-liuhangbin@gmail.com>
On Mon, 14 Sep 2020 at 07:53, Hangbin Liu <liuhangbin@gmail.com> wrote:
>
> Currently, after generating run_kselftest.sh, there is no way to choose
> which test we could run. All the tests are listed together and we have
> to run all every time. This patch enhanced the run_kselftest.sh to make
> the tests individually selectable. e.g.
>
> $ ./run_kselftest.sh -t "bpf size timers"
My test run break on linux next
./run_kselftest.sh: line 1331: syntax error near unexpected token `)'
./run_kselftest.sh: line 1331: `-e -s | --summary )
logfile=$BASE_DIR/output.log; cat /dev/null > $logfile; shift ;;'
steps do run:
# run_kselftest.sh file generated by kselftest Makefile and included in tarball
./run_kselftest.sh 2>&1 | tee "${LOGFILE}"
ref:
https://github.com/nareshkamboju/test-definitions/blob/master/automated/linux/kselftest/kselftest.sh#L222
full test run log:
https://lkft.validation.linaro.org/scheduler/job/1786826#L1391
>
> Before the patch:
> ================
>
> $ cat run_kselftest.sh
> \#!/bin/sh
> BASE_DIR=$(realpath $(dirname $0))
> cd $BASE_DIR
> . ./kselftest/runner.sh
> ROOT=$PWD
> if [ "$1" = "--summary" ]; then
> logfile=$BASE_DIR/output.log
> cat /dev/null > $logfile
> fi
> [ -w /dev/kmsg ] && echo "kselftest: Running tests in android" >> /dev/kmsg
> cd android
> run_many \
> "run.sh"
> cd $ROOT
> ...<snip>...
> [ -w /dev/kmsg ] && echo "kselftest: Running tests in zram" >> /dev/kmsg
> cd zram
> run_many \
> "zram.sh"
> cd $ROOT
>
> After the patch:
> ===============
>
> $ cat run_kselftest.sh
> \#!/bin/sh
> BASE_DIR=$(realpath $(dirname $0))
> . ./kselftest/runner.sh
> TESTS="android ...<snip>... filesystems/binderfs ...<snip>... zram"
>
> run_android()
> {
> [ -w /dev/kmsg ] && echo "kselftest: Running tests in android" >> /dev/kmsg
> cd android
> run_many \
> "run.sh"
> cd $ROOT
> }
>
> ...<snip>...
>
> run_filesystems_binderfs()
> {
> [ -w /dev/kmsg ] && echo "kselftest: Running tests in filesystems/binderfs" >> /dev/kmsg
> cd filesystems/binderfs
> run_many \
> "binderfs_test"
> cd $ROOT
> }
>
> ...<snip>...
>
> run_zram()
> {
> [ -w /dev/kmsg ] && echo "kselftest: Running tests in zram" >> /dev/kmsg
> cd zram
> run_many \
> "zram.sh"
> cd $ROOT
> }
>
> usage()
> {
> cat <<EOF
> usage: ${0##*/} OPTS
> -s | --summary Only print summary info and put detailed log in output.log
> -t | --tests Test name you want to run specifically
> -h | --help Show this usage info
> EOF
> }
>
> while true; do
> case "$1" in
> -s | --summary ) logfile=$BASE_DIR/output.log; cat /dev/null > $logfile; shift ;;
> -t | --tests ) TESTS=$2; shift 2 ;;
> -l | --list ) echo $TESTS; exit 0 ;;
> -h | --help ) usage; exit 0 ;;
> "" ) break;;
> * ) usage; exit 1;;
> esac
> done
>
> cd $BASE_DIR
> ROOT=$PWD
> for folder in $TESTS; do
> folder=$(echo $folder | tr -s '/-' '_')
> run_$folder
> done
>
> Signed-off-by: Hangbin Liu <liuhangbin@gmail.com>
Reported-by: Naresh Kamboju <naresh.kamboju@linaro.org>
--
Linaro LKFT
https://lkft.linaro.org
next prev parent reply other threads:[~2020-09-25 8:22 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <20200914021758.420874-1-liuhangbin@gmail.com/>
2020-09-14 2:22 ` [PATCHv5 kselftest next] selftests/run_kselftest.sh: make each test individually selectable Hangbin Liu
2020-09-25 8:21 ` Naresh Kamboju [this message]
2020-09-25 21:16 ` Kees Cook
2020-09-25 22:37 ` Shuah Khan
2020-09-25 23:06 ` Shuah Khan
2020-09-25 23:46 ` Kees Cook
2020-09-27 1:53 ` Hangbin Liu
2020-09-28 20:06 ` Kees Cook
2020-09-29 1:27 ` Hangbin Liu
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to='CA+G9fYvT6Mw2BamoiVyw=wLUqD-3LB2oaDqcuabOyWfFxEN1qg@mail.gmail.com' \
--to=naresh.kamboju@linaro.org \
--cc=Tim.Bird@sony.com \
--cc=anders.roxell@linaro.org \
--cc=corbet@lwn.net \
--cc=justin.cook@linaro.org \
--cc=keescook@chromium.org \
--cc=linux-doc@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-kselftest@vger.kernel.org \
--cc=linux-next@vger.kernel.org \
--cc=liuhangbin@gmail.com \
--cc=lkft-triage@lists.linaro.org \
--cc=shuah@kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).