[master] 1c18366 Make this test-case Jail compatible

Poul-Henning Kamp phk at FreeBSD.org
Wed Mar 30 01:30:08 CEST 2016


commit 1c18366e1a0dfc9a8883d629b3bc734ecd9bb533
Author: Poul-Henning Kamp <phk at FreeBSD.org>
Date:   Tue Mar 29 23:28:57 2016 +0000

    Make this test-case Jail compatible

diff --git a/bin/varnishtest/tests/m00023.vtc b/bin/varnishtest/tests/m00023.vtc
index b45d5bf..0434b84 100644
--- a/bin/varnishtest/tests/m00023.vtc
+++ b/bin/varnishtest/tests/m00023.vtc
@@ -1,16 +1,22 @@
-varnishtest "Test VMOD ACLs"
+varnishtest "Test VMOD ACLs (jail-compatible)"
 
-varnish v1 -vcl {
-	import debug;
+server s1 {
+	rxreq
+	txresp
+} -start
 
-	backend dummy {
-		.host = "${bad_ip}";
-	}
+varnish v1 -vcl+backend {
+	import debug;
 
 	acl loopback {
 		"127"/24;
 	}
 
+	acl local {
+		// We assume c1 and s1 comes from same address
+		"${s1_addr}"/24;
+	}
+
 	sub vcl_init {
 		if (!debug.match_acl(loopback, "127.0.0.127")) {
 			debug.init_fail();
@@ -18,8 +24,8 @@ varnish v1 -vcl {
 	}
 
 	sub vcl_recv {
-		if (debug.match_acl(loopback, client.ip)) {
-			return (synth(200));
+		if (debug.match_acl(local, client.ip)) {
+			return (hash);
 		}
 		return (synth(500));
 	}



More information about the varnish-commit mailing list