Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
L
libvmod-vtstor
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
uplex-varnish
libvmod-vtstor
Commits
798cba43
Commit
798cba43
authored
Feb 24, 2015
by
Geoff Simmons
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
add function version() and some fundamental tests
parent
a490ef04
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
60 additions
and
1 deletion
+60
-1
a01.vtc
src/tests/a01.vtc
+0
-1
a02.vtc
src/tests/a02.vtc
+29
-0
a03.vtc
src/tests/a03.vtc
+22
-0
vmod_vtstor.c
src/vmod_vtstor.c
+7
-0
vmod_vtstor.vcc
src/vmod_vtstor.vcc
+2
-0
No files found.
src/tests/a01.vtc
View file @
798cba43
...
...
@@ -17,4 +17,3 @@ client c1 {
expect resp.status == 200
expect resp.http.foo == 1
} -run
src/tests/a02.vtc
0 → 100644
View file @
798cba43
# Somewhat oversimplified, but at least it ensures that SOMETHING works
# (The alternative would be to automakeify this test or manually update it
# every time there's a new version, which defeats the purpose somewhat).
varnishtest "vtstor-vmod: Test version string"
server s1 {
rxreq
expect req.url == "/"
txresp -status 200
} -start
varnish v1 -vcl+backend {
import vtstor from "${vmod_topbuild}/src/.libs/libvmod_vtstor.so";
sub vcl_backend_response {
set beresp.http.x-version = vtstor.version();
if (!beresp.http.x-version) {
set beresp.status = 500;
}
return(deliver);
}
} -start
client c1 {
txreq -url "/"
rxresp
expect resp.status == 200
} -run
src/tests/a03.vtc
0 → 100644
View file @
798cba43
varnishtest "vtstor-vmod: vcl.use and .discard"
server s1 {
} -start
varnish v1 -vcl+backend {
import vtstor from "${vmod_topbuild}/src/.libs/libvmod_vtstor.so";
} -start
varnish v1 -vcl+backend {
}
varnish v1 -cli "vcl.list"
varnish v1 -cli "vcl.use vcl1"
varnish v1 -cli "vcl.use vcl2"
varnish v1 -cli "vcl.use vcl1"
varnish v1 -cli "vcl.show vcl1"
varnish v1 -cli "vcl.use vcl2"
varnish v1 -cli "vcl.discard vcl1"
varnish v1 -cli "vcl.list"
src/vmod_vtstor.c
View file @
798cba43
...
...
@@ -170,3 +170,10 @@ vmod_vxid(VRT_CTX, struct vmod_priv *priv)
return(priv->priv);
}
#endif
VCL_STRING
__match_proto__
(
td_vmod_version
)
vmod_version
(
VRT_CTX
)
{
return
VERSION
;
}
src/vmod_vtstor.vcc
View file @
798cba43
...
...
@@ -34,3 +34,5 @@ $Method STRING .get(HEADER)
$Method VOID .delete(HEADER)
# $Function STRING vxid(PRIV_TASK)
$Function STRING version()
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