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

phk at projects.linpro.no phk at projects.linpro.no
Fri Jun 27 13:04:55 CEST 2008


Author: phk
Date: 2008-06-27 13:04:54 +0200 (Fri, 27 Jun 2008)
New Revision: 2846

Added:
   trunk/varnish-cache/bin/varnishtest/tests/v00001.vtc
Log:
VCL/VRT testcase for proto/request/url/response fields.



Added: trunk/varnish-cache/bin/varnishtest/tests/v00001.vtc
===================================================================
--- trunk/varnish-cache/bin/varnishtest/tests/v00001.vtc	                        (rev 0)
+++ trunk/varnish-cache/bin/varnishtest/tests/v00001.vtc	2008-06-27 11:04:54 UTC (rev 2846)
@@ -0,0 +1,57 @@
+# $Id$
+
+test "VCL/VRT: misc"
+
+
+server s1 {
+	rxreq 
+	txresp -hdr "Connection: close" -body "012345\n"
+}
+
+server s1 -start 
+
+varnish v1 -vcl+backend {
+	sub vcl_recv {
+		set req.http.foobar =
+		    req.url
+		    req.request
+		    req.proto;
+		set req.url = "/";
+		set req.proto = "HTTP/1.2";
+		set req.request = "GET";
+	}
+	sub vcl_miss {
+		set bereq.http.foobar =
+		    bereq.url
+		    bereq.proto;
+		set bereq.url = "/";
+		set bereq.proto = "HTTP/1.2";
+		set bereq.request = "GET";
+	}
+	sub vcl_fetch {
+		set obj.http.foobar =
+		    obj.proto obj.response;
+		set obj.proto = "HTTP/1.2";
+		set obj.response = "For circular files";
+	}
+	sub vcl_deliver {
+		set resp.proto = "HTTP/1.2";
+		set resp.response = "Naah, lets fail it";
+		set resp.http.foobar =
+		    resp.proto
+		    resp.status;
+		error 904 "because I say so:";
+	}
+} -start
+
+client c1 {
+	txreq -url "/"
+	rxresp
+	expect resp.status == 904
+}
+
+client c1 -run
+
+server s1 -wait
+
+varnish v1 -stop




More information about the varnish-commit mailing list