BIND 10 master, updated. 2498f05b7afa17431e9f3f4d6109e995fbec6514 Merge branch 'master' into trac2025_2
BIND 10 source code commits
bind10-changes at lists.isc.org
Thu Jun 28 02:26:47 UTC 2012
The branch, master has been updated
via 2498f05b7afa17431e9f3f4d6109e995fbec6514 (commit)
via e4743cb6128e5a2a346fcbcbef7a8c9796934e01 (commit)
via d8a478581147fe220b6b4e5425e2570021a7d2b5 (commit)
via 9b410a87bfebfb3329e30f5949070a81bb22235a (commit)
via d6c5f0605f3d7ad837905a13d1d46fe41f3cf7f7 (commit)
via 05b81acbc6b6504b9d5f869465266b8cfa45ace1 (commit)
via 84d243249151b4f949eb88ae16ded1e46f1f2943 (commit)
via 0cd3e789df96be0f94030fffbdfa5675a76ea6a2 (commit)
via 1b235c7827500aace4402a601b5110638214e028 (commit)
via 8e376a021e24671fb9818dd58ff5c1157286b990 (commit)
via 2f691c28713f4c9be59012ed55353c2f10de967c (commit)
via 73d710471643958ac39c8825e1df3d6c0d61a68b (commit)
via d249e34178e27afde1858b28ee7d0e42d847525c (commit)
via ca4a4409f4e7af3bc11eec3d6d40c6a682f17678 (commit)
from b4b7d4a332fb63aa73b5be24be59ff9866c46ed6 (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 2498f05b7afa17431e9f3f4d6109e995fbec6514
Merge: e4743cb b4b7d4a
Author: Mukund Sivaraman <muks at isc.org>
Date: Thu Jun 28 07:24:40 2012 +0530
Merge branch 'master' into trac2025_2
-----------------------------------------------------------------------
Summary of changes:
src/bin/auth/auth_messages.mes | 3 ++
src/bin/auth/auth_srv.cc | 3 ++
src/bin/xfrin/xfrin.py.in | 4 +++
src/bin/xfrout/xfrout.py.in | 3 ++
src/bin/xfrout/xfrout.spec.pre.in | 27 ++++++++++++++++++
src/lib/python/isc/notify/notify_out.py | 6 ++++
.../lettuce/configurations/xfrin/inmem_slave.conf | 4 +--
.../configurations/xfrin/retransfer_master.conf | 8 ++++--
.../configurations/xfrin/retransfer_slave.conf | 4 +--
...fer_slave.conf => retransfer_slave_notify.conf} | 19 +++++++++++--
tests/lettuce/data/.gitignore | 1 +
...frin.sqlite3.orig => xfrin-notify.sqlite3.orig} | Bin 13312 -> 13312 bytes
.../lettuce/features/inmemory_over_sqlite3.feature | 8 +++---
tests/lettuce/features/terrain/bind10_control.py | 4 +--
tests/lettuce/features/terrain/terrain.py | 2 ++
tests/lettuce/features/terrain/transfer.py | 4 +--
tests/lettuce/features/xfrin_bind10.feature | 4 +--
.../lettuce/features/xfrin_notify_handling.feature | 29 ++++++++++++++++++++
18 files changed, 114 insertions(+), 19 deletions(-)
copy tests/lettuce/configurations/xfrin/{retransfer_slave.conf => retransfer_slave_notify.conf} (58%)
copy tests/lettuce/data/{inmem-xfrin.sqlite3.orig => xfrin-notify.sqlite3.orig} (71%)
create mode 100644 tests/lettuce/features/xfrin_notify_handling.feature
-----------------------------------------------------------------------
diff --git a/src/bin/auth/auth_messages.mes b/src/bin/auth/auth_messages.mes
index 9ac2c49..61de3ee 100644
--- a/src/bin/auth/auth_messages.mes
+++ b/src/bin/auth/auth_messages.mes
@@ -110,6 +110,9 @@ look into the cause and address the issue. The log message includes
the client's address (and port), and the error message sent from the
lower layer that detects the failure.
+% AUTH_RECEIVED_NOTIFY received incoming NOTIFY for zone name %1, zone class %2
+This is a debug message reporting that an incoming NOTIFY was received.
+
% AUTH_NOTIFY_QUESTIONS invalid number of questions (%1) in incoming NOTIFY
This debug message is logged by the authoritative server when it receives
a NOTIFY packet that contains zero or more than one question. (A valid
diff --git a/src/bin/auth/auth_srv.cc b/src/bin/auth/auth_srv.cc
index 2a47c38..7b8e963 100644
--- a/src/bin/auth/auth_srv.cc
+++ b/src/bin/auth/auth_srv.cc
@@ -828,6 +828,9 @@ AuthSrvImpl::processNotify(const IOMessage& io_message, Message& message,
return (false);
}
+ LOG_DEBUG(auth_logger, DBG_AUTH_DETAIL, AUTH_RECEIVED_NOTIFY)
+ .arg(question->getName()).arg(question->getClass());
+
const string remote_ip_address =
io_message.getRemoteEndpoint().getAddress().toText();
static const string command_template_start =
diff --git a/src/bin/xfrin/xfrin.py.in b/src/bin/xfrin/xfrin.py.in
index 652f870..1f04bee 100755
--- a/src/bin/xfrin/xfrin.py.in
+++ b/src/bin/xfrin/xfrin.py.in
@@ -889,6 +889,10 @@ class XfrinConnection(asyncore.dispatcher):
req_str = 'IXFR' if request_type == RRType.IXFR() else 'AXFR'
if check_soa:
self._check_soa_serial()
+ self.close()
+ self.init_socket()
+ if not self.connect_to_master():
+ raise XfrinException('Unable to reconnect to master')
logger.info(XFRIN_XFR_TRANSFER_STARTED, req_str, self.zone_str())
self._send_query(self._request_type)
diff --git a/src/bin/xfrout/xfrout.py.in b/src/bin/xfrout/xfrout.py.in
index 46ae687..6576432 100755
--- a/src/bin/xfrout/xfrout.py.in
+++ b/src/bin/xfrout/xfrout.py.in
@@ -952,6 +952,9 @@ class XfroutServer:
def _start_notifier(self):
datasrc = self._unix_socket_server.get_db_file()
self._notifier = notify_out.NotifyOut(datasrc)
+ if 'also_notify' in self._config_data:
+ for slave in self._config_data['also_notify']:
+ 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..dfcc6d9 100644
--- a/src/bin/xfrout/xfrout.spec.pre.in
+++ b/src/bin/xfrout/xfrout.spec.pre.in
@@ -21,6 +21,33 @@
}
},
{
+ "item_name": "also_notify",
+ "item_type": "list",
+ "item_optional": true,
+ "item_default": [],
+ "list_item_spec":
+ {
+ "item_name": "also_notify_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": "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..34db14c 100644
--- a/src/lib/python/isc/notify/notify_out.py
+++ b/src/lib/python/isc/notify/notify_out.py
@@ -161,6 +161,12 @@ 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 in self._notify_infos:
+ 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/inmem_slave.conf b/tests/lettuce/configurations/xfrin/inmem_slave.conf
index a6d88ee..9b69300 100644
--- a/tests/lettuce/configurations/xfrin/inmem_slave.conf
+++ b/tests/lettuce/configurations/xfrin/inmem_slave.conf
@@ -19,8 +19,8 @@
} ]
} ],
"listen_on": [ {
- "port": 47806,
- "address": "127.0.0.1"
+ "address": "::1",
+ "port": 47806
} ]
},
"Boss": {
diff --git a/tests/lettuce/configurations/xfrin/retransfer_master.conf b/tests/lettuce/configurations/xfrin/retransfer_master.conf
index eae47a6..378cff9 100644
--- a/tests/lettuce/configurations/xfrin/retransfer_master.conf
+++ b/tests/lettuce/configurations/xfrin/retransfer_master.conf
@@ -10,13 +10,17 @@
"Auth": {
"database_file": "data/example.org.sqlite3",
"listen_on": [ {
- "port": 47807,
- "address": "::1"
+ "address": "::1",
+ "port": 47807
} ]
},
"Xfrout": {
"zone_config": [ {
"origin": "example.org"
+ } ],
+ "also_notify": [ {
+ "address": "::1",
+ "port": 47806
} ]
},
"Boss": {
diff --git a/tests/lettuce/configurations/xfrin/retransfer_slave.conf b/tests/lettuce/configurations/xfrin/retransfer_slave.conf
index 2296b8f..260147d 100644
--- a/tests/lettuce/configurations/xfrin/retransfer_slave.conf
+++ b/tests/lettuce/configurations/xfrin/retransfer_slave.conf
@@ -10,8 +10,8 @@
"Auth": {
"database_file": "data/test_nonexistent_db.sqlite3",
"listen_on": [ {
- "port": 47806,
- "address": "127.0.0.1"
+ "address": "::1",
+ "port": 47806
} ]
},
"Boss": {
diff --git a/tests/lettuce/configurations/xfrin/retransfer_slave_notify.conf b/tests/lettuce/configurations/xfrin/retransfer_slave_notify.conf
new file mode 100644
index 0000000..57244a4
--- /dev/null
+++ b/tests/lettuce/configurations/xfrin/retransfer_slave_notify.conf
@@ -0,0 +1,38 @@
+{
+ "version": 2,
+ "Logging": {
+ "loggers": [ {
+ "debuglevel": 99,
+ "severity": "DEBUG",
+ "name": "*"
+ } ]
+ },
+ "Auth": {
+ "database_file": "data/xfrin-notify.sqlite3",
+ "listen_on": [ {
+ "address": "::1",
+ "port": 47806
+ } ]
+ },
+ "Xfrin": {
+ "zones": [ {
+ "name": "example.org",
+ "master_addr": "::1",
+ "master_port": 47807
+ } ]
+ },
+ "Zonemgr": {
+ "secondary_zones": [ {
+ "name": "example.org",
+ "class": "IN"
+ } ]
+ },
+ "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" }
+ }
+ }
+}
diff --git a/tests/lettuce/data/.gitignore b/tests/lettuce/data/.gitignore
index 8c54200..888175e 100644
--- a/tests/lettuce/data/.gitignore
+++ b/tests/lettuce/data/.gitignore
@@ -1,2 +1,3 @@
/inmem-xfrin.sqlite3
/test_nonexistent_db.sqlite3
+/xfrin-notify.sqlite3
diff --git a/tests/lettuce/data/xfrin-notify.sqlite3.orig b/tests/lettuce/data/xfrin-notify.sqlite3.orig
new file mode 100644
index 0000000..3c38322
Binary files /dev/null and b/tests/lettuce/data/xfrin-notify.sqlite3.orig differ
diff --git a/tests/lettuce/features/inmemory_over_sqlite3.feature b/tests/lettuce/features/inmemory_over_sqlite3.feature
index 2e48689..851caca 100644
--- a/tests/lettuce/features/inmemory_over_sqlite3.feature
+++ b/tests/lettuce/features/inmemory_over_sqlite3.feature
@@ -26,18 +26,18 @@ Feature: In-memory zone using SQLite3 backend
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
+ A query for www.example.org to [::1]:47806 should have rcode NOERROR
"""
www.example.org. 3600 IN A 192.0.2.63
"""
- A query for mail.example.org should have rcode NXDOMAIN
+ A query for mail.example.org to [::1]:47806 should have rcode NXDOMAIN
When I send bind10 the command Xfrin retransfer example.org IN ::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
+ A query for www.example.org to [::1]:47807 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
+ A query for mail.example.org to [::1]:47806 should have rcode NOERROR
diff --git a/tests/lettuce/features/terrain/bind10_control.py b/tests/lettuce/features/terrain/bind10_control.py
index a08a887..248c6ec 100644
--- a/tests/lettuce/features/terrain/bind10_control.py
+++ b/tests/lettuce/features/terrain/bind10_control.py
@@ -306,8 +306,8 @@ def config_remove_command(step, name, value, cmdctl_port):
"quit"]
run_bindctl(commands, cmdctl_port)
- at step('send bind10 the command (.+)(?: with cmdctl port (\d+))?')
-def send_command(step, command, cmdctl_port):
+ at step('send bind10(?: with cmdctl port (\d+))? the command (.+)')
+def send_command(step, cmdctl_port, command):
"""
Run bindctl, send the given command, and exit bindctl.
Parameters:
diff --git a/tests/lettuce/features/terrain/terrain.py b/tests/lettuce/features/terrain/terrain.py
index a35d0de..876e7cf 100644
--- a/tests/lettuce/features/terrain/terrain.py
+++ b/tests/lettuce/features/terrain/terrain.py
@@ -59,6 +59,8 @@ copylist = [
"configurations/ddns/noddns.config"],
["data/inmem-xfrin.sqlite3.orig",
"data/inmem-xfrin.sqlite3"],
+ ["data/xfrin-notify.sqlite3.orig",
+ "data/xfrin-notify.sqlite3"],
["data/ddns/example.org.sqlite3.orig",
"data/ddns/example.org.sqlite3"]
]
diff --git a/tests/lettuce/features/terrain/transfer.py b/tests/lettuce/features/terrain/transfer.py
index 4ba45b8..eb4ddc0 100644
--- a/tests/lettuce/features/terrain/transfer.py
+++ b/tests/lettuce/features/terrain/transfer.py
@@ -67,11 +67,11 @@ def perform_axfr(step, zone_name, address, port):
Step definition:
An AXFR transfer of <zone_name> [from <address>:<port>]
- Address defaults to 127.0.0.1
+ Address defaults to ::1
Port defaults to 47806
"""
if address is None:
- address = "127.0.0.1"
+ address = "::1"
# convert [IPv6_addr] to IPv6_addr:
address = re.sub(r"\[(.+)\]", r"\1", address)
if port is None:
diff --git a/tests/lettuce/features/xfrin_bind10.feature b/tests/lettuce/features/xfrin_bind10.feature
index 27dfb83..7a45ddd 100644
--- a/tests/lettuce/features/xfrin_bind10.feature
+++ b/tests/lettuce/features/xfrin_bind10.feature
@@ -23,11 +23,11 @@ Feature: Xfrin
# Now we use the first step again to see if the file has been created
The file data/test_nonexistent_db.sqlite3 should exist
- A query for www.example.org should have rcode REFUSED
+ A query for www.example.org to [::1]:47806 should have rcode REFUSED
When I send bind10 the command Xfrin retransfer example.org IN ::1 47807
Then wait for new bind10 stderr message XFRIN_TRANSFER_SUCCESS not XFRIN_XFR_PROCESS_FAILURE
Then wait for new bind10 stderr message ZONEMGR_RECEIVE_XFRIN_SUCCESS
- A query for www.example.org should have rcode NOERROR
+ A query for www.example.org to [::1]:47806 should have rcode NOERROR
# The transferred zone should have 11 non-NSEC3 RRs and 1 NSEC3 RR.
# The following check will get these by AXFR, so the total # of RRs
diff --git a/tests/lettuce/features/xfrin_notify_handling.feature b/tests/lettuce/features/xfrin_notify_handling.feature
new file mode 100644
index 0000000..e514b83
--- /dev/null
+++ b/tests/lettuce/features/xfrin_notify_handling.feature
@@ -0,0 +1,29 @@
+Feature: Xfrin incoming notify handling
+ Tests for Xfrin incoming notify handling.
+
+ Scenario: Handle incoming notify
+ 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/retransfer_slave_notify.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 to [::1]:47806 should have rcode NXDOMAIN
+
+ When I send bind10 with cmdctl port 47804 the command Xfrout notify example.org IN
+ Then wait for new master stderr message XFROUT_NOTIFY_COMMAND
+ Then wait for new bind10 stderr message AUTH_RECEIVED_NOTIFY
+ Then wait for new bind10 stderr message ZONEMGR_RECEIVE_NOTIFY
+ Then wait for new bind10 stderr message XFRIN_XFR_TRANSFER_STARTED
+ Then wait for new bind10 stderr message XFRIN_TRANSFER_SUCCESS not XFRIN_XFR_PROCESS_FAILURE
+ Then wait for new bind10 stderr message ZONEMGR_RECEIVE_XFRIN_SUCCESS
+
+ A query for www.example.org to [::1]:47806 should have rcode NOERROR
More information about the bind10-changes
mailing list