r5066 - trunk/varnish-cache/bin/varnishtest/tests
kristian at varnish-cache.org
kristian at varnish-cache.org
Mon Aug 2 21:29:50 CEST 2010
Author: kristian
Date: 2010-08-02 21:29:49 +0200 (Mon, 02 Aug 2010)
New Revision: 5066
Added:
trunk/varnish-cache/bin/varnishtest/tests/c00035.vtc
Log:
Test-case for return(refresh)
Added: trunk/varnish-cache/bin/varnishtest/tests/c00035.vtc
===================================================================
--- trunk/varnish-cache/bin/varnishtest/tests/c00035.vtc (rev 0)
+++ trunk/varnish-cache/bin/varnishtest/tests/c00035.vtc 2010-08-02 19:29:49 UTC (rev 5066)
@@ -0,0 +1,38 @@
+# $Id: c00024.vtc 4651 2010-04-08 16:21:16Z phk $
+
+test "Test return(refresh) in vcl_recv"
+
+server s1 {
+ rxreq
+ txresp -hdr "Inc: 1"
+ rxreq
+ txresp -hdr "Inc: 2"
+} -start
+
+varnish v1 -vcl+backend {
+ sub vcl_recv {
+ if (req.http.x-refresh == "1") {
+ return(refresh);
+ }
+ }
+ } -start
+
+client c1 {
+ txreq -url "/"
+ rxresp
+ expect resp.status == 200
+ expect resp.http.Inc == "1"
+ txreq -url "/"
+ rxresp
+ expect resp.status == 200
+ expect resp.http.Inc == "1"
+ txreq -url "/" -hdr "x-refresh: 1"
+ rxresp
+ expect resp.status == 200
+ expect resp.http.Inc == "2"
+ txreq -url "/"
+ rxresp
+ expect resp.status == 200
+ expect resp.http.Inc == "2"
+} -run
+
More information about the varnish-commit
mailing list