summaryrefslogtreecommitdiffabout
authorSergey Poznyakoff <gray@gnu.org.ua>2017-08-10 08:40:17 (GMT)
committer Sergey Poznyakoff <gray@gnu.org.ua>2017-08-10 08:40:17 (GMT)
commit01290b38b814d23a2e6fc8cb5a2d53582c51e308 (patch) (side-by-side diff)
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.
Diffstat (more/less context) (ignore whitespace changes)
-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:
- ~VARNISH_PATCH~ :: Patchlevel number of the varnish API version.
- ~VARNISHD~ :: Full pathname of the varnishd binary.
- ~VARNISHTEST~ :: Full pathname of the varnishtest binary.
+- ~VARNISH_BINDIR~ :: Varnish installation bin directory
+- ~VARNISH_SBINDIR~ :: Varnish installation sbin directory
- ~VARNISHAPI_PKGDATADIR~ :: Varnish API package data directory.
- ~VARNISHAPI_VMODTOOL~ :: Absolute pathname of the vmodtool.py script.
@@ -228,12 +230,11 @@ which we recommend for writing the tests.
The syntax is:
#+BEGIN_SRC autotest
-AT_VARNISHTEST($MODULE, $VCL, $CLT [, $SRV])
+AT_VARNISHTEST($VCL, $CLT [, $SRV])
#+END_SRC
The arguments are:
-- ~$MODULE~ :: Name of the module.
- ~$VCL~ :: The VLC script. It needs not import the module itself.
- ~$CLT~ :: The program to use in the =client= part of the
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])
m4_define([AT_SKIP_TEST],[exit 77])
-dnl AT_VARNISHTEST(MODULE, VCL, CLT[, SRV])
+dnl AT_VARNISHTEST(VCL, CLT[, SRV])
m4_define([AT_VARNISHTEST],[
AT_CHECK([
cat > test.vtc <<EOT
+varnishtest "$at_desc"
server s1 {
-m4_if($4,,[dnl
+m4_if($3,,[dnl
rxreq
- txresp],[$4])
+ txresp],[$3])
} -start
varnish v1 -vcl+backend {
import std;
- import $1 from "$abs_top_builddir/src/.libs/libvmod_$1.so";
-$2
+ import AT_VMOD_BASENAME from "[$abs_top_builddir/src/.libs/libvmod_]AT_VMOD_BASENAME[.so]";
+$1
} -start
client c1 {
-$3
+$2
} -run
EOT
$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
echo 'm4_define([AT_PACKAGE_VERSION], [@PACKAGE_VERSION@])'; \
echo 'm4_define([AT_PACKAGE_STRING], [@PACKAGE_STRING@])'; \
echo 'm4_define([AT_PACKAGE_BUGREPORT], [@PACKAGE_BUGREPORT@])'; \
+ echo 'm4_define([AT_VMOD_BASENAME], [@AC_VMOD_BASENAME@])'; \
} >$(srcdir)/package.m4
#
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 @@
# Configurable variable values for vmod_%{MODULE} test suite.
# Copyright (C) %{YEAR} %{REALNAME}
-PATH=@abs_builddir@:@abs_top_builddir@/src:@abs_top_srcdir@/build-aux:$top_srcdir:$srcdir:$PATH
+PATH=@abs_builddir@:@abs_top_builddir@/src:@abs_top_srcdir@/build-aux:$top_srcdir:$srcdir:@VARNISH_SBINDIR@:$PATH
VARNISHTEST=@VARNISHTEST@
VARNISHD=@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])],
VMODDIR='$(libdir)/varnish/mods'
fi
+ AC_ARG_VAR([VARNISH_BINDIR],[Varnish bin directory])
+ VARNISH_BINDIR=$($PKG_CONFIG --variable=bindir varnishapi)
+
+ AC_ARG_VAR([VARNISH_SBINDIR],[Varnish sbin directory])
+ VARNISH_SBINDIR=$($PKG_CONFIG --variable=sbindir varnishapi)
+
AC_ARG_VAR([VARNISHD],[full pathname of the varnishd binary])
AC_PATH_PROG([VARNISHD],
[varnishd],[\$(abs_top_srcdir)/build-aux/missing varnishd],
- [$($PKG_CONFIG --variable=sbindir varnishapi):$PATH])
+ [$VARNISH_SBINDIR:$PATH])
AC_ARG_VAR([VARNISHTEST],[full pathname of the varnishtest binary])
AC_PATH_PROG([VARNISHTEST],
[varnishtest],[\$(abs_top_srcdir)/build-aux/missing varnishtest],
- [$($PKG_CONFIG --variable=bindir varnishapi):$PATH])
+ [$VARNISH_BINDIR:$PATH])
AC_ARG_VAR([VARNISHAPI_PKGDATADIR],[full pathname of the varnish lib directory])
VARNISHAPI_PKGDATADIR=$($PKG_CONFIG --variable=pkgdatadir varnishapi)

Return to:

Send suggestions and report system problems to the System administrator.