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
5ba6b682
Commit
5ba6b682
authored
Jul 18, 2018
by
Geoff Simmons
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
VMOD blob out-of-workspace tests with all encoding schemes.
parent
fc95898d
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
97 additions
and
3 deletions
+97
-3
m00049.vtc
bin/varnishtest/tests/m00049.vtc
+97
-3
No files found.
bin/varnishtest/tests/m00049.vtc
View file @
5ba6b682
...
...
@@ -44,7 +44,7 @@ client c1 {
expect resp.reason ~ {(?i)^VCL Failed$|^Internal Server Error$}
} -run
client c
1
{
client c
2
{
txreq -url "/2"
rxresp
expect resp.status >= 500
...
...
@@ -52,7 +52,7 @@ client c1 {
expect resp.reason ~ {(?i)^VCL Failed$|^Internal Server Error$}
} -run
client c
1
{
client c
3
{
txreq -url "/3"
rxresp
expect resp.status >= 500
...
...
@@ -60,10 +60,104 @@ client c1 {
expect resp.reason ~ {(?i)^VCL Failed$|^Internal Server Error$}
} -run
client c
1
{
client c
4
{
txreq -url "/4"
rxresp
expect resp.status >= 500
expect resp.status <= 503
expect resp.reason ~ {(?i)^VCL Failed$|^Internal Server Error$}
} -run
# Similar tests with BASE64 encoding
varnish v1 -vcl {
import blob;
import vtc;
backend b { .host = "${bad_ip}"; }
sub vcl_recv {
if (req.url == "/1") {
vtc.workspace_alloc(client, -33);
}
elsif (req.url == "/2") {
vtc.workspace_alloc(client, -50);
}
set req.http.Decode
= blob.encode(blob=blob.decode(BASE64,
encoded="MTIzNDU2Nzg5MA=="));
}
sub vcl_miss {
if (req.url == "/3") {
vtc.workspace_alloc(client, -65);
set req.http.Encode
= blob.encode(BASE64, blob=req.hash);
}
return( synth(200) );
}
}
client c1 -run
client c2 -run
client c3 -run
# URL encoding
varnish v1 -vcl {
import blob;
import vtc;
backend b { .host = "${bad_ip}"; }
sub vcl_recv {
if (req.url == "/1") {
vtc.workspace_alloc(client, -33);
}
elsif (req.url == "/2") {
vtc.workspace_alloc(client, -50);
}
set req.http.Decode
= blob.encode(blob=blob.decode(URL,
encoded="1234567890"));
}
sub vcl_miss {
if (req.url == "/3") {
vtc.workspace_alloc(client, -65);
set req.http.Encode = blob.encode(URL, blob=req.hash);
}
return( synth(200) );
}
}
client c1 -run
client c2 -run
client c3 -run
# HEX encoding
varnish v1 -vcl {
import blob;
import vtc;
backend b { .host = "${bad_ip}"; }
sub vcl_recv {
if (req.url == "/1") {
vtc.workspace_alloc(client, -33);
}
elsif (req.url == "/2") {
vtc.workspace_alloc(client, -50);
}
set req.http.Decode
= blob.encode(blob=blob.decode(HEX,
encoded="31323334353637383930"));
}
sub vcl_miss {
if (req.url == "/3") {
vtc.workspace_alloc(client, -65);
set req.http.Encode = blob.encode(HEX, blob=req.hash);
}
return( synth(200) );
}
}
client c1 -run
client c2 -run
client c3 -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