BIND 10 trac2025_2, updated. 8e376a021e24671fb9818dd58ff5c1157286b990 [2025] Add a way to specify slaves for use in lettuce tests

BIND 10 source code commits bind10-changes at lists.isc.org
Thu Jun 21 10:00:55 UTC 2012


The branch, trac2025_2 has been updated
       via  8e376a021e24671fb9818dd58ff5c1157286b990 (commit)
      from  2f691c28713f4c9be59012ed55353c2f10de967c (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 8e376a021e24671fb9818dd58ff5c1157286b990
Author: Mukund Sivaraman <muks at isc.org>
Date:   Thu Jun 21 15:30:21 2012 +0530

    [2025] Add a way to specify slaves for use in lettuce tests
    
    Normally, notify_out finds A/AAAA records for the rdata in NS records
    and uses the non-primary ones as slaves. For these, it uses a hardcoded
    port value of 53 which won't work in lettuce as these tests use
    non-standard ports.

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

Summary of changes:
 src/bin/xfrout/xfrout.py.in                        |    2 +
 src/bin/xfrout/xfrout.spec.pre.in                  |   39 ++++++++++++++++++++
 src/lib/python/isc/notify/notify_out.py            |    7 ++++
 .../configurations/xfrin/retransfer_master.conf    |    4 ++
 4 files changed, 52 insertions(+)

-----------------------------------------------------------------------
diff --git a/src/bin/xfrout/xfrout.py.in b/src/bin/xfrout/xfrout.py.in
index 46ae687..2e06128 100755
--- a/src/bin/xfrout/xfrout.py.in
+++ b/src/bin/xfrout/xfrout.py.in
@@ -952,6 +952,8 @@ class XfroutServer:
     def _start_notifier(self):
         datasrc = self._unix_socket_server.get_db_file()
         self._notifier = notify_out.NotifyOut(datasrc)
+        for slave in self._config_data['test_notify_slaves']:
+            self._notifier.add_slave(slave['address'], slave['port'])
         self._notifier.dispatcher()
 
     def send_notify(self, zone_name, zone_class):
diff --git a/src/bin/xfrout/xfrout.spec.pre.in b/src/bin/xfrout/xfrout.spec.pre.in
index 30c9d56..a0e9665 100644
--- a/src/bin/xfrout/xfrout.spec.pre.in
+++ b/src/bin/xfrout/xfrout.spec.pre.in
@@ -21,6 +21,45 @@
          }
        },
        {
+         "item_name": "test_notify_slaves",
+         "item_type": "list",
+         "item_optional": true,
+         "item_default": [],
+         "list_item_spec":
+         {
+             "item_name": "test_notify_slaves_element",
+             "item_type": "map",
+             "item_optional": true,
+             "item_default": {},
+             "map_item_spec": [
+               {
+                   "item_name": "address",
+                   "item_type": "string",
+                   "item_optional": false,
+                   "item_default": ""
+               },
+               {
+                   "item_name": "port",
+                   "item_type": "integer",
+                   "item_optional": false,
+                   "item_default": 0
+               },
+               {
+                   "item_name": "transfer_acl",
+                   "item_type": "list",
+                   "item_optional": true,
+                   "item_default": [{"action": "ACCEPT"}],
+                   "list_item_spec":
+                   {
+                       "item_name": "acl_element",
+                       "item_type": "any",
+                       "item_optional": true
+                   }
+               }
+             ]
+         }
+       },
+       {
          "item_name": "zone_config",
          "item_type": "list",
          "item_optional": true,
diff --git a/src/lib/python/isc/notify/notify_out.py b/src/lib/python/isc/notify/notify_out.py
index 83ac1d0..0036279 100644
--- a/src/lib/python/isc/notify/notify_out.py
+++ b/src/lib/python/isc/notify/notify_out.py
@@ -161,6 +161,13 @@ class NotifyOut:
             for item in slaves:
                 self._notify_infos[zone_id].notify_slaves.append((item, 53))
 
+    def add_slave(self, address, port):
+        for zone_name, zone_class in sqlite3_ds.get_zones_info(self._db_file):
+            zone_id = (zone_name, zone_class)
+            if zone_id not in self._notify_infos:
+                return False
+            self._notify_infos[zone_id].notify_slaves.append((address, port))
+
     def send_notify(self, zone_name, zone_class='IN'):
         '''Send notify to one zone's slaves, this function is
         the only interface for class NotifyOut which can be called
diff --git a/tests/lettuce/configurations/xfrin/retransfer_master.conf b/tests/lettuce/configurations/xfrin/retransfer_master.conf
index 9ad5a05..3f91a5a 100644
--- a/tests/lettuce/configurations/xfrin/retransfer_master.conf
+++ b/tests/lettuce/configurations/xfrin/retransfer_master.conf
@@ -17,6 +17,10 @@
     "Xfrout": {
         "zone_config": [ {
             "origin": "example.org"
+        } ],
+        "test_notify_slaves": [ {
+            "address": "127.0.0.1",
+            "port": 47806
         } ]
     },
     "Boss": {



More information about the bind10-changes mailing list