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
24870927
Commit
24870927
authored
Nov 15, 2016
by
Poul-Henning Kamp
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Make this test more robust.
parent
e6e697ca
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
24 additions
and
1 deletion
+24
-1
r01927.vtc
bin/varnishtest/tests/r01927.vtc
+24
-1
No files found.
bin/varnishtest/tests/r01927.vtc
View file @
24870927
varnishtest "Test requests other than GET are cacheable"
barrier b1 cond 2
server s1 {
rxreq
expect req.method == "POST"
...
...
@@ -9,14 +11,22 @@ server s1 {
expect req.method == "POST"
expect req.body == "foo"
txresp -body baz
barrier b1 sync
} -start
varnish v1 -vcl+backend {
sub vcl_recv {
# We ignore the actual body for this test.
set req.http.method = req.method;
set req.http.hit = "No";
return (hash);
}
sub vcl_hit {
set req.http.hit = "Yes";
}
sub vcl_deliver {
set resp.http.hit = req.http.hit;
}
sub vcl_backend_fetch {
set bereq.method = bereq.http.method;
}
...
...
@@ -29,14 +39,27 @@ client c1 {
txreq -req "POST" -body "foo"
rxresp
expect resp.body == "bar"
expect resp.http.hit == "No"
txreq -req "POST" -body "foo"
rxresp
expect resp.body == "bar"
delay 0.5
expect resp.http.hit == "Yes"
# Wait until between ttl&grace
delay 1.0
# Trigger bg fetch
txreq -req "POST" -body "foo"
rxresp
expect resp.body == "bar"
expect resp.http.hit == "Yes"
barrier b1 sync
# Get new object, from cache
txreq -req "POST" -body "foo"
rxresp
expect resp.body == "baz"
expect resp.http.hit == "Yes"
} -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