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

Add test for simple restarts



git-svn-id: http://www.varnish-cache.org/svn/trunk/varnish-cache@2853 d4fa192b-c00b-0410-8231-f00ffab90ce4
parent dd6a63af
# $Id$
test "Test restarts"
server s1 {
rxreq
expect req.url == "/foo"
txresp -status 404
} -start
server s2 -listen 127.0.0.1:9180 {
rxreq
expect req.url == "/foo"
txresp -body "foobar"
} -start
varnish v1 -vcl+backend {
sub vcl_recv {
if (req.restarts == 0) {
set req.backend = s1;
} else {
set req.backend = s2;
}
}
sub vcl_fetch {
if (obj.status != 200) {
restart;
}
}
} -start
client c1 {
txreq -url "/foo"
rxresp
expect resp.status == 200
expect resp.http.content-length == 6
}
client c1 -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