r3465 - trunk/varnish-cache/bin/varnishtest/tests

phk at projects.linpro.no phk at projects.linpro.no
Thu Dec 18 11:13:42 CET 2008


Author: phk
Date: 2008-12-18 11:13:42 +0100 (Thu, 18 Dec 2008)
New Revision: 3465

Added:
   trunk/varnish-cache/bin/varnishtest/tests/r00412.vtc
Log:
Add regression test for ticket 412



Added: trunk/varnish-cache/bin/varnishtest/tests/r00412.vtc
===================================================================
--- trunk/varnish-cache/bin/varnishtest/tests/r00412.vtc	                        (rev 0)
+++ trunk/varnish-cache/bin/varnishtest/tests/r00412.vtc	2008-12-18 10:13:42 UTC (rev 3465)
@@ -0,0 +1,36 @@
+# $Id$
+
+test "Regression test for ticket 412"
+
+server s1 {
+	rxreq
+	expect req.url == "/"
+	txresp -status 303 -hdr "Location: /foo" 
+	rxreq
+	expect req.url == "/foo"
+	txresp -body "12345"
+} -start
+
+varnish v1 -vcl+backend {
+	sub vcl_fetch {
+		if (obj.status == 303) {
+			set obj.cacheable = true;
+			set obj.ttl = 60 s;
+			set obj.http.X-Magic-Redirect = "1";
+			set req.url = obj.http.Location;
+			restart;
+		}
+	}
+	sub vcl_hit {
+		if (obj.http.X-Magic-Redirect == "1") {
+			set req.url = obj.http.Location;
+			restart;
+		}
+	}
+} -start
+
+client c1 {
+	txreq
+	rxresp
+	expect resp.status == 200
+} -run



More information about the varnish-commit mailing list