Commit 9d50fa6e authored by Poul-Henning Kamp's avatar Poul-Henning Kamp Committed by Lasse Karstensen

Un-copy&paste leading whitespace in test-cases

parent a68f58ab
varnishtest "simply test that the framework support \0"
server s1 {
rxreq
rxreq
expect req.url == "/"
txresp -body {a\0bc}
}
......
varnishtest "Ensure that we can test non-existence of headers (#1062)"
server s1 {
rxreq
txresp
rxreq
txresp
} -start
client c1 -connect ${s1_sock} {
txreq
rxresp
expect resp.http.X-Test == <undef>
txreq
rxresp
expect resp.http.X-Test == <undef>
} -run
varnishtest "Test -h critbit a bit"
server s1 {
rxreq
rxreq
expect req.url == "/"
txresp -hdr "ID: slash" -hdr "Connection: close" -body "012345\n"
txresp -hdr "ID: slash" -hdr "Connection: close" -body "012345\n"
} -start
varnish v1 -arg "-hcritbit" -vcl+backend { } -start
client c1 {
txreq -url "/"
rxresp
expect resp.status == 200
expect resp.http.X-Varnish == "1001"
expect resp.http.ID == "slash"
txreq -url "/"
rxresp
expect resp.status == 200
expect resp.http.X-Varnish == "1001"
expect resp.http.ID == "slash"
} -run
delay .1
client c2 {
txreq -url "/"
rxresp
expect resp.status == 200
expect resp.http.X-Varnish == "1004 1002"
expect resp.http.ID == "slash"
txreq -url "/"
rxresp
expect resp.status == 200
expect resp.http.X-Varnish == "1004 1002"
expect resp.http.ID == "slash"
} -run
delay .1
server s1 {
rxreq
rxreq
expect req.url == "/foo"
txresp -hdr "ID: foo" -body "012345\n"
rxreq
txresp -hdr "ID: foo" -body "012345\n"
rxreq
expect req.url == "/bar"
txresp -hdr "ID: bar" -body "012345\n"
txresp -hdr "ID: bar" -body "012345\n"
} -start
client c1 {
txreq -url "/foo"
rxresp
expect resp.status == 200
expect resp.http.X-Varnish == "1006"
expect resp.http.ID == "foo"
txreq -url "/foo"
rxresp
expect resp.status == 200
expect resp.http.X-Varnish == "1006"
expect resp.http.ID == "foo"
delay .1
txreq -url "/"
rxresp
expect resp.status == 200
expect resp.http.X-Varnish == "1008 1002"
expect resp.http.ID == "slash"
txreq -url "/"
rxresp
expect resp.status == 200
expect resp.http.X-Varnish == "1008 1002"
expect resp.http.ID == "slash"
delay .1
txreq -url "/bar"
rxresp
expect resp.status == 200
expect resp.http.X-Varnish == "1009"
expect resp.http.ID == "bar"
txreq -url "/bar"
rxresp
expect resp.status == 200
expect resp.http.X-Varnish == "1009"
expect resp.http.ID == "bar"
delay .1
txreq -url "/foo"
rxresp
expect resp.status == 200
expect resp.http.X-Varnish == "1011 1007"
expect resp.http.ID == "foo"
txreq -url "/foo"
rxresp
expect resp.status == 200
expect resp.http.X-Varnish == "1011 1007"
expect resp.http.ID == "foo"
} -run
varnish v1 -expect sess_conn == 3
......
varnishtest "Test -h critbit for digest edges"
server s1 {
rxreq
rxreq
expect req.url == "/1"
txresp -body "\n"
rxreq
txresp -body "\n"
rxreq
expect req.url == "/2"
txresp -body "x\n"
rxreq
txresp -body "x\n"
rxreq
expect req.url == "/3"
txresp -body "xx\n"
rxreq
txresp -body "xx\n"
rxreq
expect req.url == "/4"
txresp -body "xxx\n"
rxreq
txresp -body "xxx\n"
rxreq
expect req.url == "/5"
txresp -body "xxxx\n"
rxreq
txresp -body "xxxx\n"
rxreq
expect req.url == "/6"
txresp -body "xxxxx\n"
rxreq
txresp -body "xxxxx\n"
rxreq
expect req.url == "/7"
txresp -body "xxxxxx\n"
rxreq
txresp -body "xxxxxx\n"
rxreq
expect req.url == "/8"
txresp -body "xxxxxxx\n"
rxreq
txresp -body "xxxxxxx\n"
rxreq
expect req.url == "/9"
txresp -body "xxxxxxxx\n"
txresp -body "xxxxxxxx\n"
} -start
varnish v1 -arg "-hcritbit" -vcl+backend { } -start
varnish v1 -cliok "param.set debug +hashedge"
client c1 {
txreq -url "/1"
rxresp
expect resp.status == 200
expect resp.bodylen == 1
expect resp.http.X-Varnish == "1001"
txreq -url "/2"
rxresp
expect resp.bodylen == 2
expect resp.status == 200
expect resp.http.X-Varnish == "1003"
txreq -url "/3"
rxresp
expect resp.bodylen == 3
expect resp.status == 200
expect resp.http.X-Varnish == "1005"
txreq -url "/4"
rxresp
expect resp.bodylen == 4
expect resp.status == 200
expect resp.http.X-Varnish == "1007"
txreq -url "/5"
rxresp
expect resp.bodylen == 5
expect resp.status == 200
expect resp.http.X-Varnish == "1009"
txreq -url "/6"
rxresp
expect resp.bodylen == 6
expect resp.status == 200
expect resp.http.X-Varnish == "1011"
txreq -url "/7"
rxresp
expect resp.bodylen == 7
expect resp.status == 200
expect resp.http.X-Varnish == "1013"
txreq -url "/8"
rxresp
expect resp.bodylen == 8
expect resp.status == 200
expect resp.http.X-Varnish == "1015"
txreq -url "/9"
rxresp
expect resp.bodylen == 9
expect resp.status == 200
expect resp.http.X-Varnish == "1017"
txreq -url "/1"
rxresp
expect resp.status == 200
expect resp.bodylen == 1
expect resp.http.X-Varnish == "1001"
txreq -url "/2"
rxresp
expect resp.bodylen == 2
expect resp.status == 200
expect resp.http.X-Varnish == "1003"
txreq -url "/3"
rxresp
expect resp.bodylen == 3
expect resp.status == 200
expect resp.http.X-Varnish == "1005"
txreq -url "/4"
rxresp
expect resp.bodylen == 4
expect resp.status == 200
expect resp.http.X-Varnish == "1007"
txreq -url "/5"
rxresp
expect resp.bodylen == 5
expect resp.status == 200
expect resp.http.X-Varnish == "1009"
txreq -url "/6"
rxresp
expect resp.bodylen == 6
expect resp.status == 200
expect resp.http.X-Varnish == "1011"
txreq -url "/7"
rxresp
expect resp.bodylen == 7
expect resp.status == 200
expect resp.http.X-Varnish == "1013"
txreq -url "/8"
rxresp
expect resp.bodylen == 8
expect resp.status == 200
expect resp.http.X-Varnish == "1015"
txreq -url "/9"
rxresp
expect resp.bodylen == 9
expect resp.status == 200
expect resp.http.X-Varnish == "1017"
} -run
client c1 {
txreq -url "/1"
rxresp
expect resp.status == 200
expect resp.bodylen == 1
expect resp.http.X-Varnish == "1020 1002"
txreq -url "/2"
rxresp
expect resp.bodylen == 2
expect resp.status == 200
expect resp.http.X-Varnish == "1021 1004"
txreq -url "/3"
rxresp
expect resp.bodylen == 3
expect resp.status == 200
expect resp.http.X-Varnish == "1022 1006"
txreq -url "/4"
rxresp
expect resp.bodylen == 4
expect resp.status == 200
expect resp.http.X-Varnish == "1023 1008"
txreq -url "/5"
rxresp
expect resp.bodylen == 5
expect resp.status == 200
expect resp.http.X-Varnish == "1024 1010"
txreq -url "/6"
rxresp
expect resp.bodylen == 6
expect resp.status == 200
expect resp.http.X-Varnish == "1025 1012"
txreq -url "/7"
rxresp
expect resp.bodylen == 7
expect resp.status == 200
expect resp.http.X-Varnish == "1026 1014"
txreq -url "/8"
rxresp
expect resp.bodylen == 8
expect resp.status == 200
expect resp.http.X-Varnish == "1027 1016"
txreq -url "/9"
rxresp
expect resp.bodylen == 9
expect resp.status == 200
expect resp.http.X-Varnish == "1028 1018"
txreq -url "/1"
rxresp
expect resp.status == 200
expect resp.bodylen == 1
expect resp.http.X-Varnish == "1020 1002"
txreq -url "/2"
rxresp
expect resp.bodylen == 2
expect resp.status == 200
expect resp.http.X-Varnish == "1021 1004"
txreq -url "/3"
rxresp
expect resp.bodylen == 3
expect resp.status == 200
expect resp.http.X-Varnish == "1022 1006"
txreq -url "/4"
rxresp
expect resp.bodylen == 4
expect resp.status == 200
expect resp.http.X-Varnish == "1023 1008"
txreq -url "/5"
rxresp
expect resp.bodylen == 5
expect resp.status == 200
expect resp.http.X-Varnish == "1024 1010"
txreq -url "/6"
rxresp
expect resp.bodylen == 6
expect resp.status == 200
expect resp.http.X-Varnish == "1025 1012"
txreq -url "/7"
rxresp
expect resp.bodylen == 7
expect resp.status == 200
expect resp.http.X-Varnish == "1026 1014"
txreq -url "/8"
rxresp
expect resp.bodylen == 8
expect resp.status == 200
expect resp.http.X-Varnish == "1027 1016"
txreq -url "/9"
rxresp
expect resp.bodylen == 9
expect resp.status == 200
expect resp.http.X-Varnish == "1028 1018"
} -run
varnish v1 -cliok "hcb.dump"
......
varnishtest "Test restart in vcl_synth"
server s1 {
rxreq
txresp
rxreq
txresp
} -start
varnish v1 -vcl+backend {
......@@ -21,7 +21,7 @@ varnish v1 -vcl+backend {
} -start
client c1 {
txreq -url "/"
rxresp
expect resp.status == 200
txreq -url "/"
rxresp
expect resp.status == 200
} -run
......@@ -14,7 +14,7 @@ varnish v1 -vcl {
} -start
client c1 {
txreq -url "/"
rxresp
expect resp.status == 503
txreq -url "/"
rxresp
expect resp.status == 503
} -run
varnishtest "Test req.hash_always_miss in vcl_recv"
server s1 {
rxreq
txresp -hdr "Inc: 1"
rxreq
txresp -hdr "Inc: 2"
rxreq
txresp -hdr "Inc: 1"
rxreq
txresp -hdr "Inc: 2"
} -start
varnish v1 -vcl+backend {
......
......@@ -28,7 +28,7 @@ server s1 {
23
<esi:include 24

> 25
> 25
26
<esi:include aaa /> 27
<esi:include k?=./> 28
......
varnishtest "ESI includes for pre HTTP/1.1 cannot used chunked encoding"
server s1 {
rxreq
expect req.url == "/foo/bar"
txresp -body {
<html>
Before include
<!--esi <esi:include src="body"/> -->
After include
}
rxreq
expect req.url == "/foo/body"
txresp -body {
Included file
}
rxreq
expect req.url == "/foo/bar"
txresp -body {
<html>
Before include
<!--esi <esi:include src="body"/> -->
After include
}
rxreq
expect req.url == "/foo/body"
txresp -body {
Included file
}
} -start
varnish v1 -vcl+backend {
sub vcl_backend_response {
set beresp.do_esi = true;
}
sub vcl_backend_response {
set beresp.do_esi = true;
}
} -start
client c1 {
txreq -url /foo/bar -proto HTTP/1.1
rxresp
expect resp.status == 200
expect resp.bodylen == 151
txreq -url /foo/bar -proto HTTP/1.1
rxresp
expect resp.status == 200
expect resp.bodylen == 67
} -run
client c1 {
txreq -url /foo/bar -proto HTTP/1.0
rxresp
expect resp.status == 200
expect resp.bodylen == 151
txreq -url /foo/bar -proto HTTP/1.0
rxresp
expect resp.status == 200
expect resp.bodylen == 67
} -run
client c1 {
txreq -url /foo/bar -proto ""
rxresp
expect resp.status == 200
expect resp.bodylen == 151
txreq -url /foo/bar -proto ""
rxresp
expect resp.status == 200
expect resp.bodylen == 67
} -run
varnish v1 -expect esi_errors == 0
varnishtest "All white-space object, in multiple storage segments"
server s1 {
rxreq
expect req.url == "/foo"
txresp -nolen -hdr "Connection: close"
send {<x> }
rxreq
expect req.url == "/foo"
txresp -nolen -hdr "Connection: close"
send {<x> }
} -start
varnish v1 -vcl+backend {
sub vcl_backend_response {
set beresp.do_esi = true;
}
sub vcl_backend_response {
set beresp.do_esi = true;
}
} -start
varnish v1 -cliok "debug.fragfetch 4"
client c1 {
txreq -url /foo
rxresp
txreq -url /foo
rxresp
} -run
varnish v1 -expect esi_errors == 0
varnishtest "Check <esi: detector"
server s1 {
rxreq
expect req.url == "/foo"
rxreq
expect req.url == "/foo"
send "HTTP/1.1 200 OK\n"
send "Connection: close\n"
send "Connection: close\n"
send "\n"
send { <a> <esi/> }
send { <a> <esi/> }
} -start
varnish v1 -vcl+backend {
sub vcl_backend_response {
set beresp.do_esi = true;
}
sub vcl_backend_response {
set beresp.do_esi = true;
}
} -start
varnish v1 -cliok "debug.fragfetch 4"
client c1 {
txreq -url /foo
rxresp
txreq -url /foo
rxresp
expect resp.bodylen == 49
} -run
......
......@@ -34,7 +34,7 @@ varnish v1 -vcl+backend {
} -start
client c1 {
txreq
txreq
rxresp
expect resp.bodylen == 73
expect resp.status == 200
......
......@@ -39,7 +39,7 @@ varnish v1 -vcl+backend {
} -start
client c1 {
txreq
txreq
rxresp
expect resp.bodylen == 105
expect resp.status == 200
......
......@@ -6,7 +6,7 @@ server s1 {
} -start
varnish v1 -vcl+backend {
import ${vmod_debug};
import ${vmod_debug};
sub vcl_deliver {
set resp.http.who = debug.author(phk);
}
......@@ -18,7 +18,7 @@ client c1 {
rxresp
} -run
varnish v1 -vcl+backend {
import ${vmod_debug};
import ${vmod_debug};
sub vcl_deliver {
set resp.http.who = debug.author(des);
}
......@@ -30,7 +30,7 @@ client c1 {
} -run
varnish v1 -vcl+backend {
import ${vmod_debug};
import ${vmod_debug};
sub vcl_deliver {
set resp.http.who = debug.author(kristian);
}
......
......@@ -10,7 +10,7 @@ varnish v1 -vcl+backend {
if (req.http.X-Banned == "check") {
unset req.http.X-Banned;
} elseif (req.restarts == 0) {
set req.http.X-Banned = "check";
set req.http.X-Banned = "check";
if (req.http.x-pass) {
return (pass);
} else {
......
......@@ -18,7 +18,7 @@ varnish v1 -vcl+backend {
import ${vmod_std};
sub vcl_deliver {
set resp.http.foo = std.fileread("${tmpdir}" + req.url);
set resp.http.foo = std.fileread("${tmpdir}" + req.url);
}
} -start
......
......@@ -9,21 +9,21 @@ server s1 {
-hdr "Content-Encoding: gzip" \
-hdr "Transfer-Encoding: Chunked"
send "ed\r\n"
sendhex " 1f 8b 08 00 c2 39 33 50 02 03 45 90 4d 6a 03 31"
sendhex " 0c 85 f7 73 8a 47 2e 10 d9 f2 9f ca 34 d0 c2 64"
sendhex " 5b 08 bd 80 2d cb 10 28 5d 34 f4 fe f5 30 d0 68"
sendhex " 25 89 a7 f7 3e b4 be 6f d7 8f db 76 59 e8 28 d8"
sendhex " 10 45 f3 a9 83 b8 18 1c 7b c2 30 55 04 17 13 c4"
sendhex " 0f 07 5f 7a 38 f4 8e 50 b3 37 d4 3a 32 4a 34 07"
sendhex " 8a 9c d1 92 77 48 d4 0a 72 ea 06 5f b3 1c fa dd"
sendhex " 2b b9 88 20 99 e6 9a 3c 84 7c 85 8e 50 e0 59 2a"
sendhex " 42 b0 8a 34 0f 96 d5 1e f7 97 fb b7 7e fd 4e 87"
sendhex " c7 8f be 9e ce fb 74 3a 3f 51 89 a3 9b 7e b2 43"
sendhex " a4 86 a2 55 90 b9 29 4c 4b 83 b8 99 5f b5 bb 27"
sendhex " 6a d4 86 18 22 83 8a 26 f4 11 1a 5c eb 34 3b ca"
sendhex " 20 31 9e 12 29 ff a8 92 78 a2 e6 ec 61 55 12 fc"
sendhex " 68 84 6c 12 41 b9 cf 2f 30 3b f0 10 5e d6 b7 eb"
sendhex " e7 76 bb 2c 7f 8c 90 4a 14 4c 01 00 00"
sendhex " 1f 8b 08 00 c2 39 33 50 02 03 45 90 4d 6a 03 31"
sendhex " 0c 85 f7 73 8a 47 2e 10 d9 f2 9f ca 34 d0 c2 64"
sendhex " 5b 08 bd 80 2d cb 10 28 5d 34 f4 fe f5 30 d0 68"
sendhex " 25 89 a7 f7 3e b4 be 6f d7 8f db 76 59 e8 28 d8"
sendhex " 10 45 f3 a9 83 b8 18 1c 7b c2 30 55 04 17 13 c4"
sendhex " 0f 07 5f 7a 38 f4 8e 50 b3 37 d4 3a 32 4a 34 07"
sendhex " 8a 9c d1 92 77 48 d4 0a 72 ea 06 5f b3 1c fa dd"
sendhex " 2b b9 88 20 99 e6 9a 3c 84 7c 85 8e 50 e0 59 2a"
sendhex " 42 b0 8a 34 0f 96 d5 1e f7 97 fb b7 7e fd 4e 87"
sendhex " c7 8f be 9e ce fb 74 3a 3f 51 89 a3 9b 7e b2 43"
sendhex " a4 86 a2 55 90 b9 29 4c 4b 83 b8 99 5f b5 bb 27"
sendhex " 6a d4 86 18 22 83 8a 26 f4 11 1a 5c eb 34 3b ca"
sendhex " 20 31 9e 12 29 ff a8 92 78 a2 e6 ec 61 55 12 fc"
sendhex " 68 84 6c 12 41 b9 cf 2f 30 3b f0 10 5e d6 b7 eb"
sendhex " e7 76 bb 2c 7f 8c 90 4a 14 4c 01 00 00"
send "\r\n"
chunkedlen 0
rxreq
......@@ -53,13 +53,13 @@ server s1 {
-hdr "Content-Encoding: gzip" \
-hdr "Transfer-Encoding: Chunked"
send "70\r\n"
sendhex " 1f 8b 08 00 c2 39 33 50 02 03 45 90 4d 6a 03 31"
sendhex " 0c 85 f7 73 8a 47 2e 10 d9 f2 9f ca 34 d0 c2 64"
sendhex " 5b 08 bd 80 2d cb 10 28 5d 34 f4 fe f5 30 d0 68"
sendhex " 25 89 a7 f7 3e b4 be 6f d7 8f db 76 59 e8 28 d8"
sendhex " 10 45 f3 a9 83 b8 18 1c 7b c2 30 55 04 17 13 c4"
sendhex " 0f 07 5f 7a 38 f4 8e 50 b3 37 d4 3a 32 4a 34 07"
sendhex " FF FF FF FF FF FF FF FF 72 ea 06 5f b3 1c fa dd"
sendhex " 1f 8b 08 00 c2 39 33 50 02 03 45 90 4d 6a 03 31"
sendhex " 0c 85 f7 73 8a 47 2e 10 d9 f2 9f ca 34 d0 c2 64"
sendhex " 5b 08 bd 80 2d cb 10 28 5d 34 f4 fe f5 30 d0 68"
sendhex " 25 89 a7 f7 3e b4 be 6f d7 8f db 76 59 e8 28 d8"
sendhex " 10 45 f3 a9 83 b8 18 1c 7b c2 30 55 04 17 13 c4"
sendhex " 0f 07 5f 7a 38 f4 8e 50 b3 37 d4 3a 32 4a 34 07"
sendhex " FF FF FF FF FF FF FF FF 72 ea 06 5f b3 1c fa dd"
expect_close
} -start
......@@ -84,13 +84,13 @@ server s1 {
-hdr "Content-Encoding: gzip" \
-hdr "Transfer-Encoding: Chunked"
send "70\r\n"
sendhex " 1f 8b 08 00 c2 39 33 50 02 03 45 90 4d 6a 03 31"
sendhex " 0c 85 f7 73 8a 47 2e 10 d9 f2 9f ca 34 d0 c2 64"
sendhex " 5b 08 bd 80 2d cb 10 28 5d 34 f4 fe f5 30 d0 68"
sendhex " 25 89 a7 f7 3e b4 be 6f d7 8f db 76 59 e8 28 d8"
sendhex " 10 45 f3 a9 83 b8 18 1c 7b c2 30 55 04 17 13 c4"
sendhex " 0f 07 5f 7a 38 f4 8e 50 b3 37 d4 3a 32 4a 34 07"
sendhex " FF FF FF FF FF FF FF FF 72 ea 06 5f b3 1c fa dd"
sendhex " 1f 8b 08 00 c2 39 33 50 02 03 45 90 4d 6a 03 31"
sendhex " 0c 85 f7 73 8a 47 2e 10 d9 f2 9f ca 34 d0 c2 64"
sendhex " 5b 08 bd 80 2d cb 10 28 5d 34 f4 fe f5 30 d0 68"
sendhex " 25 89 a7 f7 3e b4 be 6f d7 8f db 76 59 e8 28 d8"
sendhex " 10 45 f3 a9 83 b8 18 1c 7b c2 30 55 04 17 13 c4"
sendhex " 0f 07 5f 7a 38 f4 8e 50 b3 37 d4 3a 32 4a 34 07"
sendhex " FF FF FF FF FF FF FF FF 72 ea 06 5f b3 1c fa dd"
expect_close
} -start
......
......@@ -31,9 +31,9 @@ varnish v1 -vcl {
varnish v1 -errvcl {include not followed by string constant.} {
/* token test */
error lookup hash pipe pass fetch deliver discard keep restart
include
if else elseif elsif
error lookup hash pipe pass fetch deliver discard keep restart
include
if else elseif elsif
++ -- && || <= == != >= >> << += -= *= /=
{ } ( ) * + - / % > < = ; ! & . | ~ ,
}
......
varnishtest "Test fallback director"
server s1 {
rxreq
txresp -hdr "Foo: 1"
rxreq
txresp -hdr "Foo: 1"
} -start
server s2 {
rxreq
txresp -hdr "Foo: 2"
rxreq
txresp -hdr "Foo: 2"
} -start
server s3 {
rxreq
txresp -hdr "Foo: 3"
rxreq
txresp -hdr "Foo: 3"
} -start
varnish v1 -vcl+backend {
......@@ -25,12 +25,12 @@ varnish v1 -vcl+backend {
fb1.add_backend(s3);
}
sub vcl_recv {
return (pass);
}
sub vcl_backend_fetch {
set bereq.backend = fb1.backend();
}
sub vcl_recv {
return (pass);
}
sub vcl_backend_fetch {
set bereq.backend = fb1.backend();
}
} -start
......@@ -38,24 +38,24 @@ varnish v1 -cliok "backend.set_health s1 sick"
varnish v1 -cliok "backend.set_health s2 sick"
client c1 {
# s1 & s2 are both sick, expect response from s3
txreq
rxresp
expect resp.http.foo == "3"
# s1 & s2 are both sick, expect response from s3
txreq
rxresp
expect resp.http.foo == "3"
} -run
varnish v1 -cliok "backend.set_health s2 healthy"
client c1 {
txreq
rxresp
expect resp.http.foo == "2"
txreq
rxresp
expect resp.http.foo == "2"
} -run
varnish v1 -cliok "backend.set_health s1 healthy"
client c1 {
txreq
rxresp
expect resp.http.foo == "1"
txreq
rxresp
expect resp.http.foo == "1"
} -run
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment