Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
V
varnishevent3
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
varnishevent3
Commits
15a2f798
Commit
15a2f798
authored
Feb 28, 2011
by
Poul-Henning Kamp
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add testcase for purge in vcl hit & miss
parent
f8b5e53d
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
100 additions
and
0 deletions
+100
-0
c00041.vtc
bin/varnishtest/tests/c00041.vtc
+100
-0
No files found.
bin/varnishtest/tests/c00041.vtc
0 → 100644
View file @
15a2f798
# $Id$
test "test purging from vcl"
server s1 {
rxreq
expect req.url == "/1"
expect req.http.foo == "foo1"
txresp -hdr "Vary: foo" -bodylen 1
rxreq
expect req.url == "/1"
expect req.http.foo == "foo2"
txresp -hdr "Vary: foo" -bodylen 2
rxreq
expect req.url == "/1"
expect req.http.foo == "foo2"
txresp -hdr "Vary: foo" -bodylen 12
rxreq
expect req.url == "/1"
expect req.http.foo == "foo1"
txresp -hdr "Vary: foo" -bodylen 11
rxreq
expect req.url == "/1"
expect req.http.foo == "foo3"
txresp -hdr "Vary: foo" -bodylen 23
rxreq
expect req.url == "/1"
expect req.http.foo == "foo1"
txresp -hdr "Vary: foo" -bodylen 21
rxreq
expect req.url == "/1"
expect req.http.foo == "foo2"
txresp -hdr "Vary: foo" -bodylen 22
} -start
varnish v1 -vcl+backend {
sub vcl_miss { if (req.http.purge == "yes") { purge; } }
sub vcl_hit { if (req.http.purge == "yes") { purge; return(restart);} }
} -start
client c1 {
txreq -url "/1" -hdr "foo: foo1"
rxresp
expect resp.status == 200
expect resp.bodylen == 1
txreq -url "/1" -hdr "Foo: foo2"
rxresp
expect resp.status == 200
expect resp.bodylen == 2
txreq -url "/1" -hdr "foo: foo1"
rxresp
expect resp.status == 200
expect resp.bodylen == 1
txreq -url "/1" -hdr "Foo: foo2"
rxresp
expect resp.status == 200
expect resp.bodylen == 2
# Purge on hit
txreq -url "/1" -hdr "Foo: foo2" -hdr "purge: yes"
rxresp
expect resp.status == 200
expect resp.bodylen == 12
txreq -url "/1" -hdr "foo: foo1"
rxresp
expect resp.status == 200
expect resp.bodylen == 11
# Purge on miss
txreq -url "/1" -hdr "Foo: foo3" -hdr "purge: yes"
rxresp
expect resp.status == 200
expect resp.bodylen == 23
txreq -url "/1" -hdr "foo: foo1"
rxresp
expect resp.status == 200
expect resp.bodylen == 21
txreq -url "/1" -hdr "Foo: foo2"
rxresp
expect resp.status == 200
expect resp.bodylen == 22
} -run
varnish v1 -badvcl {
backend s1 { .host = "${s1_addr}"; }
sub vcl_recv { if (req.http.purge == "yes") { purge; } }
}
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