r3659 - branches/2.0/varnish-cache/bin/varnishtest/tests
tfheen at projects.linpro.no
tfheen at projects.linpro.no
Fri Feb 6 13:16:25 CET 2009
Author: tfheen
Date: 2009-02-06 13:16:25 +0100 (Fri, 06 Feb 2009)
New Revision: 3659
Added:
branches/2.0/varnish-cache/bin/varnishtest/tests/r00412.vtc
Log:
Merge r3465: Add regression test for ticket 412
Copied: branches/2.0/varnish-cache/bin/varnishtest/tests/r00412.vtc (from rev 3465, trunk/varnish-cache/bin/varnishtest/tests/r00412.vtc)
===================================================================
--- branches/2.0/varnish-cache/bin/varnishtest/tests/r00412.vtc (rev 0)
+++ branches/2.0/varnish-cache/bin/varnishtest/tests/r00412.vtc 2009-02-06 12:16:25 UTC (rev 3659)
@@ -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