r2860 - trunk/varnish-cache/bin/varnishtest/tests
phk at projects.linpro.no
phk at projects.linpro.no
Fri Jun 27 15:31:27 CEST 2008
Author: phk
Date: 2008-06-27 15:31:27 +0200 (Fri, 27 Jun 2008)
New Revision: 2860
Added:
trunk/varnish-cache/bin/varnishtest/tests/c00015.vtc
Log:
Test switching of VCLs
Added: trunk/varnish-cache/bin/varnishtest/tests/c00015.vtc
===================================================================
--- trunk/varnish-cache/bin/varnishtest/tests/c00015.vtc (rev 0)
+++ trunk/varnish-cache/bin/varnishtest/tests/c00015.vtc 2008-06-27 13:31:27 UTC (rev 2860)
@@ -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"
More information about the varnish-commit
mailing list