Browse Source

[1794] Add a lettuce test for updating in-memory after xfr feature

Mukund Sivaraman 13 years ago
parent
commit
84f5946ae2

+ 34 - 0
tests/lettuce/configurations/xfrin/inmem_slave.conf

@@ -0,0 +1,34 @@
+{
+    "version": 2,
+    "Logging": {
+        "loggers": [ {
+            "debuglevel": 99,
+            "severity": "DEBUG",
+            "name": "*"
+        } ]
+    },
+    "Auth": {
+        "database_file": "data/inmem-xfrin.sqlite3",
+        "datasources": [ {
+            "type": "memory",
+	    "class": "IN",
+            "zones": [ {
+                "origin": "example.org",
+                "file": "data/inmem-xfrin.sqlite3",
+                "filetype": "sqlite3"
+            } ]
+        } ],
+        "listen_on": [ {
+            "port": 47806,
+            "address": "127.0.0.1"
+        } ]
+    },
+    "Boss": {
+        "components": {
+            "b10-auth": { "kind": "needed", "special": "auth" },
+            "b10-xfrin": { "address": "Xfrin", "kind": "dispensable" },
+            "b10-zonemgr": { "address": "Zonemgr", "kind": "dispensable" },
+            "b10-cmdctl": { "special": "cmdctl", "kind": "needed" }
+        }
+    }
+}

+ 7 - 0
tests/lettuce/data/inmem-xfrin

@@ -0,0 +1,7 @@
+example.org.	3600	IN	SOA	ns1.example.org. admin.example.org. 1234 3600 1800 2419200 7200
+example.org.	3600	IN	NS	ns1.example.org.
+example.org.	3600	IN	NS	ns2.example.org.
+example.org.	3600	IN	MX	10 mail.example.org.
+www.example.org.	3600	IN	A	192.0.2.63
+ns1.example.org.	3600	IN	A	192.0.2.3
+ns2.example.org.	3600	IN	A	192.0.2.4

BIN
tests/lettuce/data/inmem-xfrin.sqlite3.orig


+ 32 - 1
tests/lettuce/features/inmemory_over_sqlite3.feature

@@ -3,10 +3,41 @@ Feature: In-memory zone using SQLite3 backend
     data source that uses the SQLite3 data source as the backend, and tests
     data source that uses the SQLite3 data source as the backend, and tests
     scenarios that update the zone via incoming zone transfers.
     scenarios that update the zone via incoming zone transfers.
 
 
-    Scenario: Load and response
+    Scenario: 1. Load and response
         Given I have bind10 running with configuration inmemory_over_sqlite3/secondary.conf
         Given I have bind10 running with configuration inmemory_over_sqlite3/secondary.conf
         And wait for bind10 stderr message BIND10_STARTED_CC
         And wait for bind10 stderr message BIND10_STARTED_CC
         And wait for bind10 stderr message CMDCTL_STARTED
         And wait for bind10 stderr message CMDCTL_STARTED
         And wait for bind10 stderr message AUTH_SERVER_STARTED
         And wait for bind10 stderr message AUTH_SERVER_STARTED
         A query for www.example.org should have rcode NOERROR
         A query for www.example.org should have rcode NOERROR
         The SOA serial for example.org should be 1234
         The SOA serial for example.org should be 1234
+
+    Scenario: 2. In-memory datasource backed by sqlite3
+        Given I have bind10 running with configuration xfrin/retransfer_master.conf with cmdctl port 47804 as master
+        And wait for master stderr message BIND10_STARTED_CC
+        And wait for master stderr message CMDCTL_STARTED
+        And wait for master stderr message AUTH_SERVER_STARTED
+        And wait for master stderr message XFROUT_STARTED
+        And wait for master stderr message ZONEMGR_STARTED
+
+        And I have bind10 running with configuration xfrin/inmem_slave.conf
+        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
+        And wait for bind10 stderr message XFRIN_STARTED
+        And wait for bind10 stderr message ZONEMGR_STARTED
+
+        A query for www.example.org should have rcode NOERROR
+        """
+        www.example.org.        3600    IN      A       192.0.2.63
+        """
+        A query for mail.example.org should have rcode NXDOMAIN
+        When I send bind10 the command Xfrin retransfer example.org IN 127.0.0.1 47807
+        Then wait for new bind10 stderr message XFRIN_TRANSFER_SUCCESS not XFRIN_XFR_PROCESS_FAILURE
+	Then wait for new bind10 stderr message AUTH_LOAD_ZONE
+
+        A query for www.example.org should have rcode NOERROR
+        The answer section of the last query response should be
+        """
+        www.example.org.        3600    IN      A       192.0.2.1
+        """
+        A query for mail.example.org should have rcode NOERROR

+ 3 - 1
tests/lettuce/features/terrain/terrain.py

@@ -52,7 +52,9 @@ copylist = [
     ["configurations/resolver/resolver_basic.config.orig",
     ["configurations/resolver/resolver_basic.config.orig",
      "configurations/resolver/resolver_basic.config"],
      "configurations/resolver/resolver_basic.config"],
     ["configurations/multi_instance/multi_auth.config.orig",
     ["configurations/multi_instance/multi_auth.config.orig",
-     "configurations/multi_instance/multi_auth.config"]
+     "configurations/multi_instance/multi_auth.config"],
+    ["data/inmem-xfrin.sqlite3.orig",
+     "data/inmem-xfrin.sqlite3"]
 ]
 ]
 
 
 # This is a list of files that, if present, will be removed before a scenario
 # This is a list of files that, if present, will be removed before a scenario