]> err.no Git - varnish/commitdiff
Add a testcase which panics the child, see the manager restart it.
authorphk <phk@d4fa192b-c00b-0410-8231-f00ffab90ce4>
Tue, 22 Jul 2008 08:21:29 +0000 (08:21 +0000)
committerphk <phk@d4fa192b-c00b-0410-8231-f00ffab90ce4>
Tue, 22 Jul 2008 08:21:29 +0000 (08:21 +0000)
git-svn-id: svn+ssh://projects.linpro.no/svn/varnish/trunk@2985 d4fa192b-c00b-0410-8231-f00ffab90ce4

varnish-cache/bin/varnishtest/tests/v00010.vtc [new file with mode: 0644]

diff --git a/varnish-cache/bin/varnishtest/tests/v00010.vtc b/varnish-cache/bin/varnishtest/tests/v00010.vtc
new file mode 100644 (file)
index 0000000..3ef4486
--- /dev/null
@@ -0,0 +1,41 @@
+# $Id: v00005.vtc 2906 2008-07-08 10:29:07Z phk $
+
+test "VCL: check panic and restart"
+
+server s1 {
+       rxreq
+       txresp -hdr "Foo: bar" -body "abcdef\n"
+       rxreq
+       txresp -hdr "Panic: please" -body "012345\n"
+       sema r1 sync 2
+} -start
+
+varnish v1 -vcl+backend {
+
+       sub vcl_fetch {
+               if (obj.http.panic) {
+                       panic "Had Panic header: " obj.http.panic;
+               }
+       }
+} -start -cli "param.set diag_bitmap 0x00001000"
+
+
+client c1 {
+       txreq -url "/"
+       rxresp
+       txreq -url "/foo"
+       # Don't expect answer, the server crashed.
+       sema r1 sync 2
+       delay .5
+} -run
+
+server s1 {
+       rxreq
+       txresp -hdr "Foo: foo" -body "abcdef\n"
+} -start
+
+client c1 {
+       txreq -url "/"
+       rxresp
+       expect resp.http.foo == "foo"
+} -run