r4983 - trunk/varnish-cache/bin/varnishtest/tests

phk at varnish-cache.org phk at varnish-cache.org
Tue Jun 22 14:22:03 CEST 2010


Author: phk
Date: 2010-06-22 14:22:03 +0200 (Tue, 22 Jun 2010)
New Revision: 4983

Added:
   trunk/varnish-cache/bin/varnishtest/tests/v00027.vtc
Log:
Add testcase to check that backends named "default" get used as such.



Added: trunk/varnish-cache/bin/varnishtest/tests/v00027.vtc
===================================================================
--- trunk/varnish-cache/bin/varnishtest/tests/v00027.vtc	                        (rev 0)
+++ trunk/varnish-cache/bin/varnishtest/tests/v00027.vtc	2010-06-22 12:22:03 UTC (rev 4983)
@@ -0,0 +1,36 @@
+# $Id$
+
+test "Check that backend named 'default' is the default"
+
+server s1 {
+	rxreq
+	txresp -bodylen 25
+} -start
+
+server s2 {
+	rxreq
+	txresp -bodylen 52
+} -start
+
+varnish v1 -vcl {
+	backend s1 {
+		.host = "${s1_addr}"; 
+		.port = "${s1_port}";
+	}
+	backend default {
+		.host = "${s2_addr}";
+		.port = "${s2_port}";
+	}
+
+	sub vcl_recv {
+		if (req.url != req.url) {
+			set req.backend = s1;
+		}
+	}
+} -start
+
+client c1 {
+	txreq
+	rxresp
+	expect resp.bodylen == 52
+} -run




More information about the varnish-commit mailing list