Commit f4cd5d2b authored by Poul-Henning Kamp's avatar Poul-Henning Kamp

Add a test-case that exercises the backend-polling a bit. It does not

really check anything yet, because we lack the stats counters to test.



git-svn-id: http://www.varnish-cache.org/svn/trunk@3112 d4fa192b-c00b-0410-8231-f00ffab90ce4
parent 42a02f70
# $Id: c00016.vtc 3012 2008-07-24 12:22:35Z des $
test "Test Backend Polling"
varnish v1 -vcl {
backend foo {
.host = "127.0.0.1";
.port = "9080";
.probe = {
.timeout = 1 s;
.interval = 0.5 s;
}
}
} -start
server s1 {
rxreq
expect req.url == "/"
txresp -hdr "Bar: foo" -body "foobar"
}
# Handle probes
server s1 -start -wait
server s1 -start -wait
server s1 -start -wait
server s1 -start -wait
server s1 -start -wait
server s1 -start -wait
server s1 -start -wait
server s1 -start -wait
server s1 {
rxreq
expect req.url == "/"
txresp -status 404 -hdr "Bar: foo" -body "foobar"
} -start -wait
server s1 {
rxreq
expect req.url == "/"
txresp -status 200 -hdr "Bar: foo" -body "foobar"
} -start -wait
server s1 {
rxreq
expect req.url == "/"
txresp -proto "FROBOZ" -status 200 -hdr "Bar: foo" -body "foobar"
} -start -wait
server s1 {
} -start -wait
server s1 {
rxreq
expect req.url == "/"
delay 2
} -start -wait
delay 2
varnish v1 -cli "debug.health"
......@@ -167,6 +167,15 @@ cmd_http_expect(CMD_ARGS)
vtc_log(hp->vl, 4, "EXPECT %s (%s) %s %s (%s) match",
av[0], lhs, av[1], av[2], rhs);
}
} else if (!strcmp(cmp, "!=")) {
if (!strcmp(lhs, rhs)) {
vtc_log(hp->vl, 0, "EXPECT %s (%s) %s %s (%s) failed",
av[0], lhs, av[1], av[2], rhs);
exit (1);
} else {
vtc_log(hp->vl, 4, "EXPECT %s (%s) %s %s (%s) match",
av[0], lhs, av[1], av[2], rhs);
}
} else {
vtc_log(hp->vl, 0, "EXPECT %s (%s) %s %s (%s) not implemented",
av[0], lhs, av[1], av[2], rhs);
......
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