From e6806ff19caccd07a0aa456295ca35739398d138 Mon Sep 17 00:00:00 2001 From: phk Date: Wed, 25 Jun 2008 20:53:43 +0000 Subject: [PATCH] Add a Vary testcase git-svn-id: svn+ssh://projects.linpro.no/svn/varnish/trunk@2809 d4fa192b-c00b-0410-8231-f00ffab90ce4 --- .../bin/varnishtest/tests/c00004.vtc | 55 +++++++++++++++++++ 1 file changed, 55 insertions(+) create mode 100644 varnish-cache/bin/varnishtest/tests/c00004.vtc diff --git a/varnish-cache/bin/varnishtest/tests/c00004.vtc b/varnish-cache/bin/varnishtest/tests/c00004.vtc new file mode 100644 index 00000000..7d0b31b1 --- /dev/null +++ b/varnish-cache/bin/varnishtest/tests/c00004.vtc @@ -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 -- 2.39.5