From 95353b67488978270f3b1def37b70a342bf7e22d Mon Sep 17 00:00:00 2001 From: phk Date: Fri, 27 Jun 2008 11:04:54 +0000 Subject: [PATCH] VCL/VRT testcase for proto/request/url/response fields. git-svn-id: svn+ssh://projects.linpro.no/svn/varnish/trunk@2846 d4fa192b-c00b-0410-8231-f00ffab90ce4 --- .../bin/varnishtest/tests/v00001.vtc | 57 +++++++++++++++++++ 1 file changed, 57 insertions(+) create mode 100644 varnish-cache/bin/varnishtest/tests/v00001.vtc diff --git a/varnish-cache/bin/varnishtest/tests/v00001.vtc b/varnish-cache/bin/varnishtest/tests/v00001.vtc new file mode 100644 index 00000000..385e5713 --- /dev/null +++ b/varnish-cache/bin/varnishtest/tests/v00001.vtc @@ -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 -- 2.39.5