]> err.no Git - varnish/commitdiff
VCL/VRT testcase for proto/request/url/response fields.
authorphk <phk@d4fa192b-c00b-0410-8231-f00ffab90ce4>
Fri, 27 Jun 2008 11:04:54 +0000 (11:04 +0000)
committerphk <phk@d4fa192b-c00b-0410-8231-f00ffab90ce4>
Fri, 27 Jun 2008 11:04:54 +0000 (11:04 +0000)
git-svn-id: svn+ssh://projects.linpro.no/svn/varnish/trunk@2846 d4fa192b-c00b-0410-8231-f00ffab90ce4

varnish-cache/bin/varnishtest/tests/v00001.vtc [new file with mode: 0644]

diff --git a/varnish-cache/bin/varnishtest/tests/v00001.vtc b/varnish-cache/bin/varnishtest/tests/v00001.vtc
new file mode 100644 (file)
index 0000000..385e571
--- /dev/null
@@ -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