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