]> err.no Git - varnish/commitdiff
Add a Vary testcase
authorphk <phk@d4fa192b-c00b-0410-8231-f00ffab90ce4>
Wed, 25 Jun 2008 20:53:43 +0000 (20:53 +0000)
committerphk <phk@d4fa192b-c00b-0410-8231-f00ffab90ce4>
Wed, 25 Jun 2008 20:53:43 +0000 (20:53 +0000)
git-svn-id: svn+ssh://projects.linpro.no/svn/varnish/trunk@2809 d4fa192b-c00b-0410-8231-f00ffab90ce4

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

diff --git a/varnish-cache/bin/varnishtest/tests/c00004.vtc b/varnish-cache/bin/varnishtest/tests/c00004.vtc
new file mode 100644 (file)
index 0000000..7d0b31b
--- /dev/null
@@ -0,0 +1,55 @@
+# $Id$
+
+test "Test Vary functionality"
+
+varnish v1 -arg "-b 127.0.0.1:9080" -start
+
+server s1 {
+       rxreq
+       expect req.http.foobar == "1"
+       txresp -hdr "Vary: Foobar" -hdr "Snafu: 1" -hdr "Content-Length: 5" -body "1111\n"
+       rxreq
+       expect req.http.foobar == "2"
+       txresp -hdr "Vary: Foobar" -hdr "Snafu: 2" -hdr "Content-Length: 5" -body "2222\n"
+       rxreq
+       expect req.http.foobar == "3"
+       txresp -hdr "Vary: Foobar" -hdr "Snafu: 3" -hdr "Content-Length: 5" -body "3333\n"
+       rxreq
+       expect req.http.foobar == "4"
+       txresp -hdr "Vary: Foobar" -hdr "Snafu: 4" -hdr "Content-Length: 5" -body "4444\n"
+} -start
+
+client c1 {
+       txreq -hdr "Foobar: 1"
+       rxresp
+       expect resp.status == 200
+       expect resp.http.X-Varnish == "1001"
+       expect resp.http.snafu == "1"
+
+       txreq -hdr "Foobar: 2"
+       rxresp
+       expect resp.status == 200
+       expect resp.http.X-Varnish == "1002"
+       expect resp.http.snafu == "2"
+
+       txreq -hdr "Foobar: 3"
+       rxresp
+       expect resp.status == 200
+       expect resp.http.X-Varnish == "1003"
+       expect resp.http.snafu == "3"
+
+       txreq -hdr "Foobar: 4"
+       rxresp
+       expect resp.status == 200
+       expect resp.http.X-Varnish == "1004"
+       expect resp.http.snafu == "4"
+
+       txreq -hdr "Foobar: 1"
+       rxresp
+       expect resp.status == 200
+       expect resp.http.X-Varnish == "1005 1001"
+       expect resp.http.snafu == "1"
+
+}
+
+client c1 -run