]> git.ipfire.org Git - thirdparty/kea.git/commitdiff
[2430] Add lettuce test for $GENERATE
authorMukund Sivaraman <muks@isc.org>
Mon, 3 Feb 2014 05:23:01 +0000 (10:53 +0530)
committerMukund Sivaraman <muks@isc.org>
Mon, 3 Feb 2014 05:23:19 +0000 (10:53 +0530)
tests/lettuce/configurations/.gitignore
tests/lettuce/configurations/generate.config.orig [new file with mode: 0644]
tests/lettuce/data/generate.zone [new file with mode: 0644]
tests/lettuce/features/master_loader.feature [new file with mode: 0644]
tests/lettuce/features/terrain/terrain.py

index db54954fb3046efa605a1d1e5a56ab75791076f7..50013a55ed049343767d8267fb4859c86f19b496 100644 (file)
@@ -1,3 +1,4 @@
 /bindctl_commands.config
 /example.org.config
+/generate.config
 /root.config
diff --git a/tests/lettuce/configurations/generate.config.orig b/tests/lettuce/configurations/generate.config.orig
new file mode 100644 (file)
index 0000000..a40d8c2
--- /dev/null
@@ -0,0 +1,35 @@
+{
+    "version": 3,
+    "Logging": {
+        "loggers": [{
+            "severity": "DEBUG",
+            "name": "*",
+            "debuglevel": 99
+        }]
+    },
+    "Auth": {
+        "listen_on": [{
+            "port": 56176,
+            "address": "127.0.0.1"
+        }]
+    },
+    "data_sources": {
+        "classes": {
+            "IN": [
+                {
+                    "type": "MasterFiles",
+                    "cache-enable": true,
+                    "params": {
+                        "example.org": "data/generate.zone"
+                    }
+                }
+            ]
+        }
+    },
+    "Init": {
+        "components": {
+            "b10-auth": { "kind": "needed", "special": "auth" },
+            "b10-cmdctl": { "special": "cmdctl", "kind": "needed" }
+        }
+    }
+}
diff --git a/tests/lettuce/data/generate.zone b/tests/lettuce/data/generate.zone
new file mode 100644 (file)
index 0000000..4ea08db
--- /dev/null
@@ -0,0 +1,6 @@
+$ORIGIN example.org.
+example.org.   3600    IN      SOA     ns1.example.org. admin.example.org. 12341 3600 1800 2419200 7200
+example.org.   3600    IN      NS      ns1.example.org.
+example.org.   3600    IN      NS      ns2.example.org.
+
+$GENERATE 1-4 host$ A 192.0.2.$
diff --git a/tests/lettuce/features/master_loader.feature b/tests/lettuce/features/master_loader.feature
new file mode 100644 (file)
index 0000000..8271074
--- /dev/null
@@ -0,0 +1,43 @@
+Feature: Master loader feature
+    This feature is a collection of tests for the zone file loader in
+    BIND 10.
+
+    Scenario: $GENERATE support
+        Given I have bind10 running with configuration generate.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
+        And bind10 module Xfrout should not be running
+        And bind10 module Zonemgr should not be running
+        And bind10 module Xfrin should not be running
+        And bind10 module Stats should not be running
+        And bind10 module StatsHttpd should not be running
+
+        A query for www.example.org should have rcode NXDOMAIN
+        The SOA serial for example.org should be 12341
+
+        A query for host0.example.org should have rcode NXDOMAIN
+        A query for host1.example.org should have rcode NOERROR
+        The answer section of the last query response should be
+        """
+        host1.example.org.        3600    IN      A       192.0.2.1
+        """
+        A query for host2.example.org should have rcode NOERROR
+        The answer section of the last query response should be
+        """
+        host2.example.org.        3600    IN      A       192.0.2.2
+        """
+        A query for host3.example.org should have rcode NOERROR
+        The answer section of the last query response should be
+        """
+        host3.example.org.        3600    IN      A       192.0.2.3
+        """
+        A query for host4.example.org should have rcode NOERROR
+        The answer section of the last query response should be
+        """
+        host4.example.org.        3600    IN      A       192.0.2.4
+        """
+        A query for host5.example.org should have rcode NXDOMAIN
index 66727bf7ec2f11e796359198a94a4b0c5a27731f..f20dfc899c415b9419b82bc10e2281253e469314 100644 (file)
@@ -52,6 +52,8 @@ copylist = [
      "configurations/bindctl_commands.config"],
     ["configurations/example.org.config.orig",
      "configurations/example.org.config"],
+    ["configurations/generate.config.orig",
+     "configurations/generate.config"],
     ["configurations/bindctl/bindctl.config.orig",
      "configurations/bindctl/bindctl.config"],
     ["configurations/auth/auth_basic.config.orig",