aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSergey Poznyakoff <gray@gnu.org.ua>2017-08-10 11:40:17 +0300
committerSergey Poznyakoff <gray@gnu.org.ua>2017-08-10 11:40:17 +0300
commit01290b38b814d23a2e6fc8cb5a2d53582c51e308 (patch)
treed07feb14498770d0fa6a8c255ee55b9a8cfebee9
parent754af24200ceda805c66994151ad1eba2dfb2619 (diff)
downloadacvmod-01290b38b814d23a2e6fc8cb5a2d53582c51e308.tar.gz
acvmod-01290b38b814d23a2e6fc8cb5a2d53582c51e308.tar.bz2
Fix produced testsuite to run correctly with varnish 5.1
* README: Document changes to AM_VARNISHAPI and AT_VARNISHTEST * testsuite.inc (AT_VARNISHTEST): Remove MODULE argument, use AT_VMOD_BASENAME instead. Start vtc script with varnishtest stanza. * tmpl/tests/Makefile.am: Define AT_VMOD_BASENAME in package.m4 * tmpl/tests/atlocal.in: Add @VARNISH_SBINDIR@ to PATH. In varnish 5.1 varnishtest no longer uses ${varnishd} to exec the daemon. Instead it relies on system PATH * varnishapi.m4 (VARNISH_BINDIR,VARNISH_SBINDIR): New subst variables.
-rw-r--r--README5
-rw-r--r--testsuite.inc13
-rw-r--r--tmpl/tests/Makefile.am1
-rw-r--r--tmpl/tests/atlocal.in2
-rw-r--r--varnishapi.m410
5 files changed, 20 insertions, 11 deletions
diff --git a/README b/README
index 9762ba4..3299d76 100644
--- a/README
+++ b/README
@@ -184,6 +184,8 @@ The ~AM_VARNISHAPI~ macro sets the following configuration variables:
184- ~VARNISH_PATCH~ :: Patchlevel number of the varnish API version. 184- ~VARNISH_PATCH~ :: Patchlevel number of the varnish API version.
185- ~VARNISHD~ :: Full pathname of the varnishd binary. 185- ~VARNISHD~ :: Full pathname of the varnishd binary.
186- ~VARNISHTEST~ :: Full pathname of the varnishtest binary. 186- ~VARNISHTEST~ :: Full pathname of the varnishtest binary.
187- ~VARNISH_BINDIR~ :: Varnish installation bin directory
188- ~VARNISH_SBINDIR~ :: Varnish installation sbin directory
187- ~VARNISHAPI_PKGDATADIR~ :: Varnish API package data directory. 189- ~VARNISHAPI_PKGDATADIR~ :: Varnish API package data directory.
188- ~VARNISHAPI_VMODTOOL~ :: Absolute pathname of the vmodtool.py script. 190- ~VARNISHAPI_VMODTOOL~ :: Absolute pathname of the vmodtool.py script.
189 191
@@ -228,12 +230,11 @@ which we recommend for writing the tests.
228The syntax is: 230The syntax is:
229 231
230#+BEGIN_SRC autotest 232#+BEGIN_SRC autotest
231AT_VARNISHTEST($MODULE, $VCL, $CLT [, $SRV]) 233AT_VARNISHTEST($VCL, $CLT [, $SRV])
232#+END_SRC 234#+END_SRC
233 235
234The arguments are: 236The arguments are:
235 237
236- ~$MODULE~ :: Name of the module.
237- ~$VCL~ :: The VLC script. It needs not import the module itself. 238- ~$VCL~ :: The VLC script. It needs not import the module itself.
238- ~$CLT~ :: The program to use in the =client= part of the 239- ~$CLT~ :: The program to use in the =client= part of the
239 generated *vtc* file. 240 generated *vtc* file.
diff --git a/testsuite.inc b/testsuite.inc
index 52795a8..aa5b743 100644
--- a/testsuite.inc
+++ b/testsuite.inc
@@ -2,24 +2,25 @@ m4_version_prereq([2.52g])
2 2
3m4_define([AT_SKIP_TEST],[exit 77]) 3m4_define([AT_SKIP_TEST],[exit 77])
4 4
5dnl AT_VARNISHTEST(MODULE, VCL, CLT[, SRV]) 5dnl AT_VARNISHTEST(VCL, CLT[, SRV])
6m4_define([AT_VARNISHTEST],[ 6m4_define([AT_VARNISHTEST],[
7AT_CHECK([ 7AT_CHECK([
8cat > test.vtc <<EOT 8cat > test.vtc <<EOT
9varnishtest "$at_desc"
9server s1 { 10server s1 {
10m4_if($4,,[dnl 11m4_if($3,,[dnl
11 rxreq 12 rxreq
12 txresp],[$4]) 13 txresp],[$3])
13} -start 14} -start
14 15
15varnish v1 -vcl+backend { 16varnish v1 -vcl+backend {
16 import std; 17 import std;
17 import $1 from "$abs_top_builddir/src/.libs/libvmod_$1.so"; 18 import AT_VMOD_BASENAME from "[$abs_top_builddir/src/.libs/libvmod_]AT_VMOD_BASENAME[.so]";
18$2 19$1
19} -start 20} -start
20 21
21client c1 { 22client c1 {
22$3 23$2
23} -run 24} -run
24EOT 25EOT
25$VARNISHTEST \ 26$VARNISHTEST \
diff --git a/tmpl/tests/Makefile.am b/tmpl/tests/Makefile.am
index e565e54..7d02d61 100644
--- a/tmpl/tests/Makefile.am
+++ b/tmpl/tests/Makefile.am
@@ -19,6 +19,7 @@ $(srcdir)/package.m4: $(top_srcdir)/configure.ac
19 echo 'm4_define([AT_PACKAGE_VERSION], [@PACKAGE_VERSION@])'; \ 19 echo 'm4_define([AT_PACKAGE_VERSION], [@PACKAGE_VERSION@])'; \
20 echo 'm4_define([AT_PACKAGE_STRING], [@PACKAGE_STRING@])'; \ 20 echo 'm4_define([AT_PACKAGE_STRING], [@PACKAGE_STRING@])'; \
21 echo 'm4_define([AT_PACKAGE_BUGREPORT], [@PACKAGE_BUGREPORT@])'; \ 21 echo 'm4_define([AT_PACKAGE_BUGREPORT], [@PACKAGE_BUGREPORT@])'; \
22 echo 'm4_define([AT_VMOD_BASENAME], [@AC_VMOD_BASENAME@])'; \
22 } >$(srcdir)/package.m4 23 } >$(srcdir)/package.m4
23 24
24# 25#
diff --git a/tmpl/tests/atlocal.in b/tmpl/tests/atlocal.in
index f5264c4..b0c7c96 100644
--- a/tmpl/tests/atlocal.in
+++ b/tmpl/tests/atlocal.in
@@ -2,6 +2,6 @@
2# Configurable variable values for vmod_%{MODULE} test suite. 2# Configurable variable values for vmod_%{MODULE} test suite.
3# Copyright (C) %{YEAR} %{REALNAME} 3# Copyright (C) %{YEAR} %{REALNAME}
4 4
5PATH=@abs_builddir@:@abs_top_builddir@/src:@abs_top_srcdir@/build-aux:$top_srcdir:$srcdir:$PATH 5PATH=@abs_builddir@:@abs_top_builddir@/src:@abs_top_srcdir@/build-aux:$top_srcdir:$srcdir:@VARNISH_SBINDIR@:$PATH
6VARNISHTEST=@VARNISHTEST@ 6VARNISHTEST=@VARNISHTEST@
7VARNISHD=@VARNISHD@ 7VARNISHD=@VARNISHD@
diff --git a/varnishapi.m4 b/varnishapi.m4
index b84045f..895b922 100644
--- a/varnishapi.m4
+++ b/varnishapi.m4
@@ -123,14 +123,20 @@ m4_popdef([ver])],
123 VMODDIR='$(libdir)/varnish/mods' 123 VMODDIR='$(libdir)/varnish/mods'
124 fi 124 fi
125 125
126 AC_ARG_VAR([VARNISH_BINDIR],[Varnish bin directory])
127 VARNISH_BINDIR=$($PKG_CONFIG --variable=bindir varnishapi)
128
129 AC_ARG_VAR([VARNISH_SBINDIR],[Varnish sbin directory])
130 VARNISH_SBINDIR=$($PKG_CONFIG --variable=sbindir varnishapi)
131
126 AC_ARG_VAR([VARNISHD],[full pathname of the varnishd binary]) 132 AC_ARG_VAR([VARNISHD],[full pathname of the varnishd binary])
127 AC_PATH_PROG([VARNISHD], 133 AC_PATH_PROG([VARNISHD],
128 [varnishd],[\$(abs_top_srcdir)/build-aux/missing varnishd], 134 [varnishd],[\$(abs_top_srcdir)/build-aux/missing varnishd],
129 [$($PKG_CONFIG --variable=sbindir varnishapi):$PATH]) 135 [$VARNISH_SBINDIR:$PATH])
130 AC_ARG_VAR([VARNISHTEST],[full pathname of the varnishtest binary]) 136 AC_ARG_VAR([VARNISHTEST],[full pathname of the varnishtest binary])
131 AC_PATH_PROG([VARNISHTEST], 137 AC_PATH_PROG([VARNISHTEST],
132 [varnishtest],[\$(abs_top_srcdir)/build-aux/missing varnishtest], 138 [varnishtest],[\$(abs_top_srcdir)/build-aux/missing varnishtest],
133 [$($PKG_CONFIG --variable=bindir varnishapi):$PATH]) 139 [$VARNISH_BINDIR:$PATH])
134 140
135 AC_ARG_VAR([VARNISHAPI_PKGDATADIR],[full pathname of the varnish lib directory]) 141 AC_ARG_VAR([VARNISHAPI_PKGDATADIR],[full pathname of the varnish lib directory])
136 VARNISHAPI_PKGDATADIR=$($PKG_CONFIG --variable=pkgdatadir varnishapi) 142 VARNISHAPI_PKGDATADIR=$($PKG_CONFIG --variable=pkgdatadir varnishapi)

Return to:

Send suggestions and report system problems to the System administrator.