Commit 0a05e52c authored by Dridi Boukelmoune's avatar Dridi Boukelmoune

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.
parent b6be5d0f
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"
......@@ -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"
......@@ -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"
......@@ -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
}
......@@ -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"
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"
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"
......@@ -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
......
......@@ -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
}
......
......@@ -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"
......
......@@ -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");
......
......@@ -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`.
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment