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
0c9c3851
Commit
0c9c3851
authored
Sep 20, 2019
by
Martin Blix Grydeland
Committed by
Dridi Boukelmoune
May 13, 2020
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Test case for VSV00004
parent
05869183
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
98 additions
and
0 deletions
+98
-0
f00004.vtc
bin/varnishtest/tests/f00004.vtc
+98
-0
No files found.
bin/varnishtest/tests/f00004.vtc
0 → 100644
View file @
0c9c3851
varnishtest "VSV00004"
server s1 {
rxreq
expect req.url == /test1
txresp
rxreq
expect req.url == /test2
send "bogus\r\n\r\n"
expect_close
accept
rxreq
expect req.url == /test3
txresp
} -start
varnish v1 -arg "-p debug=+syncvsl" -arg "-p max_restarts=0" -vcl+backend {
import vtc;
sub vcl_recv {
if (req.url == "/prime") {
# Avoid allocations at start of workspace so
# that test string is not overwritten
vtc.workspace_alloc(client, 1024);
set req.http.temp = "super";
set req.http.secret = req.http.temp + "secret";
return (synth(200, req.http.secret));
}
}
sub vcl_deliver {
if (req.url == "/test1") {
return (restart);
}
}
sub vcl_backend_error {
return (abandon);
}
} -start
# Case 1
client c1 {
txreq -url /prime
rxresp
expect resp.status == 200
expect resp.reason == supersecret
txreq -url /test1
rxresp
expect resp.status == 503
expect resp.reason != supersecret
expect resp.reason == "Service Unavailable"
} -run
# Case 2
client c2 {
txreq -url /prime
rxresp
expect resp.status == 200
expect resp.reason == supersecret
txreq -url /test2
rxresp
expect resp.status == 503
expect resp.reason != supersecret
expect resp.reason == "Service Unavailable"
} -run
# Case 3
varnish v1 -cliok "vcl.label label1 vcl1"
varnish v1 -cliok "param.reset max_restarts"
varnish v1 -vcl+backend {
sub vcl_recv {
if (req.url == "/prime") {
return (vcl(label1));
}
if (req.restarts > 0) {
return (vcl(label1));
}
}
sub vcl_deliver {
return (restart);
}
}
client c3 {
txreq -url /prime
rxresp
expect resp.status == 200
expect resp.reason == supersecret
txreq -url /test3
rxresp
expect resp.status == 503
expect resp.reason != supersecret
expect resp.reason == "Service Unavailable"
} -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