]> xenbits.xensource.com Git - people/liuw/osstest.git/commitdiff
standalone: Make it possible to pass options to run-test
authorIan Campbell <ian.campbell@citrix.com>
Fri, 22 May 2015 11:56:15 +0000 (12:56 +0100)
committerIan Campbell <ian.campbell@citrix.com>
Thu, 8 Oct 2015 16:17:54 +0000 (17:17 +0100)
Currently the remainder of the comnand line is passed after the host=
ident, which allows for other idents to be given, which isn't all that
useful in practice.

Instead arrange that any additional options up to a "--" marker are
passed before host= and anything after are passed after.

Since the options themselves have a leading -- this can confuse the
scripts own option parsing, meaning you may need more than one "--"
marker, the first to separate the standalone helper args from the ts
args and a second to separate from any ident optiopns.

./standalone run-test -h $HOST -- test-amd64-amd64-xl-xsm ts-host-install --rescue -- guest=debian

Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>
standalone

index 25e23cac81d4deff75fc4ec6feb897a383b154eb..31514f9ab2f3750b454dd2a15725fb6223a27dd9 100755 (executable)
@@ -317,11 +317,18 @@ case $op in
        job=$1; shift
        ts=$1; shift
 
+       options=()
+       for i in "$@" ; do
+           if [ x$i = x-- ] ; then shift; break ; fi
+           options+=("$i")
+           shift
+       done
+
        OSSTEST_CONFIG=$config \
        OSSTEST_FLIGHT=$flight \
        OSSTEST_HOST_REUSE=$reuse \
        OSSTEST_JOB=$job \
-           with_logging logs/$flight/$job.$ts.log ./$ts $hosts "$@"
+           with_logging logs/$flight/$job.$ts.log ./$ts "${options[@]}" $hosts "$@"
        ;;
 
     get-job-status)