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

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

 



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

> 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.

Paolo




[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