From: phk Date: Fri, 27 Jun 2008 12:44:47 +0000 (+0000) Subject: Add test for simple restarts X-Git-Url: https://err.no/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=9c2a0963b4e96f6de5f21935bc3cf2f643cc4821;p=varnish Add test for simple restarts git-svn-id: svn+ssh://projects.linpro.no/svn/varnish/trunk@2853 d4fa192b-c00b-0410-8231-f00ffab90ce4 --- diff --git a/varnish-cache/bin/varnishtest/tests/c00009.vtc b/varnish-cache/bin/varnishtest/tests/c00009.vtc new file mode 100644 index 00000000..29241235 --- /dev/null +++ b/varnish-cache/bin/varnishtest/tests/c00009.vtc @@ -0,0 +1,40 @@ +# $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