]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
REGTEST: script: Evaluate the varnishtest command to allow quoted parameters
authorChristopher Faulet <cfaulet@haproxy.com>
Tue, 18 Dec 2018 21:47:23 +0000 (22:47 +0100)
committerChristopher Faulet <cfaulet@haproxy.com>
Thu, 20 Dec 2018 09:33:18 +0000 (10:33 +0100)
Instead of directly executing varnishtest command, we use a variable to build
the command line and we execute it with the 'eval' builtin. This way it is
possible to have quoted parameters. For instance:

  > ./scripts/run-regtests.sh --varnishtestparams "-Dmacro='some value' -n 10"

And the variable 'varnishtestparams' is also move at the end of the command
line, just before the list of test files. So it is possible to override all
default varnish options set by the script.

scripts/run-regtests.sh

index 7da746a74ebdc3468636388abd9d3e98872b63dd..be53e97cfd5069bb82e63f8d085232eddfe70c0a 100755 (executable)
@@ -369,7 +369,8 @@ if [ -n "$testlist" ]; then
   if [ -n "$jobcount" ]; then
     jobcount="-j $jobcount"
   fi
-  $VARNISHTEST_PROGRAM $varnishtestparams $verbose $jobcount -l -k -t 10 $testlist
+  cmd="$VARNISHTEST_PROGRAM -l -k -t 10 $verbose $jobcount $varnishtestparams $testlist"
+  eval $cmd
   _vtresult=$?
 else
   echo "No tests found that meet the required criteria"