> Now that we have reached a consensus I'll take care of this, I think > next Sunday :)
Patches attached!
From 839f3c7d2403e9bfc144497311a40448deeec71c Mon Sep 17 00:00:00 2001 From: Dridi Boukelmoune <dridi.boukelmo...@gmail.com> Date: Sun, 21 Feb 2016 19:09:37 +0100 Subject: [PATCH 1/5] 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. --- bin/varnishtest/tests/a00009.vtc | 18 +++++++++--------- bin/varnishtest/tests/b00041.vtc | 2 +- bin/varnishtest/tests/b00045.vtc | 2 +- bin/varnishtest/tests/c00003.vtc | 4 ++-- bin/varnishtest/tests/j00002.vtc | 10 +++++----- bin/varnishtest/tests/r01770.vtc | 4 ++-- bin/varnishtest/tests/r01813.vtc | 2 +- bin/varnishtest/tests/u00001.vtc | 2 +- bin/varnishtest/tests/v00045.vtc | 6 +++--- bin/varnishtest/vtc_main.c | 5 ----- bin/varnishtest/vtc_varnish.c | 2 +- doc/sphinx/reference/varnishtest.rst | 6 +----- 12 files changed, 27 insertions(+), 36 deletions(-) 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`. -- 2.5.0
From 0a47bfbe628caa6ffae480b4b3be76d8b7c7b542 Mon Sep 17 00:00:00 2001 From: Dridi Boukelmoune <dridi.boukelmo...@gmail.com> Date: Sun, 21 Feb 2016 19:31:55 +0100 Subject: [PATCH 2/5] varnishtest -i builds vmod_path instead of macros The macros are still here but ${vmod_std} is now expanded to std and so on. --- bin/varnishtest/tests/m00008.vtc | 2 +- bin/varnishtest/vtc_main.c | 22 ++++++++++++++-------- bin/varnishtest/vtc_varnish.c | 3 +++ doc/sphinx/reference/varnishtest.rst | 2 +- 4 files changed, 19 insertions(+), 10 deletions(-) diff --git a/bin/varnishtest/tests/m00008.vtc b/bin/varnishtest/tests/m00008.vtc index 9386ae9..8e93d58 100644 --- a/bin/varnishtest/tests/m00008.vtc +++ b/bin/varnishtest/tests/m00008.vtc @@ -15,7 +15,7 @@ varnish v1 -cliok "param.set vcc_unsafe_path off" varnish v1 -errvcl {'import ... from path ...' is unsafe.} { backend default { .host = "${s1_sock}"; } - import ${vmod_std}; + import std from "${topbuild}/lib/libvmod_std/.libs/"; } varnish v1 \ diff --git a/bin/varnishtest/vtc_main.c b/bin/varnishtest/vtc_main.c index 69b9c0a..03ced80 100644 --- a/bin/varnishtest/vtc_main.c +++ b/bin/varnishtest/vtc_main.c @@ -94,6 +94,7 @@ static int vtc_good; static int vtc_fail; static char *tmppath; static char *cwd = NULL; +char *vmod_path = NULL; int leave_temp; int vtc_witness = 0; int feature_dns; @@ -130,7 +131,7 @@ usage(void) fprintf(stderr, FMT, "-b size", "Set internal buffer size (default: 512K)"); fprintf(stderr, FMT, "-D name=val", "Define macro"); - fprintf(stderr, FMT, "-i", "Find varnishd in build tree"); + fprintf(stderr, FMT, "-i", "Find varnish binaries in build tree"); fprintf(stderr, FMT, "-j jobs", "Run this many tests in parallel"); fprintf(stderr, FMT, "-k", "Continue on test failure"); fprintf(stderr, FMT, "-L", "Always leave temporary vtc.*"); @@ -376,19 +377,22 @@ i_mode(void) AZ(putenv(strdup(VSB_data(vsb)))); /* - * Redefine VMOD macros + * Build vmod_path which can find all VMODs in the build tree */ + VSB_clear(vsb); + sep = ""; #define VTC_VMOD(l) \ do { \ - VSB_clear(vsb); \ - VSB_printf(vsb, \ - "%s from \"%s/lib/libvmod_%s/.libs/libvmod_%s.so\"", \ - #l, topbuild, #l, #l); \ - AZ(VSB_finish(vsb)); \ - extmacro_def("vmod_" #l, "%s", VSB_data(vsb)); \ + VSB_printf(vsb, "%s%s/lib/libvmod_" #l "/.libs", \ + sep, topbuild); \ + sep = ":"; \ + extmacro_def("vmod_" #l, #l); \ } while (0); #include "vmods.h" #undef VTC_VMOD + AZ(VSB_finish(vsb)); + vmod_path = strdup(VSB_data(vsb)); + AN(vmod_path); free(topbuild); VSB_delete(vsb); } @@ -487,6 +491,8 @@ main(int argc, char * const *argv) cwd = getcwd(NULL, PATH_MAX); extmacro_def("pwd", "%s", cwd); + vmod_path = NULL; + setbuf(stdout, NULL); setbuf(stderr, NULL); while ((ch = getopt(argc, argv, "b:D:hij:kLln:qt:vW")) != -1) { diff --git a/bin/varnishtest/vtc_varnish.c b/bin/varnishtest/vtc_varnish.c index e81fe17..1757722 100644 --- a/bin/varnishtest/vtc_varnish.c +++ b/bin/varnishtest/vtc_varnish.c @@ -54,6 +54,7 @@ #include "vtim.h" extern int leave_temp; +extern char *vmod_path; struct varnish { unsigned magic; @@ -419,6 +420,8 @@ varnish_launch(struct varnish *v) VSB_printf(vsb, ",%s", v->proto); VSB_printf(vsb, " -M '%s %s'", abuf, pbuf); VSB_printf(vsb, " -P %s/varnishd.pid", v->workdir); + if (vmod_path != NULL) + VSB_printf(vsb, " -p vmod_path=%s", vmod_path); VSB_printf(vsb, " %s", VSB_data(v->args)); AZ(VSB_finish(vsb)); vtc_log(v->vl, 3, "CMD: %s", VSB_data(vsb)); diff --git a/doc/sphinx/reference/varnishtest.rst b/doc/sphinx/reference/varnishtest.rst index 057542e..d689929 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 Set PATH to find varnish binaries in build tree +-i Set PATH and vmod_path to find varnish binaries in build tree -j jobs Run this many tests in parallel -- 2.5.0
From 0ef4f2d006a3375aec9ffc2c774e37ab690d71bb Mon Sep 17 00:00:00 2001 From: Dridi Boukelmoune <dridi.boukelmo...@gmail.com> Date: Sun, 21 Feb 2016 20:15:08 +0100 Subject: [PATCH 3/5] Retire ${vmod_*} macros for varnishtest -i --- bin/varnishtest/tests/b00016.vtc | 2 +- bin/varnishtest/tests/c00055.vtc | 2 +- bin/varnishtest/tests/c00067.vtc | 2 +- bin/varnishtest/tests/c00070.vtc | 2 +- bin/varnishtest/tests/c00071.vtc | 2 +- bin/varnishtest/tests/c00074.vtc | 4 ++-- bin/varnishtest/tests/d00000.vtc | 2 +- bin/varnishtest/tests/d00001.vtc | 2 +- bin/varnishtest/tests/d00002.vtc | 4 ++-- bin/varnishtest/tests/d00003.vtc | 4 ++-- bin/varnishtest/tests/d00004.vtc | 2 +- bin/varnishtest/tests/d00005.vtc | 2 +- bin/varnishtest/tests/d00006.vtc | 4 ++-- bin/varnishtest/tests/d00007.vtc | 2 +- bin/varnishtest/tests/d00008.vtc | 2 +- bin/varnishtest/tests/d00009.vtc | 2 +- bin/varnishtest/tests/d00010.vtc | 2 +- bin/varnishtest/tests/d00011.vtc | 4 ++-- bin/varnishtest/tests/d00012.vtc | 4 ++-- bin/varnishtest/tests/d00013.vtc | 4 ++-- bin/varnishtest/tests/m00000.vtc | 8 ++++---- bin/varnishtest/tests/m00001.vtc | 8 ++++---- bin/varnishtest/tests/m00002.vtc | 2 +- bin/varnishtest/tests/m00004.vtc | 4 ++-- bin/varnishtest/tests/m00005.vtc | 2 +- bin/varnishtest/tests/m00006.vtc | 2 +- bin/varnishtest/tests/m00007.vtc | 2 +- bin/varnishtest/tests/m00008.vtc | 2 +- bin/varnishtest/tests/m00011.vtc | 2 +- bin/varnishtest/tests/m00012.vtc | 6 +++--- bin/varnishtest/tests/m00013.vtc | 2 +- bin/varnishtest/tests/m00014.vtc | 2 +- bin/varnishtest/tests/m00015.vtc | 2 +- bin/varnishtest/tests/m00016.vtc | 2 +- bin/varnishtest/tests/m00017.vtc | 4 ++-- bin/varnishtest/tests/m00018.vtc | 2 +- bin/varnishtest/tests/m00019.vtc | 8 ++++---- bin/varnishtest/tests/m00020.vtc | 2 +- bin/varnishtest/tests/m00021.vtc | 2 +- bin/varnishtest/tests/m00022.vtc | 4 ++-- bin/varnishtest/tests/o00000.vtc | 2 +- bin/varnishtest/tests/o00001.vtc | 2 +- bin/varnishtest/tests/r00263.vtc | 2 +- bin/varnishtest/tests/r00306.vtc | 2 +- bin/varnishtest/tests/r00722.vtc | 2 +- bin/varnishtest/tests/r00878.vtc | 6 +++--- bin/varnishtest/tests/r01002.vtc | 2 +- bin/varnishtest/tests/r01145.vtc | 2 +- bin/varnishtest/tests/r01212.vtc | 2 +- bin/varnishtest/tests/r01312.vtc | 2 +- bin/varnishtest/tests/r01332.vtc | 2 +- bin/varnishtest/tests/r01406.vtc | 2 +- bin/varnishtest/tests/r01498.vtc | 2 +- bin/varnishtest/tests/r01501.vtc | 2 +- bin/varnishtest/tests/r01510.vtc | 4 ++-- bin/varnishtest/tests/r01532.vtc | 2 +- bin/varnishtest/tests/r01569.vtc | 2 +- bin/varnishtest/tests/r01575.vtc | 2 +- bin/varnishtest/tests/r01613.vtc | 2 +- bin/varnishtest/tests/r01644.vtc | 2 +- bin/varnishtest/tests/r01739.vtc | 2 +- bin/varnishtest/tests/r01801.vtc | 6 +++--- bin/varnishtest/tests/v00010.vtc | 2 +- bin/varnishtest/tests/v00014.vtc | 2 +- bin/varnishtest/tests/v00025.vtc | 2 +- bin/varnishtest/tests/v00041.vtc | 4 ++-- bin/varnishtest/tests/v00042.vtc | 2 +- bin/varnishtest/tests/v00043.vtc | 2 +- bin/varnishtest/tests/v00044.vtc | 2 +- bin/varnishtest/tests/v00045.vtc | 2 +- bin/varnishtest/vtc_main.c | 6 ------ 71 files changed, 97 insertions(+), 103 deletions(-) diff --git a/bin/varnishtest/tests/b00016.vtc b/bin/varnishtest/tests/b00016.vtc index f4763ee..abf25b3 100644 --- a/bin/varnishtest/tests/b00016.vtc +++ b/bin/varnishtest/tests/b00016.vtc @@ -19,7 +19,7 @@ client c1 { } -run varnish v1 -vcl+backend { - import ${vmod_directors}; + import directors; sub vcl_init { new bar = directors.random(); diff --git a/bin/varnishtest/tests/c00055.vtc b/bin/varnishtest/tests/c00055.vtc index ccfb53c..10c87f2 100644 --- a/bin/varnishtest/tests/c00055.vtc +++ b/bin/varnishtest/tests/c00055.vtc @@ -11,7 +11,7 @@ server s1 { } -start varnish v1 -vcl+backend { - import ${vmod_std}; + import std; sub vcl_recv { if (std.cache_req_body(1KB)) { diff --git a/bin/varnishtest/tests/c00067.vtc b/bin/varnishtest/tests/c00067.vtc index 65303af..fff734c 100644 --- a/bin/varnishtest/tests/c00067.vtc +++ b/bin/varnishtest/tests/c00067.vtc @@ -31,7 +31,7 @@ client c1 { delay .2 varnish v1 -vcl+backend { - import ${vmod_std}; + import std; sub vcl_recv { if (std.cache_req_body(110B)) { diff --git a/bin/varnishtest/tests/c00070.vtc b/bin/varnishtest/tests/c00070.vtc index b2df5b4..a3064d8 100644 --- a/bin/varnishtest/tests/c00070.vtc +++ b/bin/varnishtest/tests/c00070.vtc @@ -9,7 +9,7 @@ server s1 { } -start varnish v1 -vcl+backend { - import ${vmod_debug}; + import debug; sub vcl_backend_response { set beresp.http.free_backend = debug.workspace_free(backend); } diff --git a/bin/varnishtest/tests/c00071.vtc b/bin/varnishtest/tests/c00071.vtc index 7572613..e589386 100644 --- a/bin/varnishtest/tests/c00071.vtc +++ b/bin/varnishtest/tests/c00071.vtc @@ -12,7 +12,7 @@ server s1 { } -start varnish v1 -vcl+backend { - import ${vmod_debug}; + import debug; sub vcl_deliver { debug.workspace_allocate(client, debug.workspace_free(client) - 150); diff --git a/bin/varnishtest/tests/c00074.vtc b/bin/varnishtest/tests/c00074.vtc index f20f71c..61f2dec 100644 --- a/bin/varnishtest/tests/c00074.vtc +++ b/bin/varnishtest/tests/c00074.vtc @@ -6,8 +6,8 @@ server s1 { } -start varnish v1 -vcl+backend { - import ${vmod_debug}; - import ${vmod_std}; + import debug; + import std; sub vcl_recv { set req.http.ws-free = debug.workspace_free(session); diff --git a/bin/varnishtest/tests/d00000.vtc b/bin/varnishtest/tests/d00000.vtc index 2ec92ff..507e9c7 100644 --- a/bin/varnishtest/tests/d00000.vtc +++ b/bin/varnishtest/tests/d00000.vtc @@ -21,7 +21,7 @@ server s4 { } -start varnish v1 -vcl+backend { - import ${vmod_directors}; + import directors; sub vcl_init { new rr = directors.round_robin(); diff --git a/bin/varnishtest/tests/d00001.vtc b/bin/varnishtest/tests/d00001.vtc index 2311b0a..4051476 100644 --- a/bin/varnishtest/tests/d00001.vtc +++ b/bin/varnishtest/tests/d00001.vtc @@ -16,7 +16,7 @@ server s3 { } -start varnish v1 -vcl+backend { - import ${vmod_directors}; + import directors; sub vcl_init { new fb1 = directors.fallback(); diff --git a/bin/varnishtest/tests/d00002.vtc b/bin/varnishtest/tests/d00002.vtc index 0a0ba98..b13518c 100644 --- a/bin/varnishtest/tests/d00002.vtc +++ b/bin/varnishtest/tests/d00002.vtc @@ -8,7 +8,7 @@ server s1 { } -start varnish v1 -vcl+backend { - import ${vmod_directors}; + import directors; sub vcl_init { new foo = directors.random(); @@ -43,7 +43,7 @@ server s2 { } -start varnish v1 -vcl+backend { - import ${vmod_directors}; + import directors; sub vcl_init { new foo = directors.random(); diff --git a/bin/varnishtest/tests/d00003.vtc b/bin/varnishtest/tests/d00003.vtc index 970ed2d..7f12096 100644 --- a/bin/varnishtest/tests/d00003.vtc +++ b/bin/varnishtest/tests/d00003.vtc @@ -21,8 +21,8 @@ server s2 { } -start varnish v1 -vcl+backend { - import ${vmod_std}; - import ${vmod_directors}; + import std; + import directors; sub vcl_init { new h1 = directors.hash(); diff --git a/bin/varnishtest/tests/d00004.vtc b/bin/varnishtest/tests/d00004.vtc index cef05f0..82b35b5 100644 --- a/bin/varnishtest/tests/d00004.vtc +++ b/bin/varnishtest/tests/d00004.vtc @@ -35,7 +35,7 @@ server s4 { } -start varnish v1 -vcl+backend { - import ${vmod_directors}; + import directors; sub vcl_init { new foo = directors.random(); diff --git a/bin/varnishtest/tests/d00005.vtc b/bin/varnishtest/tests/d00005.vtc index d00e9c0..4d3b857 100644 --- a/bin/varnishtest/tests/d00005.vtc +++ b/bin/varnishtest/tests/d00005.vtc @@ -21,7 +21,7 @@ server s4 -repeat 2 { } -start varnish v1 -vcl+backend { - import ${vmod_directors}; + import directors; sub vcl_init { new rr1 = directors.round_robin(); diff --git a/bin/varnishtest/tests/d00006.vtc b/bin/varnishtest/tests/d00006.vtc index 9d8ba1d..e98d66a 100644 --- a/bin/varnishtest/tests/d00006.vtc +++ b/bin/varnishtest/tests/d00006.vtc @@ -23,7 +23,7 @@ server s4 { } -start varnish v1 -errvcl {Names of VCL objects cannot contain '-'} { - import ${vmod_directors}; + import directors; backend b1 { .host = "127.0.0.1"; .port = "8080";} sub vcl_init { new rr1-xx = directors.round_robin(); @@ -32,7 +32,7 @@ varnish v1 -errvcl {Names of VCL objects cannot contain '-'} { varnish v1 -vcl+backend { - import ${vmod_directors}; + import directors; sub vcl_init { new rr1 = directors.round_robin(); rr1.add_backend(s1); diff --git a/bin/varnishtest/tests/d00007.vtc b/bin/varnishtest/tests/d00007.vtc index 26112e6..cdc889c 100644 --- a/bin/varnishtest/tests/d00007.vtc +++ b/bin/varnishtest/tests/d00007.vtc @@ -6,7 +6,7 @@ server s1 { } -start varnish v1 -vcl { - import ${vmod_debug}; + import debug; backend dummy { .host = "${bad_ip}"; .port = "9080"; } diff --git a/bin/varnishtest/tests/d00008.vtc b/bin/varnishtest/tests/d00008.vtc index 79096b9..465fcda 100644 --- a/bin/varnishtest/tests/d00008.vtc +++ b/bin/varnishtest/tests/d00008.vtc @@ -13,7 +13,7 @@ server s2 { } -start varnish v1 -vcl { - import ${vmod_debug}; + import debug; backend dummy { .host = "${bad_ip}"; .port = "9080"; } diff --git a/bin/varnishtest/tests/d00009.vtc b/bin/varnishtest/tests/d00009.vtc index 46d05c4..6b20030 100644 --- a/bin/varnishtest/tests/d00009.vtc +++ b/bin/varnishtest/tests/d00009.vtc @@ -16,7 +16,7 @@ server s2 { } -start varnish v1 -vcl { - import ${vmod_debug}; + import debug; backend dummy { .host = "${bad_ip}"; .port = "9080"; } diff --git a/bin/varnishtest/tests/d00010.vtc b/bin/varnishtest/tests/d00010.vtc index 145112a..e67fd54 100644 --- a/bin/varnishtest/tests/d00010.vtc +++ b/bin/varnishtest/tests/d00010.vtc @@ -16,7 +16,7 @@ server s2 { } -start varnish v1 -vcl { - import ${vmod_debug}; + import debug; backend dummy { .host = "${bad_ip}"; .port = "9080"; } diff --git a/bin/varnishtest/tests/d00011.vtc b/bin/varnishtest/tests/d00011.vtc index 639161e..ab1c8e0 100644 --- a/bin/varnishtest/tests/d00011.vtc +++ b/bin/varnishtest/tests/d00011.vtc @@ -9,8 +9,8 @@ server s2 { } -start varnish v1 -vcl { - import ${vmod_std}; - import ${vmod_debug}; + import std; + import debug; backend dummy { .host = "${bad_ip}"; .port = "9080"; } diff --git a/bin/varnishtest/tests/d00012.vtc b/bin/varnishtest/tests/d00012.vtc index edc028b..aba0aec 100644 --- a/bin/varnishtest/tests/d00012.vtc +++ b/bin/varnishtest/tests/d00012.vtc @@ -10,7 +10,7 @@ server s1 { } -start varnish v1 -arg "-p thread_pools=1" -vcl { - import ${vmod_debug}; + import debug; backend dummy { .host = "${bad_ip}"; .port = "9080"; } @@ -39,7 +39,7 @@ server s2 { } -start varnish v1 -vcl { - import ${vmod_debug}; + import debug; backend dummy { .host = "${bad_ip}"; .port = "9080"; } diff --git a/bin/varnishtest/tests/d00013.vtc b/bin/varnishtest/tests/d00013.vtc index 6762f41..4a397ee 100644 --- a/bin/varnishtest/tests/d00013.vtc +++ b/bin/varnishtest/tests/d00013.vtc @@ -9,8 +9,8 @@ server s2 { } -start varnish v1 -vcl { - import ${vmod_std}; - import ${vmod_debug}; + import std; + import debug; backend dummy { .host = "${bad_ip}"; .port = "9080"; } diff --git a/bin/varnishtest/tests/m00000.vtc b/bin/varnishtest/tests/m00000.vtc index b3ac748..b4d29c8 100644 --- a/bin/varnishtest/tests/m00000.vtc +++ b/bin/varnishtest/tests/m00000.vtc @@ -7,8 +7,8 @@ server s1 { } -start varnish v1 -vcl+backend { - import ${vmod_std}; - import ${vmod_debug}; + import std; + import debug; sub vcl_recv { debug.rot52(req); @@ -37,14 +37,14 @@ client c1 { } -run varnish v1 -errvcl {Wrong enum value. Expected one of:} { - import ${vmod_debug}; + import debug; sub vcl_deliver { set resp.http.who = debug.author(jfk); } } varnish v1 -errvcl {Wrong argument type. Expected REAL. Got STRING.} { - import ${vmod_std}; + import std; sub vcl_deliver { set resp.http.who = std.random("foo", "bar"); } diff --git a/bin/varnishtest/tests/m00001.vtc b/bin/varnishtest/tests/m00001.vtc index 968345a..5f7979f 100644 --- a/bin/varnishtest/tests/m00001.vtc +++ b/bin/varnishtest/tests/m00001.vtc @@ -6,7 +6,7 @@ server s1 { } -start varnish v1 -vcl+backend { - import ${vmod_std}; + import std; sub vcl_deliver { set resp.http.foo = std.toupper(resp.http.foo); @@ -48,12 +48,12 @@ varnish v1 -cliok "vcl.list" varnish v1 -cliok "debug.vmod" varnish v1 -errvcl {Module std already imported.} { - import ${vmod_std}; - import ${vmod_std}; + import std; + import std; } varnish v1 -errvcl {Symbol not found: 'std' (expected type BOOL):} { - import ${vmod_std}; + import std; sub vcl_recv { if (std == 2) { diff --git a/bin/varnishtest/tests/m00002.vtc b/bin/varnishtest/tests/m00002.vtc index bb5626d..9223f0d 100644 --- a/bin/varnishtest/tests/m00002.vtc +++ b/bin/varnishtest/tests/m00002.vtc @@ -9,7 +9,7 @@ server s1 { } -start varnish v1 -vcl+backend { - import ${vmod_std}; + import std; sub vcl_deliver { set resp.http.rnd1 = std.random(0, 1); diff --git a/bin/varnishtest/tests/m00004.vtc b/bin/varnishtest/tests/m00004.vtc index 9e1d047..bb3ba56 100644 --- a/bin/varnishtest/tests/m00004.vtc +++ b/bin/varnishtest/tests/m00004.vtc @@ -14,7 +14,7 @@ server s1 { } -start varnish v1 -vcl+backend { - import ${vmod_std}; + import std; sub vcl_deliver { if (req.url == "/one") { @@ -51,7 +51,7 @@ client c1 { } -run varnish v1 -vcl+backend { - import ${vmod_std}; + import std; sub vcl_deliver { if (req.url == "/one") { diff --git a/bin/varnishtest/tests/m00005.vtc b/bin/varnishtest/tests/m00005.vtc index d89396c..fecbe3f 100644 --- a/bin/varnishtest/tests/m00005.vtc +++ b/bin/varnishtest/tests/m00005.vtc @@ -6,7 +6,7 @@ server s1 { } -start varnish v1 -vcl+backend { - import ${vmod_std}; + import std; sub vcl_deliver { set resp.http.ttl = std.duration(req.http.ttl, 1s) + 1000000s; diff --git a/bin/varnishtest/tests/m00006.vtc b/bin/varnishtest/tests/m00006.vtc index d002112..2afad24 100644 --- a/bin/varnishtest/tests/m00006.vtc +++ b/bin/varnishtest/tests/m00006.vtc @@ -8,7 +8,7 @@ server s1 { } -start varnish v1 -vcl+backend { - import ${vmod_std}; + import std; sub vcl_recv { std.collect(req.http.foo); diff --git a/bin/varnishtest/tests/m00007.vtc b/bin/varnishtest/tests/m00007.vtc index 9a1fe39..b66fc0b 100644 --- a/bin/varnishtest/tests/m00007.vtc +++ b/bin/varnishtest/tests/m00007.vtc @@ -6,7 +6,7 @@ server s1 { } -start varnish v1 -vcl+backend { - import ${vmod_std}; + import std; sub vcl_deliver { set resp.http.gtzero = (std.integer(req.http.foo, 0) > 0); diff --git a/bin/varnishtest/tests/m00008.vtc b/bin/varnishtest/tests/m00008.vtc index 8e93d58..5912dc5 100644 --- a/bin/varnishtest/tests/m00008.vtc +++ b/bin/varnishtest/tests/m00008.vtc @@ -8,7 +8,7 @@ server s1 { } -start varnish v1 -vcl+backend { - import ${vmod_std}; + import std; } varnish v1 -cliok "param.set vcc_unsafe_path off" diff --git a/bin/varnishtest/tests/m00011.vtc b/bin/varnishtest/tests/m00011.vtc index 45528c9..1c51a07 100644 --- a/bin/varnishtest/tests/m00011.vtc +++ b/bin/varnishtest/tests/m00011.vtc @@ -6,7 +6,7 @@ server s1 { } -start varnish v1 -vcl+backend { - import ${vmod_std}; + import std; sub vcl_deliver { set resp.http.foo0 = std.ip("8.8.8.*", client.ip); diff --git a/bin/varnishtest/tests/m00012.vtc b/bin/varnishtest/tests/m00012.vtc index ef07f90..de3e835 100644 --- a/bin/varnishtest/tests/m00012.vtc +++ b/bin/varnishtest/tests/m00012.vtc @@ -6,7 +6,7 @@ server s1 { } -start varnish v1 -vcl+backend { - import ${vmod_debug}; + import debug; sub vcl_deliver { set resp.http.foo = debug.blob2hex(debug.str2blob("gunk")); @@ -25,7 +25,7 @@ varnish v1 -errvcl {BLOBs can only be used as arguments to VMOD functions.} { backend b1 {.host = "127.0.0.1";} - import ${vmod_debug}; + import debug; sub vcl_deliver { set resp.http.foo = debug.str2blob("gunk"); @@ -36,7 +36,7 @@ varnish v1 -errvcl {Wrong argument type. Expected BLOB. Got STRING.} { backend b1 {.host = "127.0.0.1";} - import ${vmod_debug}; + import debug; sub vcl_deliver { set resp.http.foo = debug.blob2hex("gunk"); diff --git a/bin/varnishtest/tests/m00013.vtc b/bin/varnishtest/tests/m00013.vtc index 6f27c57..e657fb3 100644 --- a/bin/varnishtest/tests/m00013.vtc +++ b/bin/varnishtest/tests/m00013.vtc @@ -6,7 +6,7 @@ server s1 { } -start varnish v1 -vcl+backend { - import ${vmod_std}; + import std; sub vcl_init { # Make sure that this doesn't cause ill effects diff --git a/bin/varnishtest/tests/m00014.vtc b/bin/varnishtest/tests/m00014.vtc index 28c4c79..6d60def 100644 --- a/bin/varnishtest/tests/m00014.vtc +++ b/bin/varnishtest/tests/m00014.vtc @@ -6,7 +6,7 @@ server s1 -repeat 6 { } -start varnish v1 -vcl+backend { - import ${vmod_std}; + import std; sub vcl_deliver { set resp.http.url = std.querysort(req.url); diff --git a/bin/varnishtest/tests/m00015.vtc b/bin/varnishtest/tests/m00015.vtc index a5ec8ba..1845fa7 100644 --- a/bin/varnishtest/tests/m00015.vtc +++ b/bin/varnishtest/tests/m00015.vtc @@ -6,7 +6,7 @@ server s1 { } -start varnish v1 -vcl+backend { - import ${vmod_std}; + import std; sub vcl_deliver { set resp.http.t0 = std.real(req.http.foo, 0.0); diff --git a/bin/varnishtest/tests/m00016.vtc b/bin/varnishtest/tests/m00016.vtc index 261f840..a216085 100644 --- a/bin/varnishtest/tests/m00016.vtc +++ b/bin/varnishtest/tests/m00016.vtc @@ -6,7 +6,7 @@ server s1 { } -start varnish v1 -vcl+backend { - import ${vmod_std}; + import std; sub vcl_deliver { set resp.http.x-foo = std.integer(req.http.foo, 0); diff --git a/bin/varnishtest/tests/m00017.vtc b/bin/varnishtest/tests/m00017.vtc index 5622ec0..8fa38f3 100644 --- a/bin/varnishtest/tests/m00017.vtc +++ b/bin/varnishtest/tests/m00017.vtc @@ -23,7 +23,7 @@ server s1 { } -start varnish v1 -vcl+backend { - import ${vmod_std}; + import std; sub vcl_recv { if (req.url == "/foo") { @@ -46,7 +46,7 @@ client c1 { } -run varnish v1 -vcl+backend { - import ${vmod_std}; + import std; sub vcl_backend_fetch { if (bereq.url == "/baz") { diff --git a/bin/varnishtest/tests/m00018.vtc b/bin/varnishtest/tests/m00018.vtc index 35000ce..33d68f3 100644 --- a/bin/varnishtest/tests/m00018.vtc +++ b/bin/varnishtest/tests/m00018.vtc @@ -6,7 +6,7 @@ server s1 -repeat 2 { } -start varnish v1 -vcl+backend { - import ${vmod_std}; + import std; sub vcl_deliver { set resp.http.sub = std.strstr(req.url, "b"); diff --git a/bin/varnishtest/tests/m00019.vtc b/bin/varnishtest/tests/m00019.vtc index 89ad9b0..b640a44 100644 --- a/bin/varnishtest/tests/m00019.vtc +++ b/bin/varnishtest/tests/m00019.vtc @@ -6,7 +6,7 @@ server s1 { } -start varnish v1 -vcl+backend { - import ${vmod_debug}; + import debug; sub vcl_deliver { set resp.http.foo1 = debug.argtest("1", 2.0, "3"); @@ -33,7 +33,7 @@ client c1 { delay .1 varnish v1 -errvcl {Argument 'one' already used} { - import ${vmod_debug}; + import debug; backend b1 {.host = "127.0.0.1";} sub vcl_deliver { set resp.http.foo5 = debug.argtest("1", one="1"); @@ -41,7 +41,7 @@ varnish v1 -errvcl {Argument 'one' already used} { } varnish v1 -errvcl {Argument 'one' missing} { - import ${vmod_debug}; + import debug; backend b1 {.host = "127.0.0.1";} sub vcl_deliver { set resp.http.foo5 = debug.argtest(two=2.0, three="3"); @@ -49,7 +49,7 @@ varnish v1 -errvcl {Argument 'one' missing} { } varnish v1 -errvcl {Unknown argument 'four'} { - import ${vmod_debug}; + import debug; backend b1 {.host = "127.0.0.1";} sub vcl_deliver { set resp.http.foo5 = debug.argtest("1", two=2.0, four="3"); diff --git a/bin/varnishtest/tests/m00020.vtc b/bin/varnishtest/tests/m00020.vtc index 4d76b40..8fe5c83 100644 --- a/bin/varnishtest/tests/m00020.vtc +++ b/bin/varnishtest/tests/m00020.vtc @@ -6,7 +6,7 @@ server s1 { } -start varnish v1 -vcl+backend { - import ${vmod_std}; + import std; sub vcl_deliver { set resp.http.x-date = std.time( diff --git a/bin/varnishtest/tests/m00021.vtc b/bin/varnishtest/tests/m00021.vtc index 87f6834..007728a 100644 --- a/bin/varnishtest/tests/m00021.vtc +++ b/bin/varnishtest/tests/m00021.vtc @@ -17,7 +17,7 @@ logexpect l1 -v v1 -g raw { } -start varnish v1 -vcl+backend { - import ${vmod_debug}; + import debug; sub vcl_init { debug.register_obj_events(); diff --git a/bin/varnishtest/tests/m00022.vtc b/bin/varnishtest/tests/m00022.vtc index 29da34e..8b3a249 100644 --- a/bin/varnishtest/tests/m00022.vtc +++ b/bin/varnishtest/tests/m00022.vtc @@ -9,7 +9,7 @@ varnish v1 -vcl+backend { } -start varnish v1 -errvcl "Planned failure in vcl_init" { - import ${vmod_debug}; + import debug; backend default { .host = "${s1_addr}"; @@ -24,7 +24,7 @@ varnish v1 -cliok "param.set nuke_limit 42" varnish v1 -errvcl "nuke_limit is not the answer." { - import ${vmod_debug}; + import debug; backend default { .host = "${s1_addr}"; diff --git a/bin/varnishtest/tests/o00000.vtc b/bin/varnishtest/tests/o00000.vtc index ccfaa65..1bf1e1d 100644 --- a/bin/varnishtest/tests/o00000.vtc +++ b/bin/varnishtest/tests/o00000.vtc @@ -15,7 +15,7 @@ server s1 { } -start varnish v1 -proto "PROXY" -vcl+backend { - import ${vmod_std}; + import std; sub vcl_deliver { set resp.http.url = req.url; diff --git a/bin/varnishtest/tests/o00001.vtc b/bin/varnishtest/tests/o00001.vtc index ecf025a..c906963 100644 --- a/bin/varnishtest/tests/o00001.vtc +++ b/bin/varnishtest/tests/o00001.vtc @@ -15,7 +15,7 @@ server s1 { } -start varnish v1 -proto "PROXY" -vcl+backend { - import ${vmod_std}; + import std; acl fwd_client { "1.2.3.4"; diff --git a/bin/varnishtest/tests/r00263.vtc b/bin/varnishtest/tests/r00263.vtc index c9036d5..5b75b6f 100644 --- a/bin/varnishtest/tests/r00263.vtc +++ b/bin/varnishtest/tests/r00263.vtc @@ -3,7 +3,7 @@ varnishtest "Test refcounting backends from director" # XXX: This test is probably not relevant with VMOD.directors varnish v1 -vcl { - import ${vmod_directors}; + import directors; backend node1 { .host = "10.0.0.1"; .port = "80"; } backend node2 { .host = "10.0.0.2"; .port = "80"; } diff --git a/bin/varnishtest/tests/r00306.vtc b/bin/varnishtest/tests/r00306.vtc index 0d4c465..bbed997 100644 --- a/bin/varnishtest/tests/r00306.vtc +++ b/bin/varnishtest/tests/r00306.vtc @@ -19,7 +19,7 @@ server s2 { varnish v1 -vcl { - import ${vmod_directors}; + import directors; backend s1 { .host = "${s1_addr}"; .port = "${s1_port}"; diff --git a/bin/varnishtest/tests/r00722.vtc b/bin/varnishtest/tests/r00722.vtc index 739b8f0..b6a6ff7 100644 --- a/bin/varnishtest/tests/r00722.vtc +++ b/bin/varnishtest/tests/r00722.vtc @@ -6,7 +6,7 @@ server s1 { } -start varnish v1 -vcl+backend { - import ${vmod_directors}; + import directors; backend b2 { .host = "${s1_addr}"; .port = "${s1_port}"; diff --git a/bin/varnishtest/tests/r00878.vtc b/bin/varnishtest/tests/r00878.vtc index 5725393..c6bc015 100644 --- a/bin/varnishtest/tests/r00878.vtc +++ b/bin/varnishtest/tests/r00878.vtc @@ -6,7 +6,7 @@ server s1 { } -start varnish v1 -vcl+backend { - import ${vmod_debug}; + import debug; sub vcl_deliver { set resp.http.who = debug.author(phk); } @@ -18,7 +18,7 @@ client c1 { rxresp } -run varnish v1 -vcl+backend { - import ${vmod_debug}; + import debug; sub vcl_deliver { set resp.http.who = debug.author(des); } @@ -30,7 +30,7 @@ client c1 { } -run varnish v1 -vcl+backend { - import ${vmod_debug}; + import debug; sub vcl_deliver { set resp.http.who = debug.author(kristian); } diff --git a/bin/varnishtest/tests/r01002.vtc b/bin/varnishtest/tests/r01002.vtc index 6e9e3fd..d9bfb52 100644 --- a/bin/varnishtest/tests/r01002.vtc +++ b/bin/varnishtest/tests/r01002.vtc @@ -1,7 +1,7 @@ varnishtest "Real relational comparisons" varnish v1 -vcl { - import ${vmod_std}; + import std; backend foo { .host = "${bad_ip}"; .port = "9080"; } sub vcl_recv { diff --git a/bin/varnishtest/tests/r01145.vtc b/bin/varnishtest/tests/r01145.vtc index cb26a2f..ee33bb0 100644 --- a/bin/varnishtest/tests/r01145.vtc +++ b/bin/varnishtest/tests/r01145.vtc @@ -15,7 +15,7 @@ server s1 { varnish v1 -vcl+backend { - import ${vmod_std}; + import std; sub vcl_deliver { set resp.http.foo = std.fileread("${tmpdir}" + req.url); diff --git a/bin/varnishtest/tests/r01212.vtc b/bin/varnishtest/tests/r01212.vtc index a1e91ee..0fc2634 100644 --- a/bin/varnishtest/tests/r01212.vtc +++ b/bin/varnishtest/tests/r01212.vtc @@ -1,7 +1,7 @@ varnishtest "#1212 - Vmod with HEADER argument given a STRING asserts the VCL compiler" varnish v1 -errvcl {Wrong argument type. Expected HEADER. Got STRING.} { - import ${vmod_std}; + import std; backend b { .host = "127.0.0.1"; } sub vcl_recv { std.collect("foo"); diff --git a/bin/varnishtest/tests/r01312.vtc b/bin/varnishtest/tests/r01312.vtc index c39dadc..762da43 100644 --- a/bin/varnishtest/tests/r01312.vtc +++ b/bin/varnishtest/tests/r01312.vtc @@ -6,7 +6,7 @@ server s1 { } -start varnish v1 -vcl+backend { - import ${vmod_std}; + import std; acl foo { "127.0.0.2"; diff --git a/bin/varnishtest/tests/r01332.vtc b/bin/varnishtest/tests/r01332.vtc index 518c558..43ca406 100644 --- a/bin/varnishtest/tests/r01332.vtc +++ b/bin/varnishtest/tests/r01332.vtc @@ -6,7 +6,7 @@ server s1 { } -start varnish v1 -vcl+backend { - import ${vmod_debug}; + import debug; sub vcl_init { new obj = debug.obj("don't care"); diff --git a/bin/varnishtest/tests/r01406.vtc b/bin/varnishtest/tests/r01406.vtc index 491f9e9..ee4e5e4 100644 --- a/bin/varnishtest/tests/r01406.vtc +++ b/bin/varnishtest/tests/r01406.vtc @@ -6,7 +6,7 @@ server s1 { } -start varnish v1 -arg "-p vcc_allow_inline_c=true" -vcl+backend { - import ${vmod_std} ; + import std ; C{ static const struct gethdr_s VGC_HDR_REQ_foo = diff --git a/bin/varnishtest/tests/r01498.vtc b/bin/varnishtest/tests/r01498.vtc index d321448..0c81af5 100644 --- a/bin/varnishtest/tests/r01498.vtc +++ b/bin/varnishtest/tests/r01498.vtc @@ -2,7 +2,7 @@ varnishtest "backend name VCC crash" varnish v1 -vcl { vcl 4.0; - import ${vmod_directors}; + import directors; backend s1 { .host = "127.0.0.1"; .port = "80"; diff --git a/bin/varnishtest/tests/r01501.vtc b/bin/varnishtest/tests/r01501.vtc index c7ce3b8..38f220c 100644 --- a/bin/varnishtest/tests/r01501.vtc +++ b/bin/varnishtest/tests/r01501.vtc @@ -7,7 +7,7 @@ server s1 { varnish v1 -vcl+backend { - import ${vmod_debug}; + import debug; sub vcl_recv { set req.backend_hint = debug.no_backend(); diff --git a/bin/varnishtest/tests/r01510.vtc b/bin/varnishtest/tests/r01510.vtc index 6b74f54..9597240 100644 --- a/bin/varnishtest/tests/r01510.vtc +++ b/bin/varnishtest/tests/r01510.vtc @@ -1,7 +1,7 @@ varnishtest "Duplicate object names" varnish v1 -errvcl {Object name 'first' already used.} { - import ${vmod_debug}; + import debug; sub vcl_init { new first = debug.obj("FOO"); new first = debug.obj("BAH"); @@ -9,7 +9,7 @@ varnish v1 -errvcl {Object name 'first' already used.} { } varnish v1 -errvcl {Object name 'first' already used.} { - import ${vmod_debug}; + import debug; backend first { .host = "${bad_ip}"; .port = "9080"; } diff --git a/bin/varnishtest/tests/r01532.vtc b/bin/varnishtest/tests/r01532.vtc index b1ff007..271e51e 100644 --- a/bin/varnishtest/tests/r01532.vtc +++ b/bin/varnishtest/tests/r01532.vtc @@ -6,7 +6,7 @@ server s1 { } -start varnish v1 -vcl+backend { - import ${vmod_std}; + import std; sub vcl_deliver { set resp.http.x-foo = std.real2time(1140618699.00, now); diff --git a/bin/varnishtest/tests/r01569.vtc b/bin/varnishtest/tests/r01569.vtc index 7a05938..af3c489 100644 --- a/bin/varnishtest/tests/r01569.vtc +++ b/bin/varnishtest/tests/r01569.vtc @@ -2,7 +2,7 @@ varnishtest "symbol lookup order issue" varnish v1 -vcl { vcl 4.0; - import ${vmod_debug}; + import debug; backend debug { .host = "127.0.0.1"; diff --git a/bin/varnishtest/tests/r01575.vtc b/bin/varnishtest/tests/r01575.vtc index 11c82c1..c74fad5 100644 --- a/bin/varnishtest/tests/r01575.vtc +++ b/bin/varnishtest/tests/r01575.vtc @@ -29,7 +29,7 @@ server s5 { } -start varnish v1 -vcl+backend { - import ${vmod_directors}; + import directors; sub vcl_init { new rd = directors.random(); rd.add_backend(s1, 10000); diff --git a/bin/varnishtest/tests/r01613.vtc b/bin/varnishtest/tests/r01613.vtc index 62c7213..4fca7c4 100644 --- a/bin/varnishtest/tests/r01613.vtc +++ b/bin/varnishtest/tests/r01613.vtc @@ -12,7 +12,7 @@ varnish v2 -vcl+backend { } -start varnish v1 -vcl { - import ${vmod_std}; + import std; backend b { .host = "${v2_addr}"; diff --git a/bin/varnishtest/tests/r01644.vtc b/bin/varnishtest/tests/r01644.vtc index 90728a0..a6e4fbf 100644 --- a/bin/varnishtest/tests/r01644.vtc +++ b/bin/varnishtest/tests/r01644.vtc @@ -8,7 +8,7 @@ server s1 { varnish v1 -vcl+backend { - import ${vmod_debug}; + import debug; sub vcl_deliver { set resp.http.foo = debug.vre_limit(); diff --git a/bin/varnishtest/tests/r01739.vtc b/bin/varnishtest/tests/r01739.vtc index 21398cc..dbbd04d 100644 --- a/bin/varnishtest/tests/r01739.vtc +++ b/bin/varnishtest/tests/r01739.vtc @@ -8,7 +8,7 @@ server s1 { varnish v1 \ -vcl+backend { - import ${vmod_debug}; + import debug; sub vcl_backend_response { set beresp.do_gzip = true; debug.workspace_allocate(backend, debug.workspace_free(backend) - 16); diff --git a/bin/varnishtest/tests/r01801.vtc b/bin/varnishtest/tests/r01801.vtc index 7052ead..b0ef516 100644 --- a/bin/varnishtest/tests/r01801.vtc +++ b/bin/varnishtest/tests/r01801.vtc @@ -6,7 +6,7 @@ server s1 { } -start varnish v1 -vcl+backend { - import ${vmod_std}; + import std; sub vcl_deliver { set resp.http.foo1 = std.ip("..", "1.2.3.4"); @@ -42,7 +42,7 @@ client c1 { } -run varnish v1 -errvcl "could not be resolved to an IP address" { - import ${vmod_std}; + import std; sub vcl_deliver { set resp.http.foo = std.ip("..", "::1::2"); @@ -50,7 +50,7 @@ varnish v1 -errvcl "could not be resolved to an IP address" { } varnish v1 -errvcl "could not be resolved to an IP address" { - import ${vmod_std}; + import std; sub vcl_deliver { set resp.http.foo = std.ip("..", "1.2.3.4::80"); diff --git a/bin/varnishtest/tests/v00010.vtc b/bin/varnishtest/tests/v00010.vtc index 7b0d57e..7dd839c 100644 --- a/bin/varnishtest/tests/v00010.vtc +++ b/bin/varnishtest/tests/v00010.vtc @@ -23,7 +23,7 @@ server s1 { varnish v1 -arg "-smalloc,1m" -vcl+backend { - import ${vmod_debug}; + import debug; sub vcl_backend_response { if (beresp.http.panic == "fetch") { diff --git a/bin/varnishtest/tests/v00014.vtc b/bin/varnishtest/tests/v00014.vtc index 4a290b0..78b0288 100644 --- a/bin/varnishtest/tests/v00014.vtc +++ b/bin/varnishtest/tests/v00014.vtc @@ -17,7 +17,7 @@ server s1 { varnish v1 -vcl { - import ${vmod_std}; + import std; probe foo { .url = "/"; diff --git a/bin/varnishtest/tests/v00025.vtc b/bin/varnishtest/tests/v00025.vtc index 02788d4..44426ad 100644 --- a/bin/varnishtest/tests/v00025.vtc +++ b/bin/varnishtest/tests/v00025.vtc @@ -7,7 +7,7 @@ server s1 { varnish v1 -arg "-i J.F.Nobody" -vcl+backend { - import ${vmod_std}; + import std; sub vcl_recv { set client.identity = "Samuel B. Nobody"; diff --git a/bin/varnishtest/tests/v00041.vtc b/bin/varnishtest/tests/v00041.vtc index 9604eb2..b5c053c 100644 --- a/bin/varnishtest/tests/v00041.vtc +++ b/bin/varnishtest/tests/v00041.vtc @@ -8,8 +8,8 @@ server s1 { } -start varnish v1 -vcl+backend { - import ${vmod_debug}; - import ${vmod_std}; + import debug; + import std; sub vcl_recv { set req.http.x0 = debug.test_priv_task(req.url); diff --git a/bin/varnishtest/tests/v00042.vtc b/bin/varnishtest/tests/v00042.vtc index 1640f56..6b7ed9c 100644 --- a/bin/varnishtest/tests/v00042.vtc +++ b/bin/varnishtest/tests/v00042.vtc @@ -34,7 +34,7 @@ server s1 { } -start varnish v1 -vcl+backend { - import ${vmod_debug}; + import debug; sub vcl_recv { set req.http.x0 = debug.test_priv_task(req.url + req.esi_level); diff --git a/bin/varnishtest/tests/v00043.vtc b/bin/varnishtest/tests/v00043.vtc index ae562a7..9bf7b47 100644 --- a/bin/varnishtest/tests/v00043.vtc +++ b/bin/varnishtest/tests/v00043.vtc @@ -36,7 +36,7 @@ server s1 { } -start varnish v1 -cliok "param.set debug +syncvsl" -vcl+backend { - import ${vmod_debug}; + import debug; sub vcl_recv { set req.http.x0 = debug.test_priv_top(req.url + req.esi_level); diff --git a/bin/varnishtest/tests/v00044.vtc b/bin/varnishtest/tests/v00044.vtc index c056d6c..d09501b 100644 --- a/bin/varnishtest/tests/v00044.vtc +++ b/bin/varnishtest/tests/v00044.vtc @@ -9,7 +9,7 @@ server s1 -repeat 20 { # The debug vmod logs temperature vcl events varnish v1 -arg "-p vcl_cooldown=1" -vcl { - import ${vmod_debug}; + import debug; backend default { .host = "${s1_addr}"; .probe = { .interval = 1s; .initial = 1;} diff --git a/bin/varnishtest/tests/v00045.vtc b/bin/varnishtest/tests/v00045.vtc index dc57c74..fe23158 100644 --- a/bin/varnishtest/tests/v00045.vtc +++ b/bin/varnishtest/tests/v00045.vtc @@ -4,7 +4,7 @@ server s1 -start # Load and use a VCL that will hold a reference varnish v1 -vcl+backend { - import ${vmod_debug}; + import debug; sub vcl_init { debug.vcl_release_delay(3s); } diff --git a/bin/varnishtest/vtc_main.c b/bin/varnishtest/vtc_main.c index 03ced80..ecca005 100644 --- a/bin/varnishtest/vtc_main.c +++ b/bin/varnishtest/vtc_main.c @@ -386,7 +386,6 @@ i_mode(void) VSB_printf(vsb, "%s%s/lib/libvmod_" #l "/.libs", \ sep, topbuild); \ sep = ":"; \ - extmacro_def("vmod_" #l, #l); \ } while (0); #include "vmods.h" #undef VTC_VMOD @@ -478,11 +477,6 @@ main(int argc, char * const *argv) char *p; uintmax_t bufsiz; - /* Default import spec of vmods */ -#define VTC_VMOD(l) extmacro_def("vmod_" #l, #l); -#include "vmods.h" -#undef VTC_VMOD - if (getenv("TMPDIR") != NULL) tmppath = strdup(getenv("TMPDIR")); else -- 2.5.0
From 7a6ebe7608483e386edef0559b20f96e79987942 Mon Sep 17 00:00:00 2001 From: Dridi Boukelmoune <dridi.boukelmo...@gmail.com> Date: Sun, 21 Feb 2016 20:28:53 +0100 Subject: [PATCH 4/5] Polish --- bin/varnishtest/vtc_main.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/bin/varnishtest/vtc_main.c b/bin/varnishtest/vtc_main.c index ecca005..0f00a80 100644 --- a/bin/varnishtest/vtc_main.c +++ b/bin/varnishtest/vtc_main.c @@ -324,6 +324,7 @@ i_mode(void) */ vsb = VSB_new_auto(); + AN(vsb); q = p = VFIL_readfile(NULL, "Makefile", NULL); if (p == NULL) { @@ -361,12 +362,11 @@ i_mode(void) /* * Build $PATH which can find all programs in the build tree */ - AN(vsb); VSB_printf(vsb, "PATH="); sep = ""; #define VTC_PROG(l) \ do { \ - VSB_printf(vsb, "%s%s/bin/%s/", sep, topbuild, #l); \ + VSB_printf(vsb, "%s%s/bin/" #l, sep, topbuild); \ sep = ":"; \ } while (0); #include "programs.h" -- 2.5.0
From d6fc538feb2c85f0551c043c7407c3b264b24bdf Mon Sep 17 00:00:00 2001 From: Dridi Boukelmoune <dridi.boukelmo...@gmail.com> Date: Sun, 21 Feb 2016 21:22:53 +0100 Subject: [PATCH 5/5] Pass varnishd parameters through varnishtest Parameters are not checked and passed as is to varnishd command lines. The parameters are prepended at the beginning of the command line to preserve parameters needed by varnishtest or used in test cases. --- bin/varnishtest/vtc_main.c | 17 ++++++++++++++++- bin/varnishtest/vtc_varnish.c | 2 ++ doc/sphinx/reference/varnishtest.rst | 2 ++ 3 files changed, 20 insertions(+), 1 deletion(-) diff --git a/bin/varnishtest/vtc_main.c b/bin/varnishtest/vtc_main.c index 0f00a80..0dc2df4 100644 --- a/bin/varnishtest/vtc_main.c +++ b/bin/varnishtest/vtc_main.c @@ -95,6 +95,7 @@ static int vtc_fail; static char *tmppath; static char *cwd = NULL; char *vmod_path = NULL; +struct vsb *params_vsb = NULL; int leave_temp; int vtc_witness = 0; int feature_dns; @@ -137,6 +138,7 @@ usage(void) fprintf(stderr, FMT, "-L", "Always leave temporary vtc.*"); fprintf(stderr, FMT, "-l", "Leave temporary vtc.* if test fails"); fprintf(stderr, FMT, "-n iterations", "Run tests this many times"); + fprintf(stderr, FMT, "-p name=val", "Pass a varnishd parameter"); fprintf(stderr, FMT, "-q", "Quiet mode: report only failures"); fprintf(stderr, FMT, "-t duration", "Time tests out after this long"); fprintf(stderr, FMT, "-v", "Verbose mode: always report test log"); @@ -487,9 +489,12 @@ main(int argc, char * const *argv) vmod_path = NULL; + params_vsb = VSB_new_auto(); + AN(params_vsb); + setbuf(stdout, NULL); setbuf(stderr, NULL); - while ((ch = getopt(argc, argv, "b:D:hij:kLln:qt:vW")) != -1) { + while ((ch = getopt(argc, argv, "b:D:hij:kLln:p:qt:vW")) != -1) { switch (ch) { case 'b': if (VNUM_2bytes(optarg, &bufsiz, 0)) { @@ -529,6 +534,14 @@ main(int argc, char * const *argv) case 'n': ntest = strtoul(optarg, NULL, 0); break; + case 'p': + /* poor man's command line sanitizing */ + if (strchr(optarg, '\'')) { + fprintf(stderr, "varnishd parameters cannot " + "contain single quotes\n"); + } + VSB_printf(params_vsb, " -p '%s'", optarg); + break; case 'q': if (vtc_verbosity > 0) vtc_verbosity--; @@ -567,6 +580,8 @@ main(int argc, char * const *argv) VTAILQ_INSERT_TAIL(&tst_head, tp, list); } + VSB_finish(params_vsb); + feature_dns = dns_works(); ip_magic(); diff --git a/bin/varnishtest/vtc_varnish.c b/bin/varnishtest/vtc_varnish.c index 1757722..8df63ea 100644 --- a/bin/varnishtest/vtc_varnish.c +++ b/bin/varnishtest/vtc_varnish.c @@ -55,6 +55,7 @@ extern int leave_temp; extern char *vmod_path; +extern struct vsb *params_vsb; struct varnish { unsigned magic; @@ -405,6 +406,7 @@ varnish_launch(struct varnish *v) VSB_printf(vsb, "cd ${pwd} &&"); VSB_printf(vsb, " exec varnishd %s -d -n %s", v->jail, v->workdir); + VSB_printf(vsb, VSB_data(params_vsb)); if (vtc_witness) VSB_cat(vsb, " -p debug=+witness"); if (leave_temp) diff --git a/doc/sphinx/reference/varnishtest.rst b/doc/sphinx/reference/varnishtest.rst index d689929..ba8708d 100644 --- a/doc/sphinx/reference/varnishtest.rst +++ b/doc/sphinx/reference/varnishtest.rst @@ -48,6 +48,8 @@ The following options are available: -n iterations Run tests this many times +-p name=val Pass parameters to all varnishd command lines + -q Quiet mode: report only failures -t duration Time tests out after this long -- 2.5.0
_______________________________________________ varnish-dev mailing list varnish-dev@varnish-cache.org https://www.varnish-cache.org/lists/mailman/listinfo/varnish-dev