Re: [PATCH kvm-unit-tests 2/2] runtime: Introduce VMM_PARAMS

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Fri, Feb 14, 2020 at 11:50:08AM +0100, Paolo Bonzini wrote:
> On 14/02/20 11:38, Andrew Jones wrote:
> > That was the way we originally planned on doing it when Alex Bennee posted
> > his patch. However since d4d34e648482 ("run_tests: fix command line
> > options handling") the "--" has become the divider between run_tests.sh
> > parameter inputs and individually specified tests.
> 
> Hmm, more precisely that is how getopt separates options from other 
> parameters.
> 
> Since we don't expect test names starting with a dash, we could do 
> something like (untested):
> 
> diff --git a/run_tests.sh b/run_tests.sh
> index 01e36dc..8b71cf2 100755
> --- a/run_tests.sh
> +++ b/run_tests.sh
> @@ -35,7 +35,20 @@ RUNTIME_arch_run="./$TEST_DIR/run"
>  source scripts/runtime.bash
>  
>  only_tests=""
> -args=`getopt -u -o ag:htj:v -l all,group:,help,tap13,parallel:,verbose -- $*`
> +args=""
> +vmm_args=""
> +while [ $# -gt 0 ]; do
> +   if test "$1" = --; then
> +       shift
> +       vmm_args=$*
> +       break
> +   else
> +       args="args $1"
> +       shift
> +   fi
> +done
> +
> +args=`getopt -u -o ag:htj:v -l all,group:,help,tap13,parallel:,verbose -- $args`
>  [ $? -ne 0 ] && exit 2;
>  set -- $args;
>  while [ $# -gt 0 ]; do

Unfortunately it regresses the current command line. Here's what I tested

Before
------

$ ./run_tests.sh -j 2 -v pmu psci
VMM_PARAMS= TESTNAME=pmu TIMEOUT=90s ACCEL= ./arm/run arm/pmu.flat -smp 1
VMM_PARAMS= TESTNAME=psci TIMEOUT=90s ACCEL= ./arm/run arm/psci.flat -smp $MAX_SMP
PASS pmu (3 tests)
PASS psci (4 tests)

$ ./run_tests.sh pmu psci -j 2 -v
VMM_PARAMS= TESTNAME=pmu TIMEOUT=90s ACCEL= ./arm/run arm/pmu.flat -smp 1
VMM_PARAMS= TESTNAME=psci TIMEOUT=90s ACCEL= ./arm/run arm/psci.flat -smp $MAX_SMP
PASS pmu (3 tests)
PASS psci (4 tests)

$ ./run_tests.sh -j 2 -v -- pmu psci
VMM_PARAMS= TESTNAME=pmu TIMEOUT=90s ACCEL= ./arm/run arm/pmu.flat -smp 1
VMM_PARAMS= TESTNAME=psci TIMEOUT=90s ACCEL= ./arm/run arm/psci.flat -smp $MAX_SMP
PASS pmu (3 tests)
PASS psci (4 tests)

After
-----

$ ./run_tests.sh -j 2 -v pmu psci
PASS psci (4 tests)

$ ./run_tests.sh pmu psci -j 2 -v
$

(no output)

$ ./run_tests.sh -j 2 -v -- pmu psci
$

(no output)

> 
> > will run the test with "-foo bar" appended to the command line. We could
> > modify mkstandalone.sh to get that feature too (allowing the additional
> > parameters to be given after tests/mytest), but with VMM_PARAMS we don't
> > have to.
> 
> Yes, having consistency between standalone and run_tests.sh is a good thing.
>

So should we:

 1) try to get "--" working, but also keep the environment variable as
    an alternative which works with standalone?
 2) drop the environment variable, get "--" working and modify
    mkstandalone.sh?
 3) drop the environment variable, get "--" working, but forget about
    standalone?
 4) just keep the VMM_PARAMS approach and forget about "--"?

Thanks,
drew




[Index of Archives]     [KVM ARM]     [KVM ia64]     [KVM ppc]     [Virtualization Tools]     [Spice Development]     [Libvirt]     [Libvirt Users]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite Questions]     [Linux Kernel]     [Linux SCSI]     [XFree86]

  Powered by Linux