[master] 0a05e52 Retire ${varnish*} macros in varnishtest

Dridi Boukelmoune dridi.boukelmoune at gmail.com
Mon Feb 22 16:26:52 CET 2016


commit 0a05e52c9c84ac4eca5d5049bf02954d1ec1dba3
Author: Dridi Boukelmoune <dridi.boukelmoune at gmail.com>
Date:   Sun Feb 21 19:09:37 2016 +0100

    Retire ${varnish*} macros in varnishtest
    
    Instead, varnishtest users should set up a proper PATH, just like
    `varnishtest -i` does to use binaries from the build tree.

diff --git a/bin/varnishtest/tests/a00009.vtc b/bin/varnishtest/tests/a00009.vtc
index b2b63dc..b62483d 100644
--- a/bin/varnishtest/tests/a00009.vtc
+++ b/bin/varnishtest/tests/a00009.vtc
@@ -1,11 +1,11 @@
 varnishtest "Code coverage of VCL compiler and RSTdump etc"
 
-shell "${varnishd} -b 127.0.0.1:80 -C -n ${tmpdir} > /dev/null 2>&1"
-shell "${varnishd} -x dumprstparam > /dev/null 2>&1"
-shell "${varnishd} -x dumprstvsl > /dev/null 2>&1"
-err_shell {VCL version declaration missing} "echo 'bad vcl' >${tmpdir}/t.vcl ; ${varnishd} -f ${tmpdir}/t.vcl -n ${tmpdir} 2>&1"
-err_shell {VCL version declaration missing} "echo 'bad vcl' >${tmpdir}/t.vcl ; ${varnishd} -C -f ${tmpdir}/t.vcl -n ${tmpdir} 2>&1"
-err_shell {-spersistent has been deprecated} "${varnishd} -spersistent 2>&1"
-err_shell {Unknown jail method "xyz"} "${varnishd} -jxyz 2>&1"
-err_shell {-j must be the first argument} "${varnishd} -jnone -jxyz 2>&1"
-err_shell {-j must be the first argument} "${varnishd} -d -jxyz 2>&1"
+shell "varnishd -b 127.0.0.1:80 -C -n ${tmpdir} > /dev/null 2>&1"
+shell "varnishd -x dumprstparam > /dev/null 2>&1"
+shell "varnishd -x dumprstvsl > /dev/null 2>&1"
+err_shell {VCL version declaration missing} "echo 'bad vcl' >${tmpdir}/t.vcl ; varnishd -f ${tmpdir}/t.vcl -n ${tmpdir} 2>&1"
+err_shell {VCL version declaration missing} "echo 'bad vcl' >${tmpdir}/t.vcl ; varnishd -C -f ${tmpdir}/t.vcl -n ${tmpdir} 2>&1"
+err_shell {-spersistent has been deprecated} "varnishd -spersistent 2>&1"
+err_shell {Unknown jail method "xyz"} "varnishd -jxyz 2>&1"
+err_shell {-j must be the first argument} "varnishd -jnone -jxyz 2>&1"
+err_shell {-j must be the first argument} "varnishd -d -jxyz 2>&1"
diff --git a/bin/varnishtest/tests/b00041.vtc b/bin/varnishtest/tests/b00041.vtc
index f299c1b..7c004e7 100644
--- a/bin/varnishtest/tests/b00041.vtc
+++ b/bin/varnishtest/tests/b00041.vtc
@@ -2,4 +2,4 @@ varnishtest "Test varnishadm and the Telnet CLI"
 
 varnish v1 -vcl {backend foo { .host = "127.0.0.1"; } } -start
 
-shell "${varnishadm} -n ${tmpdir}/v1 help > /dev/null"
+shell "varnishadm -n ${tmpdir}/v1 help > /dev/null"
diff --git a/bin/varnishtest/tests/b00045.vtc b/bin/varnishtest/tests/b00045.vtc
index e1e524d..8b67483 100644
--- a/bin/varnishtest/tests/b00045.vtc
+++ b/bin/varnishtest/tests/b00045.vtc
@@ -15,4 +15,4 @@ client c1 {
 delay .2
 
 err_shell {Could not open pid/lock} \
-	"${varnishd} -P ${tmpdir}/v1/varnishd.pid -b 127.0.0.1:80 -a :0 -n ${tmpdir} 2>&1"
+	"varnishd -P ${tmpdir}/v1/varnishd.pid -b 127.0.0.1:80 -a :0 -n ${tmpdir} 2>&1"
diff --git a/bin/varnishtest/tests/c00003.vtc b/bin/varnishtest/tests/c00003.vtc
index 1013b86..75db736 100644
--- a/bin/varnishtest/tests/c00003.vtc
+++ b/bin/varnishtest/tests/c00003.vtc
@@ -5,10 +5,10 @@ varnishtest "Check that we fail to start if any listen address does not work"
 
 # All bad listen addresses
 err_shell "could not be resolved to an IP address" {
-	${varnishd} -F -a "${bad_ip}:0" -b '***' -n ${tmpdir} 2>&1
+	varnishd -F -a "${bad_ip}:0" -b '***' -n ${tmpdir} 2>&1
 }
 
 # old style address list
 err_shell "Unknown protocol" {
-	${varnishd} -F -a "127.0.0.1:0,${bad_ip}:0" -b '***' -n ${tmpdir} 2>&1
+	varnishd -F -a "127.0.0.1:0,${bad_ip}:0" -b '***' -n ${tmpdir} 2>&1
 }
diff --git a/bin/varnishtest/tests/j00002.vtc b/bin/varnishtest/tests/j00002.vtc
index 1ab0ade..96231d1 100644
--- a/bin/varnishtest/tests/j00002.vtc
+++ b/bin/varnishtest/tests/j00002.vtc
@@ -2,11 +2,11 @@ varnishtest "-junix bad subarg handling"
 
 feature root
 
-err_shell "unknown sub-argument" "${varnishd} -junix,bla=foo 2>&1"
-err_shell "user not found" "${varnishd} -junix,user=/// 2>&1"
-err_shell "user not found" "${varnishd} -junix,workuser=/// 2>&1"
-err_shell "group not found" "${varnishd} -junix,ccgroup=/// 2>&1"
+err_shell "unknown sub-argument" "varnishd -junix,bla=foo 2>&1"
+err_shell "user not found" "varnishd -junix,user=/// 2>&1"
+err_shell "user not found" "varnishd -junix,workuser=/// 2>&1"
+err_shell "group not found" "varnishd -junix,ccgroup=/// 2>&1"
 
 feature user_varnish
 
-err_shell "have different login groups" "${varnishd} -junix,workuser=root 2>&1"
+err_shell "have different login groups" "varnishd -junix,workuser=root 2>&1"
diff --git a/bin/varnishtest/tests/r01770.vtc b/bin/varnishtest/tests/r01770.vtc
index 838e44b..5243b4a 100644
--- a/bin/varnishtest/tests/r01770.vtc
+++ b/bin/varnishtest/tests/r01770.vtc
@@ -1,4 +1,4 @@
 varnishtest "bad protocol specs for -a"
 
-err_shell "Too many sub-arguments" "${varnishd} -a 127.0.0.1:80000,PROXY,FOO -d 2>&1"
-err_shell "Too many sub-arguments" "${varnishd} -a 127.0.0.1:80000,HTTP/1,FOO -d 2>&1"
+err_shell "Too many sub-arguments" "varnishd -a 127.0.0.1:80000,PROXY,FOO -d 2>&1"
+err_shell "Too many sub-arguments" "varnishd -a 127.0.0.1:80000,HTTP/1,FOO -d 2>&1"
diff --git a/bin/varnishtest/tests/r01813.vtc b/bin/varnishtest/tests/r01813.vtc
index f37aa54..88bb5ae 100644
--- a/bin/varnishtest/tests/r01813.vtc
+++ b/bin/varnishtest/tests/r01813.vtc
@@ -1,3 +1,3 @@
 varnishtest "Duplicate -a arguments"
 
-err_shell {have same address} "${varnishd} -d -a 127.0.0.1:38484 -a 127.0.0.1:38484 -b localhost:80 2>&1"
+err_shell {have same address} "varnishd -d -a 127.0.0.1:38484 -a 127.0.0.1:38484 -b localhost:80 2>&1"
diff --git a/bin/varnishtest/tests/u00001.vtc b/bin/varnishtest/tests/u00001.vtc
index 1a1c039..b06a315 100644
--- a/bin/varnishtest/tests/u00001.vtc
+++ b/bin/varnishtest/tests/u00001.vtc
@@ -12,7 +12,7 @@ server s1 {
 
 varnish v1 -vcl+backend "" -start
 
-shell "${varnishncsa} -D -P ${tmpdir}/ncsa.pid -n ${v1_name} -w ${tmpdir}/ncsa.log -F %s"
+shell "varnishncsa -D -P ${tmpdir}/ncsa.pid -n ${v1_name} -w ${tmpdir}/ncsa.log -F %s"
 
 # give varnishncsa enough time to open the VSM
 delay 2
diff --git a/bin/varnishtest/tests/v00045.vtc b/bin/varnishtest/tests/v00045.vtc
index 936dec9..dc57c74 100644
--- a/bin/varnishtest/tests/v00045.vtc
+++ b/bin/varnishtest/tests/v00045.vtc
@@ -17,21 +17,21 @@ varnish v1 -cliok "vcl.state vcl1 cold"
 # We should now see it as cooling
 delay 1
 shell {
-	${varnishadm} -n ${v1_name} vcl.list |
+	varnishadm -n ${v1_name} vcl.list |
 	grep "auto/cooling.*vcl1" >/dev/null
 }
 
 # It can't be warmed up yet
 delay 1
 shell {
-	${varnishadm} -n ${v1_name} vcl.state vcl1 warm 2>/dev/null |
+	varnishadm -n ${v1_name} vcl.state vcl1 warm 2>/dev/null |
 	grep "vmod-debug ref on vcl1" >/dev/null
 }
 
 # It will eventually cool down
 delay 2
 shell {
-	${varnishadm} -n ${v1_name} vcl.list |
+	varnishadm -n ${v1_name} vcl.list |
 	grep "auto/cold.*vcl1" >/dev/null
 }
 
diff --git a/bin/varnishtest/vtc_main.c b/bin/varnishtest/vtc_main.c
index 7272e22..69b9c0a 100644
--- a/bin/varnishtest/vtc_main.c
+++ b/bin/varnishtest/vtc_main.c
@@ -474,11 +474,6 @@ main(int argc, char * const *argv)
 	char *p;
 	uintmax_t bufsiz;
 
-	/* Default names of programs */
-#define VTC_PROG(l)	extmacro_def(#l, #l);
-#include "programs.h"
-#undef VTC_PROG
-
 	/* Default import spec of vmods */
 #define VTC_VMOD(l)	extmacro_def("vmod_" #l, #l);
 #include "vmods.h"
diff --git a/bin/varnishtest/vtc_varnish.c b/bin/varnishtest/vtc_varnish.c
index 1ff780f..e81fe17 100644
--- a/bin/varnishtest/vtc_varnish.c
+++ b/bin/varnishtest/vtc_varnish.c
@@ -402,7 +402,7 @@ varnish_launch(struct varnish *v)
 	vsb = VSB_new_auto();
 	AN(vsb);
 	VSB_printf(vsb, "cd ${pwd} &&");
-	VSB_printf(vsb, " exec ${varnishd} %s -d -n %s",
+	VSB_printf(vsb, " exec varnishd %s -d -n %s",
 	    v->jail, v->workdir);
 	if (vtc_witness)
 		VSB_cat(vsb, " -p debug=+witness");
diff --git a/doc/sphinx/reference/varnishtest.rst b/doc/sphinx/reference/varnishtest.rst
index 5bfca7b..057542e 100644
--- a/doc/sphinx/reference/varnishtest.rst
+++ b/doc/sphinx/reference/varnishtest.rst
@@ -36,7 +36,7 @@ The following options are available:
 
 -h               Show help
 
--i               Find varnishd in build tree
+-i               Set PATH to find varnish binaries in build tree
 
 -j jobs          Run this many tests in parallel
 
@@ -59,10 +59,6 @@ The following options are available:
 file             File to use as a script
 
 
-Macro definitions that can be overridden.
-
-varnishd         Path to varnishd to use [varnishd]
-
 If `TMPDIR` is set in the environment, varnishtest creates temporary
 `vtc.*` directories for each test in `$TMPDIR`, otherwise in `/tmp`.
 



More information about the varnish-commit mailing list