From: "Alex Bennée" <alex.bennee@linaro.org>
To: Andrew Jones <drjones@redhat.com>
Cc: kvm@vger.kernel.org, linux-arm-kernel@lists.infradead.org,
kvmarm@lists.cs.columbia.edu, christoffer.dall@linaro.org,
marc.zyngier@arm.com, mttcg@greensocs.com,
peter.maydell@linaro.org, claudio.fontana@huawei.com,
nikunj@linux.vnet.ibm.com, jan.kiszka@siemens.com,
mark.burton@greensocs.com, a.rigo@virtualopensystems.com,
qemu-devel@nongnu.org, cota@braap.org, serge.fdrv@gmail.com,
pbonzini@redhat.com, bobby.prani@gmail.com, rth@twiddle.net,
fred.konrad@greensocs.com
Subject: Re: [Qemu-devel] [kvm-unit-tests PATCH v7 03/11] run_tests: allow passing of options to QEMU
Date: Mon, 28 Nov 2016 11:22:46 +0000 [thread overview]
Message-ID: <877f7nu9vd.fsf@linaro.org> (raw)
In-Reply-To: <20161128091051.zvtsvoow34b2nd5w@kamzik.brq.redhat.com>
Andrew Jones <drjones@redhat.com> writes:
> On Thu, Nov 24, 2016 at 04:10:25PM +0000, Alex Bennée wrote:
>> This introduces a the option -o for passing of options directly to QEMU
>> which is useful. In my case I'm using it to toggle MTTCG on an off:
>>
>> ./run_tests.sh -t -o "-tcg mttcg=on"
>>
>> Signed-off-by: Alex Bennée <alex.bennee@linaro.org>
>> ---
>> run_tests.sh | 10 +++++++---
>> scripts/functions.bash | 13 +++++++------
>> 2 files changed, 14 insertions(+), 9 deletions(-)
>>
>> diff --git a/run_tests.sh b/run_tests.sh
>> index 4f2e5cb..05cc7fb 100755
>> --- a/run_tests.sh
>> +++ b/run_tests.sh
>> @@ -13,10 +13,11 @@ function usage()
>> {
>> cat <<EOF
>>
>> -Usage: $0 [-g group] [-a accel] [-t] [-h] [-v]
>> +Usage: $0 [-g group] [-a accel] [-o qemu_opts] [-t] [-h] [-v]
>>
>> -g: Only execute tests in the given group
>> -a: Force acceleration mode (tcg/kvm)
>> + -o: additional options for QEMU command line
>> -t: disable timeouts
>> -h: Output this help text
>> -v: Enables verbose mode
>> @@ -30,7 +31,7 @@ EOF
>> RUNTIME_arch_run="./$TEST_DIR/run"
>> source scripts/runtime.bash
>>
>> -while getopts "g:a:thv" opt; do
>> +while getopts "g:a:o:thv" opt; do
>> case $opt in
>> g)
>> only_group=$OPTARG
>> @@ -38,6 +39,9 @@ while getopts "g:a:thv" opt; do
>> a)
>> force_accel=$OPTARG
>> ;;
>> + o)
>> + extra_opts=$OPTARG
>> + ;;
>> t)
>> no_timeout="yes"
>> ;;
>> @@ -67,4 +71,4 @@ RUNTIME_log_stdout () {
>> config=$TEST_DIR/unittests.cfg
>> rm -f test.log
>> printf "BUILD_HEAD=$(cat build-head)\n\n" > test.log
>> -for_each_unittest $config run
>> +for_each_unittest $config run "$extra_opts"
>> diff --git a/scripts/functions.bash b/scripts/functions.bash
>> index ee9143c..d38a69e 100644
>> --- a/scripts/functions.bash
>> +++ b/scripts/functions.bash
>> @@ -2,11 +2,12 @@
>> function for_each_unittest()
>> {
>> local unittests="$1"
>> - local cmd="$2"
>> - local testname
>> + local cmd="$2"
>> + local extra_opts=$3
>> + local testname
>
> We use tabs in this file. Not sure why cmd and testname got
> changed too...
>
>> local smp
>> local kernel
>> - local opts
>> + local opts=$extra_opts
>> local groups
>> local arch
>> local check
>> @@ -21,7 +22,7 @@ function for_each_unittest()
>> testname=${BASH_REMATCH[1]}
>> smp=1
>> kernel=""
>> - opts=""
>> + opts=$extra_opts
>> groups=""
>> arch=""
>> check=""
>> @@ -32,7 +33,7 @@ function for_each_unittest()
>> elif [[ $line =~ ^smp\ *=\ *(.*)$ ]]; then
>> smp=${BASH_REMATCH[1]}
>> elif [[ $line =~ ^extra_params\ *=\ *(.*)$ ]]; then
>> - opts=${BASH_REMATCH[1]}
>> + opts="$opts ${BASH_REMATCH[1]}"
>> elif [[ $line =~ ^groups\ *=\ *(.*)$ ]]; then
>> groups=${BASH_REMATCH[1]}
>> elif [[ $line =~ ^arch\ *=\ *(.*)$ ]]; then
>> @@ -45,6 +46,6 @@ function for_each_unittest()
>> timeout=${BASH_REMATCH[1]}
>> fi
>> done
>> - "$cmd" "$testname" "$groups" "$smp" "$kernel" "$opts" "$arch" "$check" "$accel" "$timeout"
>> + "$cmd" "$testname" "$groups" "$smp" "$kernel" "$opts" "$arch" "$check" "$accel" "$timeout"
>> exec {fd}<&-
>> }
>> --
>> 2.10.1
>>
>>
>
> This is a pretty good idea, but I think I might like the extra options
> to be given like this instead
>
> ./run_tests.sh [run_tests.sh options] -- [qemu options]
>
> Thanks,
> drew
That sounds like a better way, I'll fix that.
--
Alex Bennée
next prev parent reply other threads:[~2016-11-28 11:23 UTC|newest]
Thread overview: 32+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-11-24 16:10 [Qemu-devel] [kvm-unit-tests PATCH v7 00/11] QEMU MTTCG Test cases Alex Bennée
2016-11-24 16:10 ` [Qemu-devel] [kvm-unit-tests PATCH v7 01/11] run_tests: allow forcing of acceleration mode Alex Bennée
2016-11-28 8:51 ` Andrew Jones
2016-11-24 16:10 ` [Qemu-devel] [kvm-unit-tests PATCH v7 02/11] run_tests: allow disabling of timeouts Alex Bennée
2016-11-28 9:00 ` Andrew Jones
2016-11-24 16:10 ` [Qemu-devel] [kvm-unit-tests PATCH v7 03/11] run_tests: allow passing of options to QEMU Alex Bennée
2016-11-28 9:10 ` Andrew Jones
2016-11-28 11:22 ` Alex Bennée [this message]
2016-11-24 16:10 ` [Qemu-devel] [kvm-unit-tests PATCH v7 04/11] libcflat: add PRI(dux)32 format types Alex Bennée
2016-11-28 9:18 ` Andrew Jones
2017-01-10 15:23 ` Alex Bennée
2017-01-10 15:29 ` Alex Bennée
2016-11-24 16:10 ` [Qemu-devel] [kvm-unit-tests PATCH v7 05/11] lib: add isaac prng library from CCAN Alex Bennée
2016-11-24 16:10 ` [Qemu-devel] [kvm-unit-tests PATCH v7 06/11] arm/Makefile.common: force -fno-pic Alex Bennée
2016-11-28 9:33 ` Andrew Jones
2016-11-24 16:10 ` [Qemu-devel] [kvm-unit-tests PATCH v7 07/11] arm/tlbflush-code: Add TLB flush during code execution test Alex Bennée
2016-11-28 9:42 ` Andrew Jones
2016-11-24 16:10 ` [Qemu-devel] [kvm-unit-tests PATCH v7 08/11] arm/tlbflush-data: Add TLB flush during data writes test Alex Bennée
2016-11-28 10:11 ` Andrew Jones
2016-11-24 16:10 ` [Qemu-devel] [kvm-unit-tests PATCH v7 09/11] arm/locking-tests: add comprehensive locking test Alex Bennée
2016-11-28 10:29 ` Andrew Jones
2016-11-24 16:10 ` [Qemu-devel] [kvm-unit-tests PATCH v7 10/11] arm/barrier-litmus-tests: add simple mp and sal litmus tests Alex Bennée
2016-11-24 16:10 ` [Qemu-devel] [kvm-unit-tests PATCH v7 11/11] arm/tcg-test: some basic TCG exercising tests Alex Bennée
2016-11-28 10:37 ` [Qemu-devel] [kvm-unit-tests PATCH v7 00/11] QEMU MTTCG Test cases Andrew Jones
2016-11-28 11:12 ` Alex Bennée
2016-11-28 11:14 ` Peter Maydell
2016-11-28 11:58 ` Andrew Jones
2016-11-28 13:30 ` Peter Maydell
2016-11-28 14:04 ` Andrew Jones
2016-11-28 14:07 ` Andrew Jones
2016-11-28 14:09 ` Peter Maydell
2016-11-28 10:51 ` Andrew Jones
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=877f7nu9vd.fsf@linaro.org \
--to=alex.bennee@linaro.org \
--cc=a.rigo@virtualopensystems.com \
--cc=bobby.prani@gmail.com \
--cc=christoffer.dall@linaro.org \
--cc=claudio.fontana@huawei.com \
--cc=cota@braap.org \
--cc=drjones@redhat.com \
--cc=fred.konrad@greensocs.com \
--cc=jan.kiszka@siemens.com \
--cc=kvm@vger.kernel.org \
--cc=kvmarm@lists.cs.columbia.edu \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=marc.zyngier@arm.com \
--cc=mark.burton@greensocs.com \
--cc=mttcg@greensocs.com \
--cc=nikunj@linux.vnet.ibm.com \
--cc=pbonzini@redhat.com \
--cc=peter.maydell@linaro.org \
--cc=qemu-devel@nongnu.org \
--cc=rth@twiddle.net \
--cc=serge.fdrv@gmail.com \
/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).