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
da8b3c93
Commit
da8b3c93
authored
Dec 11, 2015
by
Federico G. Schwindt
Committed by
Lasse Karstensen
Jan 13, 2016
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Random pass at sanitising and cleaning some tests
parent
069420bc
Changes
12
Hide whitespace changes
Inline
Side-by-side
Showing
12 changed files
with
96 additions
and
192 deletions
+96
-192
c00025.vtc
bin/varnishtest/tests/c00025.vtc
+8
-14
c00026.vtc
bin/varnishtest/tests/c00026.vtc
+11
-28
m00001.vtc
bin/varnishtest/tests/m00001.vtc
+1
-1
m00002.vtc
bin/varnishtest/tests/m00002.vtc
+7
-8
m00003.vtc
bin/varnishtest/tests/m00003.vtc
+8
-18
m00004.vtc
bin/varnishtest/tests/m00004.vtc
+1
-3
m00005.vtc
bin/varnishtest/tests/m00005.vtc
+31
-65
m00006.vtc
bin/varnishtest/tests/m00006.vtc
+4
-16
m00007.vtc
bin/varnishtest/tests/m00007.vtc
+18
-24
m00011.vtc
bin/varnishtest/tests/m00011.vtc
+5
-12
m00013.vtc
bin/varnishtest/tests/m00013.vtc
+1
-2
r01826.vtc
bin/varnishtest/tests/r01826.vtc
+1
-1
No files found.
bin/varnishtest/tests/c00025.vtc
View file @
da8b3c93
...
...
@@ -2,30 +2,24 @@ varnishtest "Test If-None-Match"
server s1 {
rxreq
expect req.url == "/foo"
txresp -hdr {ETag: "123456789"} \
-body "11111\n"
expect req.url == /
txresp -hdr {ETag: "123456789"} -bodylen 10
} -start
varnish v1 -vcl+backend { } -start
client c1 {
txreq
-url "/foo"
txreq
rxresp
expect resp.status == 200
expect resp.bodylen == 6
expect resp.bodylen == 10
expect resp.http.etag == {"123456789"}
txreq -url "/foo" \
-hdr {If-None-Match: "12345678"}
txreq -hdr {If-None-Match: "12345678"}
rxresp
expect resp.status == 200
txreq -url "/foo" \
-hdr {If-None-Match: "123456789"}
txreq -hdr {If-None-Match: "123456789"}
rxresp -no_obj
expect resp.status == 304
}
client c1 -run
client c1 -run
} -run
bin/varnishtest/tests/c00026.vtc
View file @
da8b3c93
varnishtest "
Client IMS/INM: Test Combination of If-None-Match and If-Modified-Since
"
varnishtest "
Test client If-None-Match and If-Modified-Since together
"
server s1 {
rxreq
expect req.url ==
"/foo"
expect req.url ==
/
txresp -hdr {ETag: "123456789"} \
-hdr "Last-Modified: Thu, 26 Jun 2008 12:00:01 GMT" \
-body
"11111\n"
-hdr "Last-Modified: Thu, 26 Jun 2008 12:00:01 GMT" \
-body
len 10
} -start
varnish v1 -vcl+backend { } -start
client c1 {
txreq
-url "/foo"
txreq
rxresp
expect resp.status == 200
expect resp.bodylen == 6
expect resp.bodylen == 10
expect resp.http.etag == {"123456789"}
txreq -url "/foo" \
-hdr {If-None-Match: "123456789"}
rxresp -no_obj
expect resp.status == 304
txreq -url "/foo" \
-hdr "If-Modified-Since: Thu, 26 Jun 2008 12:00:01 GMT"
rxresp -no_obj
expect resp.status == 304
txreq -url "/foo" \
-hdr "If-Modified-Since: Thu, 26 Jun 2008 12:00:00 GMT" \
txreq -hdr "If-Modified-Since: Thu, 26 Jun 2008 12:00:00 GMT" \
-hdr {If-None-Match: "123456789"}
rxresp
expect resp.status == 200
txreq -url "/foo" \
-hdr "If-Modified-Since: Thu, 26 Jun 2008 12:00:01 GMT" \
txreq -hdr "If-Modified-Since: Thu, 26 Jun 2008 12:00:01 GMT" \
-hdr {If-None-Match: "12345678"}
rxresp
expect resp.status == 200
txreq -url "/foo" \
-hdr "If-Modified-Since: Thu, 26 Jun 2008 12:00:01 GMT" \
txreq -hdr "If-Modified-Since: Thu, 26 Jun 2008 12:00:01 GMT" \
-hdr {If-None-Match: "123456789"}
rxresp -no_obj
expect resp.status == 304
}
client c1 -run
client c1 -run
} -run
bin/varnishtest/tests/m00001.vtc
View file @
da8b3c93
...
...
@@ -5,7 +5,7 @@ server s1 {
txresp -hdr "foo: bAr" -hdr "bar: fOo" -bodylen 4
} -start
varnish v1 -
arg "-pthread_pools=1" -
vcl+backend {
varnish v1 -vcl+backend {
import ${vmod_std};
sub vcl_deliver {
...
...
bin/varnishtest/tests/m00002.vtc
View file @
da8b3c93
varnishtest "Test std.random"
varnishtest "Test std.random
()
"
# needs random generator
random
server s1 {
rxreq
txresp
-proto HTTP/1.0 -nolen -bodylen 9
txresp
} -start
varnish v1 -vcl+backend {
import ${vmod_std};
sub vcl_
backend_response
{
set
beresp.http.rnd1 = std.random(0,
1);
set
beresp.http.rnd2 = std.random(0,
10);
set
beresp.http.rnd3 = std.random(8,
10);
set
beresp.http.rnd4 = std.random(99,
100);
sub vcl_
deliver
{
set
resp.http.rnd1 = std.random(0,
1);
set
resp.http.rnd2 = std.random(0,
10);
set
resp.http.rnd3 = std.random(8,
10);
set
resp.http.rnd4 = std.random(99,
100);
}
} -start
...
...
@@ -30,5 +30,4 @@ client c1 {
expect resp.http.rnd2 == 7.478
expect resp.http.rnd3 == 9.034
expect resp.http.rnd4 == 99.502
expect resp.bodylen == 9
} -run
bin/varnishtest/tests/m00003.vtc
View file @
da8b3c93
...
...
@@ -4,29 +4,19 @@ feature topbuild
server s1 {
rxreq
txresp
-hdr "foo: bAr" -hdr "bar: fOo" -bodylen 4
txresp
} -start
varnish v1 -arg "-pthread_pools=1" \
-arg "-pvmod_dir=${topbuild}/lib/libvmod_std/.libs/" \
-vcl+backend {
varnish v1 -arg "-pvmod_dir=${topbuild}/lib/libvmod_std/.libs/" \
-vcl+backend {
import std;
sub vcl_deliver {
set resp.http.foo = std.toupper(resp.http.foo);
set resp.http.bar = std.tolower(resp.http.bar);
std.set_ip_tos(32);
}
} -start
client c1 {
txreq -url "/bar"
rxresp
expect resp.status == 200
expect resp.bodylen == "4"
expect resp.http.foo == "BAR"
expect resp.http.bar == "foo"
} -run
varnish v1 -cliok "param.set vmod_dir /nonexistent"
varnish v1 -errvcl {No such file or directory} {
import std;
}
varnish v1 -errvcl {Expected 'from path ...'} {
import std to;
...
...
bin/varnishtest/tests/m00004.vtc
View file @
da8b3c93
...
...
@@ -13,9 +13,7 @@ server s1 {
}
} -start
varnish v1 \
-arg "-pthread_pools=1" \
-vcl+backend {
varnish v1 -vcl+backend {
import ${vmod_std};
sub vcl_deliver {
...
...
bin/varnishtest/tests/m00005.vtc
View file @
da8b3c93
varnishtest "
test vmod_std.duration conversion
"
varnishtest "
Test std.duration()
"
server s1 {
rxreq
expect req.url == "/1"
txresp -bodylen 1
txresp
} -start
varnish v1 -vcl+backend {
import ${vmod_std};
sub vcl_recv {
set req.ttl = 1000000s + std.duration(req.http.ttl, 1s);
}
sub vcl_deliver {
set resp.http.ttl =
(req.ttl + 1s)
;
set resp.http.ttl =
std.duration(req.http.ttl, 1s) + 1000000s
;
}
} -start
client c1 {
txreq -
url "/1" -hdr "ttl: 10ms
"
txreq -
hdr "ttl: 10ms
"
rxresp
expect resp.status == 200
expect resp.http.ttl == 1000001.010
expect resp.bodylen == 1
expect resp.http.ttl == 1000000.010
txreq -
url "/1" -hdr "ttl: 10s
"
txreq -
hdr "ttl: 10s
"
rxresp
expect resp.status == 200
expect resp.http.ttl == 1000011.000
expect resp.bodylen == 1
expect resp.http.ttl == 1000010.000
txreq -
url "/1" -hdr "ttl: 10m
"
txreq -
hdr "ttl: 10m
"
rxresp
expect resp.status == 200
expect resp.http.ttl == 1000601.000
expect resp.bodylen == 1
expect resp.http.ttl == 1000600.000
txreq -
url "/1" -hdr "ttl: 10h
"
txreq -
hdr "ttl: 10h
"
rxresp
expect resp.status == 200
expect resp.http.ttl == 1036001.000
expect resp.bodylen == 1
expect resp.http.ttl == 1036000.000
txreq -
url "/1" -hdr "ttl: 10d
"
txreq -
hdr "ttl: 10d
"
rxresp
expect resp.status == 200
expect resp.http.ttl == 1864001.000
expect resp.bodylen == 1
expect resp.http.ttl == 1864000.000
txreq -
url "/1" -hdr "ttl: 10w
"
txreq -
hdr "ttl: 10w
"
rxresp
expect resp.status == 200
expect resp.http.ttl == 7048001.000
expect resp.bodylen == 1
expect resp.http.ttl == 7048000.000
txreq -
url "/1" -hdr "ttl: -100s
"
txreq -
hdr "ttl: 1y
"
rxresp
expect resp.status == 200
expect resp.http.ttl == 999901.000
expect resp.bodylen == 1
expect resp.http.ttl == 32536000.000
txreq -
url "/1" -hdr "ttl: s
"
txreq -
hdr "ttl: -100s
"
rxresp
expect resp.status == 200
expect resp.http.ttl == 1000002.000
expect resp.bodylen == 1
expect resp.http.ttl == 999900.000
txreq -
url "/1" -hdr "ttl: 3wx
"
txreq -
hdr "ttl: s
"
rxresp
expect resp.status == 200
expect resp.http.ttl == 1000002.000
expect resp.bodylen == 1
expect resp.http.ttl == 1000001.000
txreq -
url "/1" -hdr "ttl: -inf
"
txreq -
hdr "ttl: 3wx
"
rxresp
expect resp.status == 200
expect resp.http.ttl == 1000002.000
expect resp.bodylen == 1
expect resp.http.ttl == 1000001.000
txreq -
url "/1" -hdr "ttl: 2x
"
txreq -
hdr "ttl: -inf
"
rxresp
expect resp.status == 200
expect resp.http.ttl == 1000002.000
expect resp.bodylen == 1
expect resp.http.ttl == 1000001.000
txreq -
url "/1" -hdr "ttl: 2h x
"
txreq -
hdr "ttl: 2x
"
rxresp
expect resp.status == 200
expect resp.http.ttl == 1000002.000
expect resp.bodylen == 1
expect resp.http.ttl == 1000001.000
txreq -
url "/1" -hdr "ttl: 100
"
txreq -
hdr "ttl: 2h x
"
rxresp
expect resp.status == 200
expect resp.http.ttl == 1000002.000
expect resp.bodylen == 1
expect resp.http.ttl == 1000001.000
txreq -
url "/1" -hdr "ttl: 1y
"
txreq -
hdr "ttl: 100
"
rxresp
expect resp.status == 200
expect resp.http.ttl == 32536001.000
expect resp.bodylen == 1
expect resp.http.ttl == 1000001.000
} -run
bin/varnishtest/tests/m00006.vtc
View file @
da8b3c93
...
...
@@ -2,14 +2,9 @@ varnishtest "test vmod_std.collect()"
server s1 {
rxreq
expect req.url == "/1"
expect req.http.foo == "1, 2"
txresp -hdr "bar: a" -hdr "bar: b" -bodylen 1
rxreq
expect req.url == "/2"
expect req.http.baz == "1, 2"
txresp -hdr "qux: a" -hdr "qux: b" -bodylen 1
expect req.http.baz == "3, 4"
txresp -hdr "bar: a" -hdr "bar: b" -hdr "qux: c" -hdr "qux: d"
} -start
varnish v1 -vcl+backend {
...
...
@@ -30,15 +25,8 @@ varnish v1 -vcl+backend {
} -start
client c1 {
txreq
-url "/1" -hdr "Foo: 1" -hdr "Foo: 2
"
txreq
-hdr "Foo: 1" -hdr "Foo: 2" -hdr "Baz: 3" -hdr "Baz: 4
"
rxresp
expect resp.http.bar == "a, b"
expect resp.status == 200
expect resp.bodylen == 1
txreq -url "/2" -hdr "Baz: 1" -hdr "Baz: 2"
rxresp
expect resp.http.qux == "a, b"
expect resp.status == 200
expect resp.bodylen == 1
expect resp.http.qux == "c, d"
} -run
bin/varnishtest/tests/m00007.vtc
View file @
da8b3c93
varnishtest "
test vmod_std.integer conversion
"
varnishtest "
Test std.integer()
"
server s1 {
rxreq
expect req.url == "/1"
txresp -bodylen 1
txresp
} -start
varnish v1 -vcl+backend {
import ${vmod_std};
sub vcl_deliver {
set resp.http.
biggerthanzero = (std.integer(req.http.foo,
0) > 0);
set resp.http.
smallerthanzero = (std.integer(req.http.foo,
0) < 0);
set resp.http.iszero = (std.integer(req.http.foo,0) == 0);
set resp.http.converted = std.integer(req.http.foo,0);
set resp.http.
gtzero = (std.integer(req.http.foo,
0) > 0);
set resp.http.
ltzero = (std.integer(req.http.foo,
0) < 0);
set resp.http.iszero = (std.integer(req.http.foo,
0) == 0);
set resp.http.converted = std.integer(req.http.foo,
0);
}
} -start
client c1 {
txreq -
url "/1" -
hdr "foo: 1"
txreq -hdr "foo: 1"
rxresp
expect resp.status == 200
expect resp.http.biggerthanzero == true
expect resp.http.smallerthanzero == false
expect resp.http.gtzero == true
expect resp.http.ltzero == false
expect resp.http.iszero == false
expect resp.http.converted == 1
txreq -
url "/1" -
hdr "foo: -1"
txreq -hdr "foo: -1"
rxresp
expect resp.status == 200
expect resp.http.biggerthanzero == false
expect resp.http.smallerthanzero == true
expect resp.http.gtzero == false
expect resp.http.ltzero == true
expect resp.http.iszero == false
expect resp.http.converted == -1
txreq -
url "/1
"
txreq -
hdr "foo: 0
"
rxresp
expect resp.status == 200
expect resp.http.biggerthanzero == false
expect resp.http.smallerthanzero == false
expect resp.http.gtzero == false
expect resp.http.ltzero == false
expect resp.http.iszero == true
expect resp.http.converted == 0
txreq -
url "/1" -
hdr "foo: bar"
txreq -hdr "foo: bar"
rxresp
expect resp.status == 200
expect resp.http.biggerthanzero == false
expect resp.http.smallerthanzero == false
expect resp.http.gtzero == false
expect resp.http.ltzero == false
expect resp.http.iszero == true
expect resp.http.converted == 0
} -run
bin/varnishtest/tests/m00011.vtc
View file @
da8b3c93
varnishtest "Test std.ip"
varnishtest "Test std.ip
()
"
server s1 {
rxreq
txresp -body "1"
rxreq
txresp -body "22"
txresp
} -start
varnish v1 -arg "-Wpoll" -vcl+backend {
varnish v1 -vcl+backend {
import ${vmod_std};
sub vcl_deliver {
set resp.http.foo0 = std.ip("8.8.8.*", client.ip);
set resp.http.foo1 = std.ip("9.9.9.*", server.ip);
...
...
@@ -22,16 +19,12 @@ varnish v1 -arg "-Wpoll" -vcl+backend {
} -start
client c1 {
txreq
-url "/foo1"
txreq
rxresp
expect resp.bodylen == 1
expect resp.http.foo0 == "127.0.0.1"
expect resp.http.foo1 == "127.0.0.1"
expect resp.http.foo2 == "127.0.0.2"
expect resp.http.foo3 == "1.2.3.5"
expect resp.http.foo4 == "2001:db8::"
expect resp.http.foo5 == "::1"
txreq -url "/foo2"
rxresp
expect resp.bodylen == 2
} -run
bin/varnishtest/tests/m00013.vtc
View file @
da8b3c93
varnishtest "T
imestamps from std vmod
"
varnishtest "T
est std.timestamp()
"
server s1 {
rxreq
...
...
@@ -38,7 +38,6 @@ logexpect l1 -v v1 -g request {
client c1 {
txreq
rxresp
expect resp.status == 200
} -run
logexpect l1 -wait
bin/varnishtest/tests/r01826.vtc
View file @
da8b3c93
...
...
@@ -2,7 +2,7 @@ varnishtest "Check we ignore a zero C-L with a 204"
server s1 {
rxreq
txresp -status 204
-nolen -hdr "Content-Length: 0"
txresp -status 204
} -start
varnish v1 -vcl+backend {
...
...
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