]> git.ipfire.org Git - thirdparty/kea.git/commitdiff
[2421] Add lettuce test with broken zone
authorMukund Sivaraman <muks@isc.org>
Wed, 7 Nov 2012 18:44:35 +0000 (00:14 +0530)
committerMukund Sivaraman <muks@isc.org>
Wed, 7 Nov 2012 18:44:35 +0000 (00:14 +0530)
tests/lettuce/configurations/auth/.gitignore
tests/lettuce/configurations/auth/auth_badzone.config.orig [new file with mode: 0644]
tests/lettuce/data/example.com-broken [new file with mode: 0644]
tests/lettuce/features/auth_badzone.feature [new file with mode: 0644]
tests/lettuce/features/terrain/terrain.py

index 07f1b7db045994f5d889aa82be10671e228228c7..8165b6971174bdff9e4e7f7655594cb12398bd07 100644 (file)
@@ -1 +1,2 @@
+/auth_badzone.config
 /auth_basic.config
diff --git a/tests/lettuce/configurations/auth/auth_badzone.config.orig b/tests/lettuce/configurations/auth/auth_badzone.config.orig
new file mode 100644 (file)
index 0000000..cf7dd5b
--- /dev/null
@@ -0,0 +1,36 @@
+{
+    "version": 2,
+    "Logging": {
+        "loggers": [{
+            "severity": "DEBUG",
+            "name": "*",
+            "debuglevel": 99
+        }]
+    },
+    "Auth": {
+        "listen_on": [{
+            "port": 47806,
+            "address": "127.0.0.1"
+        }]
+    },
+    "data_sources": {
+        "classes": {
+            "IN": [
+                {
+                    "type": "MasterFiles",
+                    "cache-enable": true,
+                    "params": {
+                        "example.org": "data/example.org",
+                        "example.com": "data/example.com-broken"
+                    }
+                }
+            ]
+        }
+    },
+    "Boss": {
+        "components": {
+            "b10-auth": { "kind": "needed", "special": "auth" },
+            "b10-cmdctl": { "special": "cmdctl", "kind": "needed" }
+        }
+    }
+}
diff --git a/tests/lettuce/data/example.com-broken b/tests/lettuce/data/example.com-broken
new file mode 100644 (file)
index 0000000..cf4b72e
--- /dev/null
@@ -0,0 +1,8 @@
+example.com.   3600    IN      SOA     ns1.example.com. admin.example.com. 1234 3600 1800 2419200 7200
+example.com.   3600    IN      NS      ns1.example.com.
+example.com.   3600    IN      NS      ns2.example.com.
+example.com.   3600    IN      MX      10 mail.example.com.
+www.example.com.       3600    IN      A       192.0.2.1
+ns1.example.com.       3600    IN      A       192.0.2.3
+ns2.example.com.       3600    IN      A       192.0.2.4
+shell.example.com.     3600    IN      SSHFP   # this is clearly broken
diff --git a/tests/lettuce/features/auth_badzone.feature b/tests/lettuce/features/auth_badzone.feature
new file mode 100644 (file)
index 0000000..24b5ee1
--- /dev/null
@@ -0,0 +1,37 @@
+Feature: Authoritative DNS server with a bad zone
+    This feature set is for testing the execution of the b10-auth
+    component when one zone is broken, whereas others are fine. In this
+    case, b10-auth should not reject the data source, but reject the bad
+    zone only and serve the good zones anyway.
+
+    Scenario: Bad zone
+        Given I have bind10 running with configuration auth/auth_badzone.config
+        And wait for bind10 stderr message BIND10_STARTED_CC
+        And wait for bind10 stderr message CMDCTL_STARTED
+        And wait for bind10 stderr message AUTH_SERVER_STARTED
+
+        bind10 module Auth should be running
+        And bind10 module Resolver should not be running
+
+        A query for www.example.org should have rcode NOERROR
+        The last query response should have flags qr aa rd
+        The last query response should have ancount 1
+        The last query response should have nscount 2
+        The last query response should have adcount 2
+
+        The answer section of the last query response should be
+        """
+        www.example.org.        3600    IN      A       192.0.2.1
+        """
+        The authority section of the last query response should be
+        """
+        example.org.            3600    IN      NS      ns1.example.org.
+        example.org.            3600    IN      NS      ns2.example.org.
+        """
+        The additional section of the last query response should be
+        """
+        ns1.example.org.        3600    IN      A       192.0.2.3
+        ns2.example.org.        3600    IN      A       192.0.2.4
+        """
+
+        A query for www.example.com should have rcode REFUSED
index 2bfe7d4f14ed0608151f4f7c902cbb8e36908468..2df936b812302de9580c3256b77ad471858fb233 100644 (file)
@@ -51,6 +51,8 @@ copylist = [
      "configurations/bindctl/bindctl.config"],
     ["configurations/auth/auth_basic.config.orig",
      "configurations/auth/auth_basic.config"],
+    ["configurations/auth/auth_badzone.config.orig",
+     "configurations/auth/auth_badzone.config"],
     ["configurations/resolver/resolver_basic.config.orig",
      "configurations/resolver/resolver_basic.config"],
     ["configurations/multi_instance/multi_auth.config.orig",