Browse Source

[2624] Port the ixfr/in-2 test

As the only test that is being run in the system tests from xfrin.

The porting is not exact, we don't build the differences in bind9. We
provide them in a database already - we don't want to rely on bind9 and
bind10 can't build differences as of yet from master files (eg.
ixfr-from-differences).
Michal 'vorner' Vaner 12 years ago
parent
commit
be9f190124

+ 47 - 0
tests/lettuce/configurations/xfrin/retransfer_master_diffs.conf

@@ -0,0 +1,47 @@
+{
+    "version": 3,
+    "Logging": {
+        "loggers": [ {
+            "debuglevel": 99,
+            "severity": "DEBUG",
+            "name": "*"
+        } ]
+    },
+    "Auth": {
+        "database_file": "data/xfrin-diffs.sqlite3",
+        "listen_on": [ {
+            "address": "::1",
+            "port": 47807
+        } ]
+    },
+    "data_sources": {
+        "classes": {
+            "IN": [{
+                "type": "sqlite3",
+                "params": {
+                    "database_file": "data/xfrin-diffs.sqlite3"
+                }
+            }]
+        }
+    },
+    "Xfrout": {
+        "zone_config": [ {
+            "origin": "example."
+        } ],
+        "also_notify": [ {
+            "address": "::1",
+            "port": 47806
+        } ]
+    },
+    "Stats": {
+        "poll-interval": 1
+    },
+    "Init": {
+        "components": {
+            "b10-auth": { "kind": "needed", "special": "auth" },
+            "b10-xfrout": { "address": "Xfrout", "kind": "dispensable" },
+            "b10-zonemgr": { "address": "Zonemgr", "kind": "dispensable" },
+            "b10-cmdctl": { "special": "cmdctl", "kind": "needed" }
+        }
+    }
+}

+ 43 - 0
tests/lettuce/configurations/xfrin/retransfer_slave_diffs.conf

@@ -0,0 +1,43 @@
+{
+    "version": 3,
+    "Logging": {
+        "loggers": [ {
+            "debuglevel": 99,
+            "severity": "DEBUG",
+            "name": "*"
+        } ]
+    },
+    "Auth": {
+        "database_file": "data/xfrin-before-diffs.sqlite3",
+        "listen_on": [ {
+            "address": "::1",
+            "port": 47806
+        } ]
+    },
+    "Xfrin": {
+        "zones": [ {
+            "name": "example",
+            "master_addr": "::1",
+            "master_port": 47807,
+            "use_ixfr": true
+        } ]
+    },
+    "data_sources": {
+        "classes": {
+            "IN": [{
+                "type": "sqlite3",
+                "params": {
+                    "database_file": "data/xfrin-before-diffs.sqlite3"
+                }
+            }]
+        }
+    },
+    "Init": {
+        "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" }
+        }
+    }
+}

BIN
tests/lettuce/data/xfrin-before-diffs.sqlite3.orig


BIN
tests/lettuce/data/xfrin-diffs.sqlite3


+ 2 - 0
tests/lettuce/features/terrain/terrain.py

@@ -70,6 +70,8 @@ copylist = [
      "configurations/xfrin/retransfer_slave.conf"],
      "configurations/xfrin/retransfer_slave.conf"],
     ["data/inmem-xfrin.sqlite3.orig",
     ["data/inmem-xfrin.sqlite3.orig",
      "data/inmem-xfrin.sqlite3"],
      "data/inmem-xfrin.sqlite3"],
+    ["data/xfrin-before-diffs.sqlite3.orig",
+     "data/xfrin-before-diffs.sqlite3"],
     ["data/xfrin-notify.sqlite3.orig",
     ["data/xfrin-notify.sqlite3.orig",
      "data/xfrin-notify.sqlite3"],
      "data/xfrin-notify.sqlite3"],
     ["data/ddns/example.org.sqlite3.orig",
     ["data/ddns/example.org.sqlite3.orig",

+ 42 - 0
tests/lettuce/features/xfrin_bind10.feature

@@ -144,3 +144,45 @@ Feature: Xfrin
     # FIXME: This step fails. Probably an empty zone is created in the data
     # FIXME: This step fails. Probably an empty zone is created in the data
     # source :-|. This should be REFUSED, not SERVFAIL.
     # source :-|. This should be REFUSED, not SERVFAIL.
     A query for www.example.org to [::1]:47806 should have rcode SERVFAIL
     A query for www.example.org to [::1]:47806 should have rcode SERVFAIL
+
+    # TODO:
+    # * IXFR - generate an sqlite db that contains the journal. Check it was
+    #   IXFR by logs.
+    # * IXFR->AXFR fallback if IXFR is not available (even rejected or
+    #   something, not just the differences missing).
+    # * Retransfer with short refresh time (without notify).
+    Scenario: With differences
+    # We transfer from one bind10 to other, just like in the Retransfer command
+    # scenario. Just this time, the master contains the differences table
+    # and the slave has a previous version of the zone, so we use the IXFR.
+
+    Given I have bind10 running with configuration xfrin/retransfer_master_diffs.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/retransfer_slave_diffs.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 example. type SOA to [::1]:47806 should have rcode NOERROR
+    The answer section of the last query response should be
+    """
+    example.    3600    IN      SOA     ns1.example. hostmaster.example. 94 3600 900 7200 300
+    """
+
+    When I send bind10 the command Xfrin retransfer example. IN ::1 47807
+    Then wait for new bind10 stderr message XFRIN_GOT_INCREMENTAL_RESP
+    Then wait for new bind10 stderr message XFRIN_IXFR_TRANSFER_SUCCESS not XFRIN_XFR_PROCESS_FAILURE
+    Then wait for new bind10 stderr message ZONEMGR_RECEIVE_XFRIN_SUCCESS
+
+    A query for example. type SOA to [::1]:47806 should have rcode NOERROR
+    The answer section of the last query response should be
+    """
+    example.    3600    IN      SOA     ns1.example. hostmaster.example. 100 3600 900 7200 300
+    """