[experimental-ims] 4a75131 Add testcase for restart in vcl_miss{}

Geoff Simmons geoff at varnish-cache.org
Tue Jan 24 18:30:29 CET 2012


commit 4a75131dbe4d95f6de7bc54848975c3da6e25abd
Author: Poul-Henning Kamp <phk at FreeBSD.org>
Date:   Tue Jan 24 10:49:45 2012 +0000

    Add testcase for restart in vcl_miss{}

diff --git a/bin/varnishtest/tests/v00037.vtc b/bin/varnishtest/tests/v00037.vtc
new file mode 100644
index 0000000..e7759a6
--- /dev/null
+++ b/bin/varnishtest/tests/v00037.vtc
@@ -0,0 +1,30 @@
+varnishtest "test restart in miss"
+
+server s1 {
+	rxreq
+	txresp -body "FOOBAR"
+} -start
+
+varnish v1 -vcl+backend {
+
+	sub vcl_recv {
+		if (req.restarts > 0) {
+			unset req.http.foobar;
+		}
+	}
+
+	sub vcl_miss {
+		if (req.http.foobar) {
+			return (restart);
+		}
+	}
+	sub vcl_deliver {
+		set resp.http.restarts = req.restarts;
+	}
+} -start
+
+client c1 {
+	txreq -hdr "foobar: snafu"
+	rxresp
+	expect resp.http.restarts == 1
+} -run



More information about the varnish-commit mailing list