From mboxrd@z Thu Jan 1 00:00:00 1970 From: Ian Campbell Subject: [PATCH OSSTEST 4/5] standalone: Make it possible to pass options to run-test Date: Mon, 5 Oct 2015 15:35:07 +0100 Message-ID: <1444055708-15836-4-git-send-email-ian.campbell@citrix.com> References: <1444055694.5302.9.camel@citrix.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: <1444055694.5302.9.camel@citrix.com> List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xen.org Errors-To: xen-devel-bounces@lists.xen.org To: ian.jackson@eu.citrix.com, xen-devel@lists.xen.org Cc: Ian Campbell List-Id: xen-devel@lists.xenproject.org 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 --- v3: Use an array var for correct whitespace handling. --- standalone | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/standalone b/standalone index 3408d24..71f656e 100755 --- a/standalone +++ b/standalone @@ -318,11 +318,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) -- 2.5.3