Commit 3633f955 authored by Geoff Simmons's avatar Geoff Simmons

sharpen the test for setting the port

parent ce331e71
varnishtest "Test VMOD oob_probe (cf. v00014.vtc)" varnishtest "Test setting the probe port (cf. v00014.vtc)"
server s1 { server s1 {
rxreq rxreq
expect req.url == "/" expect req.url == "/baz"
txresp -body "slash" txresp -body "backend"
rxreq
expect req.url == "/foo"
txresp -body "foo"
} -start } -start
server s2 { server s2 {
rxreq rxreq
sema r1 sync 2
expect req.url == "/" expect req.url == "/"
txresp -body "one" txresp -body "one"
sema r1 sync 2
accept accept
rxreq rxreq
sema r2 sync 2
expect req.url == "/" expect req.url == "/"
txresp -body "two" txresp -body "two"
sema r2 sync 2
accept accept
rxreq
expect req.url == "/"
txresp -body "three"
} -start } -start
varnish v1 -vcl { varnish v1 -vcl {
...@@ -47,6 +47,9 @@ varnish v1 -vcl { ...@@ -47,6 +47,9 @@ varnish v1 -vcl {
} }
sub vcl_recv { sub vcl_recv {
if (req.url == "/baz") {
return(pass);
}
if (std.healthy(default)) { if (std.healthy(default)) {
return(synth(200,"Backend healthy")); return(synth(200,"Backend healthy"));
} else { } else {
...@@ -61,12 +64,21 @@ client c1 { ...@@ -61,12 +64,21 @@ client c1 {
txreq txreq
rxresp rxresp
expect resp.status == 500 expect resp.status == 500
expect resp.body ~ "Backend sick"
sema r1 sync 2 sema r1 sync 2
txreq -url "/foo" txreq -url "/foo"
rxresp rxresp
expect resp.status == 500 expect resp.status == 500
expect resp.body ~ "Backend sick"
sema r2 sync 2 sema r2 sync 2
txreq -url "/bar" txreq -url "/bar"
rxresp rxresp
expect resp.status == 200 expect resp.status == 200
expect resp.body ~ "Backend healthy"
txreq -url "/baz"
rxresp
expect resp.status == 200
expect resp.body == "backend"
} -run } -run
varnish v1 -expect VBE.vcl1.default.happy > 0
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