]> git.ipfire.org Git - thirdparty/kea.git/commitdiff
[1553] test basic ACL for resolver as well
authorJelte Jansen <jelte@isc.org>
Fri, 20 Jan 2012 09:56:18 +0000 (10:56 +0100)
committerJelte Jansen <jelte@isc.org>
Fri, 20 Jan 2012 09:56:18 +0000 (10:56 +0100)
tests/lettuce/configurations/resolver/resolver_basic.config [deleted file]
tests/lettuce/configurations/resolver/resolver_basic.config.orig [new file with mode: 0644]
tests/lettuce/features/resolver_basic.feature
tests/lettuce/features/terrain/terrain.py

diff --git a/tests/lettuce/configurations/resolver/resolver_basic.config b/tests/lettuce/configurations/resolver/resolver_basic.config
deleted file mode 100644 (file)
index a1f8afc..0000000
+++ /dev/null
@@ -1 +0,0 @@
-{"version": 2, "Resolver": {"listen_on": [{"port": 47806, "address": "127.0.0.1"}]}, "Boss": {"components": {"b10-resolver": {"kind": "needed"}, "b10-cmdctl": {"kind": "needed", "special": "cmdctl"}}}}
diff --git a/tests/lettuce/configurations/resolver/resolver_basic.config.orig b/tests/lettuce/configurations/resolver/resolver_basic.config.orig
new file mode 100644 (file)
index 0000000..5664c20
--- /dev/null
@@ -0,0 +1 @@
+{"version": 2, "Resolver": {"query_acl": [{"action": "REJECT", "from": "127.0.0.1"}], "listen_on": [{"port": 47806, "address": "127.0.0.1"}]}, "Boss": {"components": {"b10-resolver": {"kind": "needed"}, "b10-cmdctl": {"kind": "needed", "special": "cmdctl"}}}}
index df688dd4bfd1ae51f0d2976118907158e8308edc..e9d84bdf899fe35ac3abb7c944e07c6b1a0b769d 100644 (file)
@@ -12,5 +12,15 @@ Feature: Basic Resolver
         # for any resolver system test)
         When I start bind10 with configuration resolver/resolver_basic.config
         And wait for new bind10 stderr message RESOLVER_STARTED
-        # This answer is currently hardcoded (as part of the fake priming)
+
+        # The ACL is set to reject any queries
+        A query for l.root-servers.net. should have rcode REFUSED
+
+        # Test whether acl ACCEPT works
+        When I set bind10 configuration Resolver/query_acl[0]/action to ACCEPT
+        # This address is currently hardcoded, so shouldn't cause outside traffic
         A query for l.root-servers.net. should have rcode NOERROR
+
+        # Check whether setting the ACL to reject again works
+        When I set bind10 configuration Resolver/query_acl[0]/action to REJECT
+        A query for l.root-servers.net. should have rcode REFUSED
index d2ac03f4bde0af352417222fc78ff56567c30bb2..90531a1bcba908bc1c7405dd5dfb01d19bab01e4 100644 (file)
@@ -42,7 +42,10 @@ import time
 # The first element is the original, the second is the target that will be
 # used by the tests that need them
 copylist = [
-["configurations/example.org.config.orig", "configurations/example.org.config"]
+    ["configurations/example.org.config.orig",
+     "configurations/example.org.config"],
+    ["configurations/resolver/resolver_basic.config.orig",
+     "configurations/resolver/resolver_basic.config"]
 ]
 
 # This is a list of files that, if present, will be removed before a scenario