BIND 10 master, updated. 38cf088a4f48930a8b4c67c6c89e8166e4573bfc [1461] DDNS (when started later in the test) still requires zonemgr

BIND 10 source code commits bind10-changes at lists.isc.org
Mon Jun 18 12:15:05 UTC 2012


The branch, master has been updated
       via  38cf088a4f48930a8b4c67c6c89e8166e4573bfc (commit)
       via  97c1c1f96301a48eb6ed3fd10201e188b6cef6ba (commit)
       via  f2cd12cb26e8e2908de811d179c48660cd000d8d (commit)
       via  c54635af6106f737f791558f1a7b8a415647e6bf (commit)
       via  fa2055dc9dc9da332361f402408669c3d9203374 (commit)
       via  9ac04cd9c7f56f2ff12344f218a1bac8ab671f14 (commit)
       via  6e0c6bea6666fd57a484c2b754665b8b9b8533b0 (commit)
       via  ca65e4d61722b212b7ad05ec44ecda7cdc4d105d (commit)
       via  fbb8d8ac7159dee46405864cb0c2bd32e4ece312 (commit)
       via  ee56de187f8e00673996c16fa1481714ca388239 (commit)
       via  14181ee2dbd7e5e2624dc7ffc72d8266012f92cd (commit)
       via  e8df14346ff0c45f89a7fba35a7998f8175ecd77 (commit)
       via  dd8a0ae62b2fe2b93376855f0a0a0cdbb990a998 (commit)
       via  7087a74ba48a4093179df460b29831c0349564c6 (commit)
      from  5cbaf8b762a4a90e483715c87568c1f9d1b44264 (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
commit 38cf088a4f48930a8b4c67c6c89e8166e4573bfc
Author: Mukund Sivaraman <muks at isc.org>
Date:   Mon Jun 18 17:35:00 2012 +0530

    [1461] DDNS (when started later in the test) still requires zonemgr

commit 97c1c1f96301a48eb6ed3fd10201e188b6cef6ba
Merge: f2cd12c 5cbaf8b
Author: Mukund Sivaraman <muks at isc.org>
Date:   Mon Jun 18 17:07:48 2012 +0530

    Merge branch 'master' into trac1461
    
    Conflicts:
    	src/bin/ddns/ddns_messages.mes

-----------------------------------------------------------------------

Summary of changes:
 src/bin/ddns/ddns.py.in                            |    2 +-
 src/bin/ddns/ddns_messages.mes                     |    8 +-
 tests/lettuce/configurations/ddns/ddns.config.orig |   78 +++++++++
 .../lettuce/configurations/ddns/noddns.config.orig |   43 +++++
 .../example.org.sqlite3.orig}                      |  Bin 15360 -> 15360 bytes
 tests/lettuce/data/example.org.sqlite3             |  Bin 15360 -> 15360 bytes
 tests/lettuce/features/ddns_system.feature         |  144 +++++++++++++++++
 tests/lettuce/features/example.feature             |    3 +
 tests/lettuce/features/terrain/bind10_control.py   |   31 +++-
 tests/lettuce/features/terrain/nsupdate.py         |  168 ++++++++++++++++++++
 tests/lettuce/features/terrain/querying.py         |   10 +-
 tests/lettuce/features/terrain/terrain.py          |   14 +-
 12 files changed, 488 insertions(+), 13 deletions(-)
 create mode 100644 tests/lettuce/configurations/ddns/ddns.config.orig
 create mode 100644 tests/lettuce/configurations/ddns/noddns.config.orig
 copy tests/lettuce/data/{example.org.sqlite3 => ddns/example.org.sqlite3.orig} (100%)
 create mode 100644 tests/lettuce/features/ddns_system.feature
 create mode 100644 tests/lettuce/features/terrain/nsupdate.py

-----------------------------------------------------------------------
diff --git a/src/bin/ddns/ddns.py.in b/src/bin/ddns/ddns.py.in
index 8ddd2da..cc5b2ff 100755
--- a/src/bin/ddns/ddns.py.in
+++ b/src/bin/ddns/ddns.py.in
@@ -615,7 +615,7 @@ class DDNSServer:
         Get and process all commands sent from cfgmgr or other modules.
         This loops waiting for events until self.shutdown() has been called.
         '''
-        logger.info(DDNS_RUNNING)
+        logger.info(DDNS_STARTED)
         cc_fileno = self._cc.get_socket().fileno()
         listen_fileno = self._listen_socket.fileno()
         while not self._shutdown:
diff --git a/src/bin/ddns/ddns_messages.mes b/src/bin/ddns/ddns_messages.mes
index 61311bc..f053c91 100644
--- a/src/bin/ddns/ddns_messages.mes
+++ b/src/bin/ddns/ddns_messages.mes
@@ -153,10 +153,6 @@ case, there may not be able to do anything to fix it at the server
 side, but the administrator may want to check the general reachability
 with the client address.
 
-% DDNS_RUNNING ddns server is running and listening for updates
-The ddns process has successfully started and is now ready to receive commands
-and updates.
-
 % DDNS_SECONDARY_ZONES_UPDATE updated secondary zone list (%1 zones are listed)
 b10-ddns has successfully updated the internal copy of secondary zones
 obtained from b10-zonemgr, based on a latest update to zonemgr's
@@ -192,6 +188,10 @@ The ddns process is shutting down. It will no longer listen for new commands
 or updates. Any command or update that is being addressed at this moment will
 be completed, after which the process will exit.
 
+% DDNS_STARTED ddns server is running and listening for updates
+The ddns process has successfully started and is now ready to receive commands
+and updates.
+
 % DDNS_STOPPED ddns server has stopped
 The ddns process has successfully stopped and is no longer listening for or
 handling commands or updates, and will now exit.
diff --git a/tests/lettuce/configurations/ddns/ddns.config.orig b/tests/lettuce/configurations/ddns/ddns.config.orig
new file mode 100644
index 0000000..80b92f7
--- /dev/null
+++ b/tests/lettuce/configurations/ddns/ddns.config.orig
@@ -0,0 +1,78 @@
+{
+    "version": 2,
+    "Logging": {
+        "loggers": [
+            {
+                "debuglevel": 99,
+                "severity": "DEBUG",
+                "name": "*"
+            }
+        ]
+    },
+    "Zonemgr": {
+        "secondary_zones": [
+            {
+                "class": "IN",
+                "name": "secondary.org"
+            }
+        ]
+    },
+    "Auth": {
+        "database_file": "data/ddns/example.org.sqlite3",
+        "listen_on": [
+            {
+                "port": 47806,
+                "address":
+                "127.0.0.1"
+            }
+        ]
+    },
+    "Boss": {
+        "components": {
+            "b10-xfrout": {
+                "kind": "dispensable",
+                "address": "Xfrout"
+            },
+            "b10-zonemgr": {
+                "kind": "dispensable",
+                "address": "ZoneMgr"
+            },
+            "b10-ddns": {
+                "kind": "dispensable",
+                "address": "DDNS"
+            },
+            "b10-auth": {
+                "kind": "needed",
+                "special": "auth"
+            },
+            "b10-cmdctl": {
+                "kind": "needed",
+                "special": "cmdctl"
+            }
+        }
+    },
+    "DDNS": {
+        "zones": [
+            {
+                "origin": "example.org.",
+                "update_acl": [
+                    {
+                        "action": "ACCEPT",
+                        "from": "127.0.0.1"
+                    }
+                ],
+                "class": "IN"
+            },
+            {
+                "origin": "secondary.org.",
+                "update_acl": [
+                    {
+                        "action": "ACCEPT",
+                        "from": "127.0.0.1"
+                    }
+                ],
+                "class": "IN"
+            }
+        ]
+    }
+}
diff --git a/tests/lettuce/configurations/ddns/noddns.config.orig b/tests/lettuce/configurations/ddns/noddns.config.orig
new file mode 100644
index 0000000..bf89537
--- /dev/null
+++ b/tests/lettuce/configurations/ddns/noddns.config.orig
@@ -0,0 +1,43 @@
+{
+    "version": 2,
+    "Logging": {
+        "loggers": [
+            {
+                "severity": "DEBUG",
+                "name": "*",
+                "debuglevel": 99
+            }
+        ]
+    },
+    "DDNS": {"zones": []},
+    "Auth": {
+        "database_file": "data/ddns/example.org.sqlite3",
+        "listen_on": [
+            {
+                "port": 47806,
+                "address": "127.0.0.1"
+            }
+        ],
+        "datasources": [
+            {
+                "type": "memory",
+                "class": "IN",
+                "zones": [
+                    {
+                        "origin": "example.org",
+                        "filetype": "sqlite3",
+                        "file": "data/ddns/example.org.sqlite3"
+                    }
+                ]
+            }
+        ]
+    },
+    "Boss": {
+        "components": {
+            "b10-xfrout": {"kind": "dispensable"},
+            "b10-auth": {"kind": "needed", "special": "auth"},
+            "b10-zonemgr": {"kind": "dispensable", "address": "ZoneMgr" },
+            "b10-cmdctl": {"kind": "needed", "special": "cmdctl"}
+        }
+    }
+}
diff --git a/tests/lettuce/data/ddns/example.org.sqlite3.orig b/tests/lettuce/data/ddns/example.org.sqlite3.orig
new file mode 100644
index 0000000..427fa24
Binary files /dev/null and b/tests/lettuce/data/ddns/example.org.sqlite3.orig differ
diff --git a/tests/lettuce/data/example.org.sqlite3 b/tests/lettuce/data/example.org.sqlite3
index 427fa24..f79a4e2 100644
Binary files a/tests/lettuce/data/example.org.sqlite3 and b/tests/lettuce/data/example.org.sqlite3 differ
diff --git a/tests/lettuce/features/ddns_system.feature b/tests/lettuce/features/ddns_system.feature
new file mode 100644
index 0000000..327ef96
--- /dev/null
+++ b/tests/lettuce/features/ddns_system.feature
@@ -0,0 +1,144 @@
+Feature: DDNS System
+    A number of BIND10-specific DDNS tests, that do not fall under the
+    'compliance' category; specific ACL checks, module checks, etc.
+
+    Scenario: Module tests
+        # The given config has b10-ddns disabled
+        Given I have bind10 running with configuration ddns/noddns.config
+        And wait for bind10 stderr message BIND10_STARTED_CC
+        And wait for bind10 stderr message AUTH_SERVER_STARTED
+
+        # Sanity check
+        bind10 module DDNS should not be running
+
+        # Test 1
+        When I use DDNS to set the SOA serial to 1235
+        # Note: test spec says refused here, system returns SERVFAIL
+        #The DDNS response should be REFUSED
+        The DDNS response should be SERVFAIL
+        And the SOA serial for example.org should be 1234
+
+        # Test 2
+        When I configure bind10 to run DDNS
+        And wait for new bind10 stderr message DDNS_STARTED
+        bind10 module DDNS should be running
+
+        # Test 3
+        When I use DDNS to set the SOA serial to 1236
+        The DDNS response should be REFUSED
+        And the SOA serial for example.org should be 1234
+
+        # Test 4
+        When I send bind10 the following commands
+        """
+        config add DDNS/zones
+        config set DDNS/zones[0]/origin example.org
+        config add DDNS/zones[0]/update_acl {"action": "ACCEPT", "from": "127.0.0.1"}
+        config commit
+        """
+
+        # Test 5
+        When I use DDNS to set the SOA serial to 1237
+        # also check if Auth server reloaded
+        And wait for new bind10 stderr message AUTH_LOAD_ZONE
+        The DDNS response should be SUCCESS
+        And the SOA serial for example.org should be 1237
+
+        # Test 6
+        When I send bind10 the command DDNS shutdown
+        And wait for new bind10 stderr message DDNS_STOPPED
+
+        # Test 7
+        # BoB should restart it
+        And wait for new bind10 stderr message DDNS_STARTED
+
+        # Test 8
+        # Known issue: after shutdown, first new attempt results in SERVFAIL
+        When I use DDNS to set the SOA serial to 1238
+        The DDNS response should be SERVFAIL
+        And the SOA serial for example.org should be 1237
+
+        When I use DDNS to set the SOA serial to 1238
+        And wait for new bind10 stderr message AUTH_LOAD_ZONE
+        The DDNS response should be SUCCESS
+        And the SOA serial for example.org should be 1238
+
+        # Test 9
+        When I send bind10 the command Auth shutdown
+        And wait for new bind10 stderr message AUTH_SHUTDOWN
+        # BoB should restart it automatically
+        And wait for new bind10 stderr message AUTH_SERVER_STARTED
+
+        # Test 10
+        When I use DDNS to set the SOA serial to 1239
+        And wait for new bind10 stderr message AUTH_LOAD_ZONE
+        The DDNS response should be SUCCESS
+        And the SOA serial for example.org should be 1239
+
+        # Test 11
+        When I configure BIND10 to stop running DDNS
+        And wait for new bind10 stderr message DDNS_STOPPED
+
+        bind10 module DDNS should not be running
+
+        # Test 12
+        When I use DDNS to set the SOA serial to 1240
+        # should this be REFUSED again?
+        The DDNS response should be SERVFAIL
+        And the SOA serial for example.org should be 1239
+
+    Scenario: ACL
+        Given I have bind10 running with configuration ddns/ddns.config
+        And wait for bind10 stderr message BIND10_STARTED_CC
+        And wait for bind10 stderr message AUTH_SERVER_STARTED
+        And wait for bind10 stderr message DDNS_STARTED
+
+        # Sanity check
+        A query for new1.example.org should have rcode NXDOMAIN
+        A query for new2.example.org should have rcode NXDOMAIN
+        A query for new3.example.org should have rcode NXDOMAIN
+        The SOA serial for example.org should be 1234
+
+        # Test 1
+        When I use DDNS to add a record new1.example.org. 3600 IN A 192.0.2.1
+        The DDNS response should be SUCCESS
+        A query for new1.example.org should have rcode NOERROR
+        The SOA serial for example.org should be 1235
+
+        # Test 2
+        When I set DDNS ACL 0 for 127.0.0.1 to REJECT
+        Then use DDNS to add a record new2.example.org. 3600 IN A 192.0.2.2
+        The DDNS response should be REFUSED
+        A query for new2.example.org should have rcode NXDOMAIN
+        The SOA serial for example.org should be 1235
+
+        # Test 3
+        When I set DDNS ACL 0 for 127.0.0.1 to ACCEPT
+        Then use DDNS to add a record new3.example.org. 3600 IN A 192.0.2.3
+        The DDNS response should be SUCCESS
+        A query for new3.example.org should have rcode NOERROR
+        The SOA serial for example.org should be 1236
+
+    #Scenario: DDNS and Xfrout
+    ## Unfortunately, Xfrout can only notify to inzone slaves, and hence only
+    ## to port 53, which we do not want to use for Lettuce tests (for various
+    ## reasons). So for now this test is only an outline, the configs
+    ## themselves have not been set up yet
+    #    When I start bind10 with configuration ddns/primary.config as primary
+    #    And wait for primary stderr message AUTH_SERVER_STARTED
+    #    And wait for primary stderr message XFROUT_STARTED
+    #    And wait for primary stderr message DDNS_STARTED
+
+    #    And I start bind10 with configuration example2.org.config with cmdctl port 47804 as secondary
+    #    And wait for secondary stderr message AUTH_SERVER_STARTED
+    #    And wait for secondary stderr message XFRIN_STARTED
+
+    #    # Sanity check
+    #    The SOA serial for example.org should be 1234
+    #    The SOA serial for example.org at 127.0.0.1:47807 should be 1234
+
+    #    When I use DDNS to set the SOA serial to 1235
+    #    The DDNS response should be SUCCESS
+
+    #    The SOA serial for example.org should be 1235
+    #    The SOA serial for example.org at 127.0.0.1:47807 should be 1235
diff --git a/tests/lettuce/features/example.feature b/tests/lettuce/features/example.feature
index 9b7c2ca..685cf8b 100644
--- a/tests/lettuce/features/example.feature
+++ b/tests/lettuce/features/example.feature
@@ -182,6 +182,9 @@ Feature: Example feature
 
         A query for www.example.org to 127.0.0.1:47806 should have rcode NOERROR
         A query for www.example.org to [::1]:47807 should have rcode NOERROR
+        The SOA serial for example.org should be 1234
+        The SOA serial for example.org at 127.0.0.1:47806 should be 1234
+        The SOA serial for example.org at ::1:47807 should be 1234
 
         Then set bind10 configuration Auth/database_file to data/empty_db.sqlite3
         And wait for bind10_one stderr message DATASRC_SQLITE_OPEN
diff --git a/tests/lettuce/features/terrain/bind10_control.py b/tests/lettuce/features/terrain/bind10_control.py
index c56afb7..a08a887 100644
--- a/tests/lettuce/features/terrain/bind10_control.py
+++ b/tests/lettuce/features/terrain/bind10_control.py
@@ -52,7 +52,7 @@ def start_bind10(step, config_file, cmdctl_port, msgq_sockfile, process_name):
     It will also fail if there is a running process with the given process_name
     already.
     """
-    args = [ 'bind10', '-v' ]
+    args = [ 'bind10', '-n', '-v' ]
     if config_file is not None:
         args.append('-p')
         args.append("configurations/")
@@ -334,3 +334,32 @@ def module_is_running(step, name, not_str):
         not_str = ""
     step.given('send bind10 the command help')
     step.given('last bindctl output should' + not_str + ' contain ' + name + ' exactly')
+
+ at step('Configure BIND10 to run DDNS')
+def configure_ddns_on(step):
+    """
+    Convenience compound step to enable the b10-ddns module.
+    """
+    step.behave_as("""
+    When I send bind10 the following commands
+        \"\"\"
+        config add Boss/components b10-ddns
+        config set Boss/components/b10-ddns/kind dispensable
+        config set Boss/components/b10-ddns/address DDNS
+        config commit
+        \"\"\"
+    """)
+
+ at step('Configure BIND10 to stop running DDNS')
+def configure_ddns_off(step):
+    """
+    Convenience compound step to disable the b10-ddns module.
+    """
+    step.behave_as("""
+    When I send bind10 the following commands
+        \"\"\"
+        config remove Boss/components b10-ddns
+        config commit
+        \"\"\"
+    """)
+
diff --git a/tests/lettuce/features/terrain/nsupdate.py b/tests/lettuce/features/terrain/nsupdate.py
new file mode 100644
index 0000000..946439d
--- /dev/null
+++ b/tests/lettuce/features/terrain/nsupdate.py
@@ -0,0 +1,168 @@
+# Copyright (C) 2012  Internet Systems Consortium.
+#
+# Permission to use, copy, modify, and distribute this software for any
+# purpose with or without fee is hereby granted, provided that the above
+# copyright notice and this permission notice appear in all copies.
+#
+# THE SOFTWARE IS PROVIDED "AS IS" AND INTERNET SYSTEMS CONSORTIUM
+# DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL
+# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL
+# INTERNET SYSTEMS CONSORTIUM BE LIABLE FOR ANY SPECIAL, DIRECT,
+# INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING
+# FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT,
+# NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION
+# WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
+
+from lettuce import *
+import subprocess
+import re
+
+def run_nsupdate(commands):
+    """Run nsupdate.
+       Parameters:
+       commands: a sequence of strings which will be sent.
+       update_address: adress to send the update to
+       update_port: port to send the update to
+       zone: zone to update
+
+       Appends 'send' and 'quit' as final commands.
+
+       nsupdate's stdout and stderr streams are stored (as one multiline string
+       in world.last_nsupdate_stdout/stderr.
+
+       The return code is stored in world.last_nsupdate_returncode
+       (it is not checked here, since a number of tests intentionally
+       result in a non-zero return code).
+    """
+    commands.append('send')
+    commands.append('quit')
+    args = ['nsupdate' ]
+    nsupdate = subprocess.Popen(args, 1, None, subprocess.PIPE,
+                                subprocess.PIPE, subprocess.PIPE)
+    for line in commands:
+        nsupdate.stdin.write(line + "\n")
+    (stdout, stderr) = nsupdate.communicate()
+    world.last_nsupdate_returncode = nsupdate.returncode
+    world.last_nsupdate_stdout = stdout
+    world.last_nsupdate_stderr = stderr
+
+ at step('send a DDNS update for (\S+) with the following commands:')
+def send_multiple_commands(step, zone):
+    """
+    Run nsupdate, and send it the given multiline set of commands.
+    A send and quit command is always appended.
+
+    This is the most 'raw' wrapper around the nsupdate call; every
+    command except the final send needs to be specified. Intended
+    for those tests that have unique properties.
+    """
+    commands = step.multiline.split("\n")
+    run_nsupdate(commands, zone)
+
+ at step('DDNS response should be ([A-Z]+)')
+def check_ddns_response(step, response):
+    """
+    Checks the result of the last call to nsupdate.
+
+    If the given response argument is SUCCESS, it simply checks whether
+    the return code from nsupdate is 0 (there is no output in that case).
+    If not, it checks whether it is not 0, and if the given response string
+    matches a line 'update failed: <response>' in the stderr output of
+    nsupdate.
+
+    Prints exit code, stdout and stderr streams of nsupdate if it fails.
+    """
+    # For success, nsupdate is silent, only check result code 0
+    if response == "SUCCESS":
+        assert 0 == world.last_nsupdate_returncode,\
+               "nsupdate exit code: " + str(world.last_nsupdate_returncode) +\
+               "\nstdout:\n" + str(world.last_nsupdate_stdout) +\
+               "stderr:\n" + str(world.last_nsupdate_stderr)
+    else:
+        found = False
+        for line in world.last_nsupdate_stderr.split('\n'):
+            if line == "update failed: " + response:
+                found = True
+        assert found and (0 != world.last_nsupdate_returncode),\
+               "Response " + response + " not found in nsupdate output\n" +\
+               "nsupdate exit code: " + str(world.last_nsupdate_returncode) +\
+               "\nstdout:\n" + str(world.last_nsupdate_stdout) +\
+               "stderr:\n" + str(world.last_nsupdate_stderr)
+
+
+# Individual steps to create a DDNS update packet through nsupdate
+ at step('Prepare a DDNS update(?: for (\S+))?(?: to (\S+)(?: port ([0-9]+)))?')
+def prepare_update(step, zone, server, port):
+    """
+    Prepares an nsupdate command that sets up an update to a server
+    for a zone. The update is not sent yet, but the commands
+    are stored in world.nsupdate_commands.
+    """
+    commands = []
+    if server is not None:
+        commands.append("server " + server)
+    else:
+        commands.append("server 127.0.0.1")
+    if port is not None:
+        commands[0] = commands[0] + " " + port
+    else:
+        commands[0] = commands[0] + " 47806"
+    if zone is not None:
+        commands.append("zone " + zone)
+    world.nsupdate_commands = commands
+
+ at step('Add to the DDNS update: (.*)')
+def add_line_to_ddns_update(step, line):
+    """
+    Adds a single line to the prepared nsupdate. It is not sent yet.
+    The line must conform to nsupdate syntax.
+    """
+    world.nsupdate_commands.append(line)
+
+ at step('Add the following lines to the DDNS update:')
+def add_lines_to_ddns_update(step, line):
+    """
+    Adds multiple lines to the prepared nsupdate. It is not sent yet.
+    The lines must conform to nsupdate syntax.
+    """
+    world.nsupdate_commands.extend(step.multiline.split('\n'))
+
+ at step('Send the DDNS update')
+def run_ddns_update(step):
+    """
+    Runs the prepared nsupdate, see run_nsupdate() for more information.
+    """
+    run_nsupdate(world.nsupdate_commands)
+
+ at step('use DDNS to set the SOA SERIAL to ([0-9]+)')
+def set_serial_to(step, new_serial):
+    """
+    Convenience compound step; prepare an update for example.org,
+    which sets the SERIAL to the given value, and send it.
+    It makes no other changes, and has hardcoded values for the other
+    SOA rdata fields.
+    """
+    step.given('Prepare a DDNS update')
+    step.given('add to the DDNS update: update add example.org 3600 IN SOA ns1.example.org. admin.example.org. ' + new_serial + ' 3600 1800 2419200 7200')
+    step.given('Send the DDNS update')
+
+ at step('use DDNS to add a record (.*)')
+def add_record(step, new_record):
+    """
+    Convenience compound step; prepare an update for example.org,
+    which adds one record, then send it.
+    Apart from the update addition, the update will not contain anything else.
+    """
+    step.given('Prepare a DDNS update')
+    step.given('add to the DDNS update: update add ' + new_record)
+    step.given('Send the DDNS update')
+
+ at step('set DDNS ACL ([0-9]+) for ([0-9.]+) to ([A-Z]+)')
+def set_ddns_acl_to(step, nr, address, action):
+    """
+    Convenience step to update a single ACL for DDNS.
+    Replaces the ACL at the given index for the given
+    address, to the given action
+    """
+    step.given('set bind10 configuration DDNS/zones[' + nr + ']/update_acl to [{"action": "' + action + '", "from": "' + address + '"}]')
+    step.given('last bindctl output should not contain Error')
diff --git a/tests/lettuce/features/terrain/querying.py b/tests/lettuce/features/terrain/querying.py
index a547014..abd7c18 100644
--- a/tests/lettuce/features/terrain/querying.py
+++ b/tests/lettuce/features/terrain/querying.py
@@ -240,8 +240,8 @@ def query(step, dnssec, query_name, qtype, qclass, addr, port, rcode):
         "Expected: " + rcode + ", got " + query_result.rcode
     world.last_query_result = query_result
 
- at step('The SOA serial for ([\w.]+) should be ([0-9]+)')
-def query_soa(step, query_name, serial):
+ at step('The SOA serial for ([\S.]+) (?:at (\S+)(?::([0-9]+)) )?should be ([0-9]+)')
+def query_soa(step, query_name, address, port, serial=None):
     """
     Convenience function to check the SOA SERIAL value of the given zone at
     the nameserver at the default address (127.0.0.1:47806).
@@ -251,7 +251,11 @@ def query_soa(step, query_name, serial):
     If the rcode is not NOERROR, or the answer section does not contain the
     SOA record, this step fails.
     """
-    query_result = QueryResult(query_name, "SOA", "IN", "127.0.0.1", "47806")
+    if address is None:
+        address = "127.0.0.1"
+    if port is None:
+        port = "47806"
+    query_result = QueryResult(query_name, "SOA", "IN", address, port)
     assert "NOERROR" == query_result.rcode,\
         "Got " + query_result.rcode + ", expected NOERROR"
     assert len(query_result.answer_section) == 1,\
diff --git a/tests/lettuce/features/terrain/terrain.py b/tests/lettuce/features/terrain/terrain.py
index caa17ce..a35d0de 100644
--- a/tests/lettuce/features/terrain/terrain.py
+++ b/tests/lettuce/features/terrain/terrain.py
@@ -53,8 +53,14 @@ copylist = [
      "configurations/resolver/resolver_basic.config"],
     ["configurations/multi_instance/multi_auth.config.orig",
      "configurations/multi_instance/multi_auth.config"],
+    ["configurations/ddns/ddns.config.orig",
+     "configurations/ddns/ddns.config"],
+    ["configurations/ddns/noddns.config.orig",
+     "configurations/ddns/noddns.config"],
     ["data/inmem-xfrin.sqlite3.orig",
-     "data/inmem-xfrin.sqlite3"]
+     "data/inmem-xfrin.sqlite3"],
+    ["data/ddns/example.org.sqlite3.orig",
+     "data/ddns/example.org.sqlite3"]
 ]
 
 # This is a list of files that, if present, will be removed before a scenario
@@ -258,7 +264,7 @@ class RunningProcesses:
         Initialize with no running processes.
         """
         self.processes = {}
-    
+
     def add_process(self, step, process_name, args):
         """
         Start a process with the given arguments, and store it under the given
@@ -297,14 +303,14 @@ class RunningProcesses:
             "Process " + name + " unknown"
         self.processes[process_name].stop_process()
         del self.processes[process_name]
-        
+
     def stop_all_processes(self):
         """
         Stop all running processes.
         """
         for process in self.processes.values():
             process.stop_process()
-    
+
     def keep_files(self):
         """
         Keep the redirection files for stdout/stderr output of all processes



More information about the bind10-changes mailing list