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
7100ee41
Commit
7100ee41
authored
Aug 21, 2017
by
Federico G. Schwindt
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Test {bereq,req}.hash and some cleanup
parent
5192a6d0
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
14 additions
and
19 deletions
+14
-19
v00020.vtc
bin/varnishtest/tests/v00020.vtc
+14
-19
No files found.
bin/varnishtest/tests/v00020.vtc
View file @
7100ee41
...
@@ -142,70 +142,60 @@ varnish v1 -vcl {
...
@@ -142,70 +142,60 @@ varnish v1 -vcl {
# XXX: not the most clear error message
# XXX: not the most clear error message
varnish v1 -errvcl {STRING - STRING not possible.} {
varnish v1 -errvcl {STRING - STRING not possible.} {
backend b { .host = "127.0.0.1"; }
sub vcl_recv {
sub vcl_recv {
set req.http.foo = "foo" - "bar";
set req.http.foo = "foo" - "bar";
}
}
}
}
varnish v1 -errvcl {TIME + STRING not possible.} {
varnish v1 -errvcl {TIME + STRING not possible.} {
backend b { .host = "127.0.0.1"; }
sub vcl_recv {
sub vcl_recv {
set req.ttl = now + "foo";
set req.ttl = now + "foo";
}
}
}
}
varnish v1 -errvcl {TIME + TIME not possible.} {
varnish v1 -errvcl {TIME + TIME not possible.} {
backend b { .host = "127.0.0.1"; }
sub vcl_recv {
sub vcl_recv {
set req.ttl = now + now;
set req.ttl = now + now;
}
}
}
}
varnish v1 -errvcl {INT + STRING not possible.} {
varnish v1 -errvcl {INT + STRING not possible.} {
backend b { .host = "127.0.0.1"; }
sub vcl_backend_response {
sub vcl_backend_response {
set beresp.status = 1 + "foo";
set beresp.status = 1 + "foo";
}
}
}
}
varnish v1 -errvcl {INT + TIME not possible.} {
varnish v1 -errvcl {INT + TIME not possible.} {
backend b { .host = "127.0.0.1"; }
sub vcl_backend_response {
sub vcl_backend_response {
set beresp.status = 1 + now;
set beresp.status = 1 + now;
}
}
}
}
varnish v1 -errvcl {DURATION + INT not possible.} {
varnish v1 -errvcl {DURATION + INT not possible.} {
backend b { .host = "127.0.0.1"; }
sub vcl_recv {
sub vcl_recv {
set req.ttl = 1s + 1;
set req.ttl = 1s + 1;
}
}
}
}
varnish v1 -errvcl {DURATION + TIME not possible.} {
varnish v1 -errvcl {DURATION + TIME not possible.} {
backend b { .host = "127.0.0.1"; }
sub vcl_recv {
sub vcl_recv {
set req.ttl = 1s + now;
set req.ttl = 1s + now;
}
}
}
}
varnish v1 -errvcl {DURATION + STRING not possible.} {
varnish v1 -errvcl {DURATION + STRING not possible.} {
backend b { .host = "127.0.0.1"; }
sub vcl_recv {
sub vcl_recv {
set req.ttl = 1s + "foo";
set req.ttl = 1s + "foo";
}
}
}
}
varnish v1 -errvcl {IP + IP not possible.} {
varnish v1 -errvcl {IP + IP not possible.} {
backend b { .host = "127.0.0.1"; }
sub vcl_recv {
sub vcl_recv {
set req.ttl = client.ip + server.ip;
set req.ttl = client.ip + server.ip;
}
}
}
}
varnish v1 -errvcl {Name of function, 'foo.bar', contains illegal character '.'} {
varnish v1 -errvcl {Name of function, 'foo.bar', contains illegal character '.'} {
backend b { .host = "127.0.0.1"; }
sub foo.bar {
sub foo.bar {
}
}
sub vcl_recv {
sub vcl_recv {
...
@@ -214,7 +204,6 @@ varnish v1 -errvcl {Name of function, 'foo.bar', contains illegal character '.'}
...
@@ -214,7 +204,6 @@ varnish v1 -errvcl {Name of function, 'foo.bar', contains illegal character '.'}
}
}
varnish v1 -errvcl {VCL sub's named 'vcl*' are reserved names.} {
varnish v1 -errvcl {VCL sub's named 'vcl*' are reserved names.} {
backend b { .host = "127.0.0.1"; }
sub vcl_bar {
sub vcl_bar {
}
}
sub vcl_recv {
sub vcl_recv {
...
@@ -224,22 +213,33 @@ varnish v1 -errvcl {VCL sub's named 'vcl*' are reserved names.} {
...
@@ -224,22 +213,33 @@ varnish v1 -errvcl {VCL sub's named 'vcl*' are reserved names.} {
varnish v1 -errvcl {Function returns VOID} {
varnish v1 -errvcl {Function returns VOID} {
import vtc;
import vtc;
backend b { .host = "127.0.0.1"; }
sub vcl_recv {
sub vcl_recv {
set req.http.foo = vtc.sleep(1m);
set req.http.foo = vtc.sleep(1m);
}
}
}
}
varnish v1 -errvcl {'
beresp.status
': Not available in method 'vcl_recv'.} {
varnish v1 -errvcl {'
req.hash
': Not available in method 'vcl_recv'.} {
backend b { .host = "127.0.0.1"; }
backend b { .host = "127.0.0.1"; }
sub vcl_recv {
set req.http.foo = req.hash;
}
}
varnish v1 -errvcl {'req.hash': Not available in method 'vcl_hash'.} {
backend b { .host = "127.0.0.1"; }
sub vcl_hash {
set req.http.foo = req.hash;
}
}
varnish v1 -errvcl {'beresp.status': Not available in method 'vcl_recv'.} {
backend b { .host = "127.0.0.1"; }
sub vcl_recv {
sub vcl_recv {
set req.http.foo = 100 + beresp.status;
set req.http.foo = 100 + beresp.status;
}
}
}
}
varnish v1 -errvcl {Name of ACL, 'foo.bar', contains illegal character '.'} {
varnish v1 -errvcl {Name of ACL, 'foo.bar', contains illegal character '.'} {
backend b { .host = "127.0.0.1"; }
acl foo.bar {
acl foo.bar {
}
}
sub vcl_recv {
sub vcl_recv {
...
@@ -254,7 +254,6 @@ varnish v1 -errvcl {Expected 'from path ...'} {
...
@@ -254,7 +254,6 @@ varnish v1 -errvcl {Expected 'from path ...'} {
varnish v1 -errvcl {INT * BLOB not possible.} {
varnish v1 -errvcl {INT * BLOB not possible.} {
import vtc;
import vtc;
backend b { .host = "127.0.0.1"; }
sub vcl_deliver {
sub vcl_deliver {
set resp.status = 100 * vtc.str2blob("a");
set resp.status = 100 * vtc.str2blob("a");
}
}
...
@@ -262,15 +261,12 @@ varnish v1 -errvcl {INT * BLOB not possible.} {
...
@@ -262,15 +261,12 @@ varnish v1 -errvcl {INT * BLOB not possible.} {
# XXX: should spot nonexistent storage
# XXX: should spot nonexistent storage
varnish v1 -errvcl {Symbol not found: 'storage.foo' (expected type STEVEDORE):} {
varnish v1 -errvcl {Symbol not found: 'storage.foo' (expected type STEVEDORE):} {
backend b { .host = "127.0.0.1"; }
sub vcl_backend_response {
sub vcl_backend_response {
set beresp.storage = storage.foo;
set beresp.storage = storage.foo;
}
}
}
}
varnish v1 -errvcl {Comparison of different types: BACKEND '==' STRING} {
varnish v1 -errvcl {Comparison of different types: BACKEND '==' STRING} {
backend b1 { .host = "127.0.0.1"; }
sub vcl_backend_response {
sub vcl_backend_response {
set beresp.http.bereq_backend = bereq.backend;
set beresp.http.bereq_backend = bereq.backend;
if (bereq.backend == beresp.http.bereq_backend) {
if (bereq.backend == beresp.http.bereq_backend) {
...
@@ -285,7 +281,6 @@ server s1 {
...
@@ -285,7 +281,6 @@ server s1 {
} -start
} -start
varnish v1 -vcl+backend {
varnish v1 -vcl+backend {
sub vcl_deliver {
sub vcl_deliver {
set resp.http.foo =
set resp.http.foo =
(resp.http.foo + resp.http.bar) == ("X" + resp.http.foo);
(resp.http.foo + resp.http.bar) == ("X" + resp.http.foo);
...
...
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