Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
L
libvmod-example
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Commits
Open sidebar
varnishcache
libvmod-example
Commits
3a0b1608
Commit
3a0b1608
authored
May 13, 2011
by
Martin Blix Grydeland
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Allow testing of vmods
parent
6951f18a
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
41 additions
and
3 deletions
+41
-3
configure.ac
configure.ac
+7
-1
Makefile.am
src/Makefile.am
+12
-2
test01.vtc
src/tests/test01.vtc
+22
-0
No files found.
configure.ac
View file @
3a0b1608
AC_PREREQ(2.59)
AC_COPYRIGHT([Copyright (c) 2011 Varnish Software AS])
AC_INIT([libvmod-example], [
0.1
])
AC_INIT([libvmod-example], [
trunk
])
AC_CONFIG_MACRO_DIR([m4])
AC_CONFIG_SRCDIR(src/vmod_example.vcc)
AM_CONFIG_HEADER(config.h)
...
...
@@ -43,6 +43,12 @@ AC_CHECK_FILE([$VARNISHSRC/include/varnishapi.h],
[AC_MSG_FAILURE(["$VARNISHSRC" is not a Varnish source directory])]
)
# Check that varnishtest is built in the varnish source directory
AC_CHECK_FILE([$VARNISHSRC/bin/varnishtest/varnishtest],
[],
[AC_MSG_FAILURE([Can't find "$VARNISHSRC/bin/varnishtest/varnishtest". Please build your varnish source directory])]
)
# vmod installation dir
AC_ARG_VAR([VMODDIR], [vmod installation directory @<:@LIBDIR/varnish/vmods@:>@])
if test "x$VMODDIR" = x; then
...
...
src/Makefile.am
View file @
3a0b1608
...
...
@@ -3,7 +3,7 @@ INCLUDES = -I$(VARNISHSRC)/include -I$(VARNISHSRC)
vmoddir
=
$(VMODDIR)
vmod_LTLIBRARIES
=
libvmod_example.la
libvmod_example_la_LDFLAGS
=
-
version-info
1:0:0
libvmod_example_la_LDFLAGS
=
-
avoid-version
libvmod_example_la_SOURCES
=
\
vcc_if.c
\
...
...
@@ -13,6 +13,16 @@ libvmod_example_la_SOURCES = \
vcc_if.c vcc_if.h
:
$(VARNISHSRC)/lib/libvmod_std/vmod.py $(top_srcdir)/src/vmod_example.vcc
@
PYTHON@
$(VARNISHSRC)
/lib/libvmod_std/vmod.py
$(top_srcdir)
/src/vmod_example.vcc
EXTRA_DIST
=
vmod_example.vcc
MYTESTS
=
tests/
*
.vtc
.PHONY
:
$(MYTESTS)
tests/*.vtc
:
cd
$(VARNISHSRC)
/bin/varnishtest
&&
./varnishtest
-D
vmod_topbuild
=
$(abs_top_builddir)
$(abs_srcdir)
/
$@
check
:
$(MYTESTS)
EXTRA_DIST
=
\
$(MYTESTS)
\
vmod_example.vcc
CLEANFILES
=
$(builddir)
/vcc_if.c
$(builddir)
/vcc_if.h
src/tests/test01.vtc
0 → 100644
View file @
3a0b1608
varnishtest "Test example vmod"
server s1 {
rxreq
txresp
} -start
varnish v1 -vcl+backend {
import example from "${vmod_topbuild}/src/.libs/libvmod_example.so";
sub vcl_deliver {
set resp.http.val = example.abs(2-3);
}
} -start
client c1 {
txreq -url "/"
rxresp
expect resp.http.val == "1"
}
client c1 -run
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment