From: phk Date: Wed, 25 Jun 2008 21:22:13 +0000 (+0000) Subject: A simple ACL testcase X-Git-Url: https://err.no/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=b3ab6136779bc5eba7c38f47e5c39da5d35b9a42;p=varnish A simple ACL testcase git-svn-id: svn+ssh://projects.linpro.no/svn/varnish/trunk@2812 d4fa192b-c00b-0410-8231-f00ffab90ce4 --- diff --git a/varnish-cache/bin/varnishtest/tests/c00005.vtc b/varnish-cache/bin/varnishtest/tests/c00005.vtc new file mode 100644 index 00000000..ea0f4c1c --- /dev/null +++ b/varnish-cache/bin/varnishtest/tests/c00005.vtc @@ -0,0 +1,46 @@ +# $Id$ + +test "Test simple ACL" + +server s1 { + rxreq + expect req.url == "/" + txresp -hdr "Content-Length: 5" -body "1111\n" + rxreq + expect req.url == "foo" + txresp -hdr "Content-Length: 5" -body "2222\n" +} -start + +varnish v1 -vcl+backend { + acl acl1 { + "127.0.0.1"; + } + + sub vcl_recv { + if (client.ip ~ acl1) { + set req.url = "/"; + } + } +} -start + +client c1 { + txreq -url "foo" + rxresp + expect resp.status == 200 +} + +client c1 -run + +varnish v1 -vcl+backend { + acl acl1 { + "!127.0.0.1"; + } + + sub vcl_recv { + if (client.ip ~ acl1) { + set req.url = "/"; + } + } +} + +client c1 -run