Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
V
varnish-cache
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
varnish-cache
Commits
bd007e83
Commit
bd007e83
authored
Mar 22, 2011
by
Poul-Henning Kamp
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Forgot to git add this one some days ago
parent
a1a62dc7
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
90 additions
and
0 deletions
+90
-0
m00005.vtc
bin/varnishtest/tests/m00005.vtc
+90
-0
No files found.
bin/varnishtest/tests/m00005.vtc
0 → 100644
View file @
bd007e83
# $Id$
test "test vmod_std.duration conversion"
server s1 {
rxreq
expect req.url == "/1"
txresp -bodylen 1
} -start
varnish v1 -vcl+backend {
import std from "${topbuild}/lib/libvmod_std/.libs/libvmod_std.so" ;
sub vcl_recv {
set req.ttl = 1000000s + std.duration(req.http.ttl, 1s);
}
sub vcl_deliver {
set resp.http.ttl = (req.ttl + 1s);
}
} -start
client c1 {
txreq -url "/1" -hdr "ttl: 10s "
rxresp
expect resp.status == 200
expect resp.http.ttl == 1000011.000
expect resp.bodylen == 1
txreq -url "/1" -hdr "ttl: 10m "
rxresp
expect resp.status == 200
expect resp.http.ttl == 1000601.000
expect resp.bodylen == 1
txreq -url "/1" -hdr "ttl: 10h "
rxresp
expect resp.status == 200
expect resp.http.ttl == 1036001.000
expect resp.bodylen == 1
txreq -url "/1" -hdr "ttl: 10d "
rxresp
expect resp.status == 200
expect resp.http.ttl == 1864001.000
expect resp.bodylen == 1
txreq -url "/1" -hdr "ttl: 10w "
rxresp
expect resp.status == 200
expect resp.http.ttl == 7048001.000
expect resp.bodylen == 1
txreq -url "/1" -hdr "ttl: -100s "
rxresp
expect resp.status == 200
expect resp.http.ttl == 999901.000
expect resp.bodylen == 1
txreq -url "/1" -hdr "ttl: s "
rxresp
expect resp.status == 200
expect resp.http.ttl == 1000002.000
expect resp.bodylen == 1
txreq -url "/1" -hdr "ttl: 3wx "
rxresp
expect resp.status == 200
expect resp.http.ttl == 1000002.000
expect resp.bodylen == 1
txreq -url "/1" -hdr "ttl: -inf "
rxresp
expect resp.status == 200
expect resp.http.ttl == 1000002.000
expect resp.bodylen == 1
txreq -url "/1" -hdr "ttl: 2x "
rxresp
expect resp.status == 200
expect resp.http.ttl == 1000002.000
expect resp.bodylen == 1
txreq -url "/1" -hdr "ttl: 2h x "
rxresp
expect resp.status == 200
expect resp.http.ttl == 1000002.000
expect resp.bodylen == 1
} -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