From 02e8e600f0a10700fbc02a9ee0f94cc433afb0ff Mon Sep 17 00:00:00 2001 From: phk Date: Fri, 27 Jun 2008 13:31:27 +0000 Subject: [PATCH] Test switching of VCLs git-svn-id: svn+ssh://projects.linpro.no/svn/varnish/trunk@2860 d4fa192b-c00b-0410-8231-f00ffab90ce4 --- .../bin/varnishtest/tests/c00015.vtc | 56 +++++++++++++++++++ 1 file changed, 56 insertions(+) create mode 100644 varnish-cache/bin/varnishtest/tests/c00015.vtc diff --git a/varnish-cache/bin/varnishtest/tests/c00015.vtc b/varnish-cache/bin/varnishtest/tests/c00015.vtc new file mode 100644 index 00000000..505623a3 --- /dev/null +++ b/varnish-cache/bin/varnishtest/tests/c00015.vtc @@ -0,0 +1,56 @@ +# $Id$ + +test "Test switching VCLs" + +server s1 { + rxreq + expect req.url == "/foo" + txresp -body "foobar" + rxreq + expect req.url == "/foo" + txresp -body "foobar1" +} -start + +varnish v1 -vcl+backend { +} -start + +varnish v1 -vcl+backend { + sub vcl_recv { + pass; + } +} + +varnish v1 -cli "vcl.list" +varnish v1 -cli "vcl.use vcl1" + +client c1 { + txreq -url "/foo" + rxresp + expect resp.status == 200 + expect resp.http.content-length == 6 + expect resp.http.x-varnish == "1001" +} -start + +varnish v1 -cli "vcl.use vcl2" + +client c2 { + txreq -url "/foo" + rxresp + expect resp.status == 200 + expect resp.http.content-length == 7 + expect resp.http.x-varnish == "1002" +} -start + +varnish v1 -cli "vcl.use vcl1" + +client c3 { + txreq -url "/foo" + rxresp + expect resp.status == 200 + expect resp.http.content-length == 6 + expect resp.http.x-varnish == "1003 1001" +} -start + +varnish v1 -cli "vcl.show vcl2" +varnish v1 -cli "vcl.discard vcl2" +varnish v1 -cli "vcl.list" -- 2.39.5