Commit 88de5286 authored by Poul-Henning Kamp's avatar Poul-Henning Kamp

Update testcases to use macros where possible (that is: client -connect)

and make the listen address explicit where we depend on it, rather
than rely on the default port to be 9080.



git-svn-id: http://www.varnish-cache.org/svn/trunk/varnish-cache@4363 d4fa192b-c00b-0410-8231-f00ffab90ce4
parent db634463
...@@ -2,14 +2,14 @@ ...@@ -2,14 +2,14 @@
test "basic default HTTP transactions" test "basic default HTTP transactions"
server s1 -listen 127.0.0.1:9080 { server s1 {
rxreq rxreq
txresp txresp
} }
server s1 -start server s1 -start
client c1 -connect 127.0.0.1:9080 { client c1 -connect $s1_sock {
txreq txreq
rxresp rxresp
} }
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
test "basic default HTTP transactions with expect" test "basic default HTTP transactions with expect"
server s1 -listen 127.0.0.1:9080 { server s1 {
rxreq rxreq
expect req.request == GET expect req.request == GET
expect req.proto == HTTP/1.1 expect req.proto == HTTP/1.1
...@@ -12,7 +12,7 @@ server s1 -listen 127.0.0.1:9080 { ...@@ -12,7 +12,7 @@ server s1 -listen 127.0.0.1:9080 {
server s1 -start server s1 -start
client c1 -connect 127.0.0.1:9080 { client c1 -connect $s1_sock {
txreq txreq
rxresp rxresp
expect resp.proto == HTTP/1.1 expect resp.proto == HTTP/1.1
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
test "basic default HTTP transactions with expect and options" test "basic default HTTP transactions with expect and options"
server s1 -listen 127.0.0.1:9080 { server s1 {
rxreq rxreq
expect req.request == PUT expect req.request == PUT
expect req.proto == HTTP/1.0 expect req.proto == HTTP/1.0
...@@ -12,7 +12,7 @@ server s1 -listen 127.0.0.1:9080 { ...@@ -12,7 +12,7 @@ server s1 -listen 127.0.0.1:9080 {
server s1 -start server s1 -start
client c1 -connect 127.0.0.1:9080 { client c1 -connect $s1_sock {
txreq -req PUT -proto HTTP/1.0 -url /foo txreq -req PUT -proto HTTP/1.0 -url /foo
rxresp rxresp
expect resp.proto == HTTP/1.2 expect resp.proto == HTTP/1.2
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
test "dual shared server HTTP transactions" test "dual shared server HTTP transactions"
server s1 -listen 127.0.0.1:9080 -repeat 2 { server s1 -repeat 2 {
rxreq rxreq
expect req.request == PUT expect req.request == PUT
expect req.proto == HTTP/1.0 expect req.proto == HTTP/1.0
...@@ -12,7 +12,7 @@ server s1 -listen 127.0.0.1:9080 -repeat 2 { ...@@ -12,7 +12,7 @@ server s1 -listen 127.0.0.1:9080 -repeat 2 {
server s1 -start server s1 -start
client c1 -connect 127.0.0.1:9080 { client c1 -connect $s1_sock {
txreq -req PUT -proto HTTP/1.0 -url /foo txreq -req PUT -proto HTTP/1.0 -url /foo
rxresp rxresp
expect resp.proto == HTTP/1.2 expect resp.proto == HTTP/1.2
...@@ -20,7 +20,7 @@ client c1 -connect 127.0.0.1:9080 { ...@@ -20,7 +20,7 @@ client c1 -connect 127.0.0.1:9080 {
expect resp.msg == Foo expect resp.msg == Foo
} }
client c2 -connect 127.0.0.1:9080 { client c2 -connect $s1_sock {
txreq -req PUT -proto HTTP/1.0 -url /foo txreq -req PUT -proto HTTP/1.0 -url /foo
rxresp rxresp
expect resp.proto == HTTP/1.2 expect resp.proto == HTTP/1.2
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
test "bidirectional message bodies" test "bidirectional message bodies"
server s1 -listen 127.0.0.1:9080 { server s1 {
rxreq rxreq
expect req.request == PUT expect req.request == PUT
expect req.proto == HTTP/1.0 expect req.proto == HTTP/1.0
...@@ -13,7 +13,7 @@ server s1 -listen 127.0.0.1:9080 { ...@@ -13,7 +13,7 @@ server s1 -listen 127.0.0.1:9080 {
server s1 -start server s1 -start
client c1 -connect 127.0.0.1:9080 { client c1 -connect $s1_sock {
txreq -req PUT -proto HTTP/1.0 -url /foo \ txreq -req PUT -proto HTTP/1.0 -url /foo \
-body "123456789\n" -body "123456789\n"
rxresp rxresp
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
test "TCP reuse" test "TCP reuse"
server s1 -listen 127.0.0.1:9080 { server s1 {
rxreq rxreq
expect req.url == "/1" expect req.url == "/1"
txresp -body "123456789\n" txresp -body "123456789\n"
...@@ -13,7 +13,7 @@ server s1 -listen 127.0.0.1:9080 { ...@@ -13,7 +13,7 @@ server s1 -listen 127.0.0.1:9080 {
server s1 -start server s1 -start
client c1 -connect 127.0.0.1:9080 { client c1 -connect $s1_sock {
txreq -url "/1" -req "POST" -body "abcdefghi\n" txreq -url "/1" -req "POST" -body "abcdefghi\n"
rxresp rxresp
txreq -url "/2" -req "POST" -body "ihgfedcba\n" txreq -url "/2" -req "POST" -body "ihgfedcba\n"
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
test "simply test that the framework support \0" test "simply test that the framework support \0"
server s1 -listen 127.0.0.1:9080 { server s1 {
rxreq rxreq
expect req.url == "/" expect req.url == "/"
txresp -body {a\0bc} txresp -body {a\0bc}
...@@ -10,7 +10,7 @@ server s1 -listen 127.0.0.1:9080 { ...@@ -10,7 +10,7 @@ server s1 -listen 127.0.0.1:9080 {
server s1 -start server s1 -start
client c1 -connect 127.0.0.1:9080 { client c1 -connect $s1_sock {
txreq txreq
rxresp rxresp
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
test "Check the between_bytes_timeout behaves from backend definition" test "Check the between_bytes_timeout behaves from backend definition"
server s1 { server s1 -listen 127.0.0.1:9080 {
rxreq rxreq
send "HTTP/1.1 200 Ok\r\nConnection: close\r\n\r\n" send "HTTP/1.1 200 Ok\r\nConnection: close\r\n\r\n"
delay 1.5 delay 1.5
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
test "Check that the first_byte_timeout works from backend definition" test "Check that the first_byte_timeout works from backend definition"
server s1 { server s1 -listen 127.0.0.1:9080 {
rxreq rxreq
delay 1.5 delay 1.5
txresp txresp
......
...@@ -2,8 +2,6 @@ ...@@ -2,8 +2,6 @@
test "Test Vary functionality" test "Test Vary functionality"
varnish v1 -arg "-b 127.0.0.1:9080" -start
server s1 { server s1 {
rxreq rxreq
expect req.http.foobar == "1" expect req.http.foobar == "1"
...@@ -18,6 +16,8 @@ server s1 { ...@@ -18,6 +16,8 @@ server s1 {
txresp -hdr "Vary: Foobar" -hdr "Snafu: 4" -body "4444\n" txresp -hdr "Vary: Foobar" -hdr "Snafu: 4" -body "4444\n"
} -start } -start
varnish v1 -vcl+backend {} -start
client c1 { client c1 {
txreq -hdr "Foobar: 1" txreq -hdr "Foobar: 1"
rxresp rxresp
......
...@@ -2,6 +2,12 @@ ...@@ -2,6 +2,12 @@
test "Test Backend Polling" test "Test Backend Polling"
server s1 -listen 127.0.0.1:9080 {
rxreq
expect req.url == "/"
txresp -hdr "Bar: foo" -body "foobar"
} -start
varnish v1 -vcl { varnish v1 -vcl {
backend foo { backend foo {
...@@ -15,11 +21,6 @@ varnish v1 -vcl { ...@@ -15,11 +21,6 @@ varnish v1 -vcl {
} -start } -start
server s1 {
rxreq
expect req.url == "/"
txresp -hdr "Bar: foo" -body "foobar"
}
# Handle probes # Handle probes
server s1 -start -wait server s1 -start -wait
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
test "Test restart in vcl_error" test "Test restart in vcl_error"
server s1 { server s1 -listen 127.0.0.1:9080 {
rxreq rxreq
txresp txresp
} -start } -start
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
test "Test that saintmode_threshold in VCL" test "Test that saintmode_threshold in VCL"
server s1 { server s1 -listen 127.0.0.1:9080 {
rxreq rxreq
txresp txresp
......
...@@ -22,7 +22,6 @@ client c1 { ...@@ -22,7 +22,6 @@ client c1 {
} -run } -run
varnish v1 -stop varnish v1 -stop
server s1 -wait
varnish v1 -vcl+backend { varnish v1 -vcl+backend {
sub vcl_hit { sub vcl_hit {
...@@ -30,6 +29,8 @@ varnish v1 -vcl+backend { ...@@ -30,6 +29,8 @@ varnish v1 -vcl+backend {
} }
} }
server s1 -wait
varnish v1 -start varnish v1 -start
client c1 { client c1 {
...@@ -42,17 +43,17 @@ client c1 { ...@@ -42,17 +43,17 @@ client c1 {
varnish v1 -stop varnish v1 -stop
server s1 {
rxreq
txresp -hdr "Foo: bar"
} -start
varnish v1 -vcl+backend { } varnish v1 -vcl+backend { }
delay 2 delay 2
varnish v1 -start varnish v1 -start
server s1 {
rxreq
txresp -hdr "Foo: bar"
} -start
client c1 { client c1 {
txreq -url "/" txreq -url "/"
rxresp rxresp
......
...@@ -34,7 +34,7 @@ server s1 { ...@@ -34,7 +34,7 @@ server s1 {
txresp -hdr "Foo: bar" txresp -hdr "Foo: bar"
} -start } -start
varnish v1 -start varnish v1 -vcl+backend {} -start
varnish v1 -cliok purge.list varnish v1 -cliok purge.list
......
...@@ -35,7 +35,11 @@ server s1 -wait { ...@@ -35,7 +35,11 @@ server s1 -wait {
txresp -hdr "Foo: foo2" txresp -hdr "Foo: foo2"
} -start } -start
varnish v1 -start varnish v1 -vcl+backend {
sub vcl_fetch {
set beresp.ttl = 3s;
}
} -start
delay 5 delay 5
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
test "Regression test for ticket #306, random director ignoring good backend" test "Regression test for ticket #306, random director ignoring good backend"
server s1 { server s1 -listen 127.0.0.1:9080 {
rxreq rxreq
expect req.url == /foo expect req.url == /foo
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
test "Check saint mode with sick pages" test "Check saint mode with sick pages"
server s1 -listen 127.0.0.1:9080 { server s1 {
timeout 10 timeout 10
rxreq rxreq
...@@ -16,8 +16,7 @@ server s1 -listen 127.0.0.1:9080 { ...@@ -16,8 +16,7 @@ server s1 -listen 127.0.0.1:9080 {
txresp -status 200 -hdr "foo: 3" txresp -status 200 -hdr "foo: 3"
} -start } -start
varnish v1 -vcl { varnish v1 -vcl+backend {
backend b { .host = "127.0.0.1"; .port = "9080"; }
sub vcl_fetch { sub vcl_fetch {
set beresp.ttl = 1s; set beresp.ttl = 1s;
set beresp.grace = 10m; set beresp.grace = 10m;
......
...@@ -4,17 +4,13 @@ test "VCL: Test backend retirement" ...@@ -4,17 +4,13 @@ test "VCL: Test backend retirement"
# First do one request to get a work-thread that holds a VCL reference # First do one request to get a work-thread that holds a VCL reference
server s1 -listen 127.0.0.1:9080 { server s1 {
rxreq rxreq
txresp txresp
} -start } -start
# Only one pool, to avoid getting more than one work thread # Only one pool, to avoid getting more than one work thread
varnish v1 -arg "-p thread_pools=1 -w1,1,300" -vcl { varnish v1 -arg "-p thread_pools=1 -w1,1,300" -vcl+backend {
backend b1 {
.host = "127.0.0.1";
.port = "9080";
}
} -start } -start
client c1 { client c1 {
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
test "Check backend connection limit" test "Check backend connection limit"
server s1 { server s1 -listen 127.0.0.1:9080 {
rxreq rxreq
sema r1 sync 2 sema r1 sync 2
sema r2 sync 2 sema r2 sync 2
......
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