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
0296c844
Commit
0296c844
authored
Nov 30, 2012
by
Martin Blix Grydeland
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add a test case for ban list syncing across silos
parent
679fe13a
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
80 additions
and
0 deletions
+80
-0
p00008.vtc
bin/varnishtest/tests/p00008.vtc
+80
-0
No files found.
bin/varnishtest/tests/p00008.vtc
0 → 100644
View file @
0296c844
varnishtest "Ban list sync across silos"
shell "rm -f ${tmpdir}/_.per[12]"
# Silo 1 & 2
# Prime each with an object with X-Foo: foo
server s1 {
rxreq
expect req.url == "/silo1"
txresp -hdr "X-Foo: foo"
rxreq
expect req.url == "/silo2"
txresp -hdr "X-Foo: foo"
} -start
varnish v1 \
-arg "-pfeature=+wait_silo" \
-arg "-pban_lurker_sleep=0" \
-storage "-sper1=persistent,${tmpdir}/_.per1,10m -sper2=persistent,${tmpdir}/_.per2,10m" \
-vcl+backend {
sub vcl_fetch {
set beresp.storage = "per1";
if (req.url ~ "silo2") {
set beresp.storage = "per2";
}
}
} -start
client c1 {
txreq -url "/silo1"
rxresp
expect resp.status == 200
expect resp.http.x-foo == "foo"
txreq -url "/silo2"
rxresp
expect resp.status == 200
expect resp.http.x-foo == "foo"
} -run
varnish v1 -stop
server s1 -wait
# Only silo 1
# Ban on obj.http.x-foo == foo
varnish v2 \
-arg "-pfeature=+wait_silo" \
-arg "-pban_lurker_sleep=0" \
-storage "-spersistent,${tmpdir}/_.per1,10m" \
-vcl+backend { } -start
varnish v2 -cliok "ban obj.http.x-foo == foo"
varnish v2 -cliok "ban.list"
varnish v2 -stop
# Silo 1 & 2
# Bans should be transferred
varnish v3 \
-arg "-pfeature=+wait_silo" \
-arg "-pban_lurker_sleep=0" \
-storage "-spersistent,${tmpdir}/_.per1,10m -spersistent,${tmpdir}/_.per2,10m" \
-vcl+backend { } -start
varnish v3 -cliok "ban.list"
varnish v3 -stop
# Only silo 2
# Check that /silo2 is banned
server s1 {
rxreq
expect req.url == "/silo2"
txresp -hdr "X-Foo: bar"
} -start
varnish v4 \
-arg "-pfeature=+wait_silo" \
-arg "-pban_lurker_sleep=0" \
-storage "-spersistent,${tmpdir}/_.per2,10m" \
-vcl+backend { } -start
client c1 -connect ${v4_sock} {
txreq -url "/silo2"
rxresp
expect resp.status == 200
expect resp.http.x-foo == "bar"
} -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