BIND 10 master, updated. f987a99a35de4596af2021d441698f8425298663 [1790] Update backend filenames to match the filetype
BIND 10 source code commits
bind10-changes at lists.isc.org
Mon May 14 18:14:16 UTC 2012
The branch, master has been updated
via f987a99a35de4596af2021d441698f8425298663 (commit)
via d872878ef5d5e6ccdd03803a76a8162dabab1147 (commit)
via b685e7c4e4fdfde574993839eb00d9e001aad379 (commit)
via ffdc8bef2778bd4aa1c69120cd759e4a9787b34c (commit)
via 6d2d11d4bd5ba585f773309760b539fc6da64f3f (commit)
via 286753919453c62ec150306ce6bdc1f5f5fe89d9 (commit)
via 95b852252c2d8e81b3235246f3e8ee63b6943afb (commit)
via 631dc5b98750e2ffb1f53845b7f4888d894c9354 (commit)
via d05c3695d4b198fbb6bc0e66fa8a2b18db098527 (commit)
via 33d21231741cb9dbacfdfe3fe3a09d2919464fbc (commit)
via 5de8f5172aa4becbf65c6918095d23d08bc9d19c (commit)
via 613641bd80c49e8094efbbf809623154804adcfa (commit)
via 9a9348605260eba1ff3ee2cbfd58d1f07779414e (commit)
via d59c24a32a58bd5edf37d32faccff6cdfc362f9d (commit)
via ab86972df562a452de633cb13403f0ed8eb00510 (commit)
via 84f5946ae2885cae3412fe2b5855c0d954796877 (commit)
via 7eb4965e0a67bac076e50a769ca9284a591abe20 (commit)
via c46763c887f9cef568cae847bffc72f1b0c939b2 (commit)
via a1528b46bf4a76a2a07736ad2b3b5421298568ae (commit)
via c2d70c85d3c5b06f05952cb4227485a2dc6630ac (commit)
via 9dc2c2ee14162ff74a1509ce620daa28fdf29261 (commit)
from bce439d0e7c18c147f3f675c03e40ecbd92fc65f (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 f987a99a35de4596af2021d441698f8425298663
Author: Mukund Sivaraman <muks at isc.org>
Date: Mon May 14 22:34:01 2012 +0530
[1790] Update backend filenames to match the filetype
commit d872878ef5d5e6ccdd03803a76a8162dabab1147
Author: Mukund Sivaraman <muks at isc.org>
Date: Thu May 10 09:30:50 2012 +0530
[1790] Add more testcases for missing keys
Strictly, this is not necessary as the spec file schema would check for
it.
commit b685e7c4e4fdfde574993839eb00d9e001aad379
Author: Mukund Sivaraman <muks at isc.org>
Date: Thu May 10 09:20:08 2012 +0530
[1790] Use appropriate boolean assert calls
commit ffdc8bef2778bd4aa1c69120cd759e4a9787b34c
Author: Mukund Sivaraman <muks at isc.org>
Date: Thu May 10 09:18:04 2012 +0530
[1790] Update testcase descriptions
commit 6d2d11d4bd5ba585f773309760b539fc6da64f3f
Author: Mukund Sivaraman <muks at isc.org>
Date: Tue May 8 12:34:12 2012 +0530
[1790] Also handle the case where published is not OK
commit 286753919453c62ec150306ce6bdc1f5f5fe89d9
Author: Mukund Sivaraman <muks at isc.org>
Date: Tue May 8 10:19:52 2012 +0530
[1790] Use a simpler constructor
commit 95b852252c2d8e81b3235246f3e8ee63b6943afb
Author: Mukund Sivaraman <muks at isc.org>
Date: Tue May 8 10:05:57 2012 +0530
[1790] Add unit tests using mock objects
commit 631dc5b98750e2ffb1f53845b7f4888d894c9354
Author: Mukund Sivaraman <muks at isc.org>
Date: Tue May 8 08:23:53 2012 +0530
[master] Fix test class name
commit d05c3695d4b198fbb6bc0e66fa8a2b18db098527
Author: Mukund Sivaraman <muks at isc.org>
Date: Fri May 4 10:01:31 2012 +0530
[1790] Don't catch exceptions caused by msgq failures
commit 33d21231741cb9dbacfdfe3fe3a09d2919464fbc
Author: Mukund Sivaraman <muks at isc.org>
Date: Fri May 4 09:55:19 2012 +0530
[1790] When throwing RR parameter exceptions, include the bad string as well
commit 5de8f5172aa4becbf65c6918095d23d08bc9d19c
Author: Mukund Sivaraman <muks at isc.org>
Date: Thu May 3 10:22:28 2012 +0530
[1790] Don't use the same log message id twice
commit 613641bd80c49e8094efbbf809623154804adcfa
Author: Mukund Sivaraman <muks at isc.org>
Date: Tue May 1 06:23:55 2012 +0530
[master] Check for nonexistent db right after BIND starts (contd.)
commit 9a9348605260eba1ff3ee2cbfd58d1f07779414e
Author: Mukund Sivaraman <muks at isc.org>
Date: Tue May 1 06:19:31 2012 +0530
[master] Check for nonexistent db right after BIND starts
commit d59c24a32a58bd5edf37d32faccff6cdfc362f9d
Author: Mukund Sivaraman <muks at isc.org>
Date: Fri Apr 20 16:38:40 2012 +0530
[1790] Untabify files
commit ab86972df562a452de633cb13403f0ed8eb00510
Author: Mukund Sivaraman <muks at isc.org>
Date: Fri Apr 20 16:35:59 2012 +0530
[1790] Address review comments (see full log)
* The filetype parameter is optional, which means it might be missing
from the dict. Therefore indexing it with zone["filetype"] without
further check is unsafe. We check for this key now.
* The handling of origin and dots is needlessly complicated. We now
create Name objects of both and compare them. We also use RRClass
objects for the zone class. This makes sure the comparison is correct
one.
commit 84f5946ae2885cae3412fe2b5855c0d954796877
Author: Mukund Sivaraman <muks at isc.org>
Date: Fri Apr 20 12:32:00 2012 +0530
[1794] Add a lettuce test for updating in-memory after xfr feature
commit 7eb4965e0a67bac076e50a769ca9284a591abe20
Author: Mukund Sivaraman <muks at isc.org>
Date: Fri Apr 20 12:20:07 2012 +0530
[master] Use IPv4 addresses in tests consistently
commit c46763c887f9cef568cae847bffc72f1b0c939b2
Author: Mukund Sivaraman <muks at isc.org>
Date: Fri Apr 20 12:19:23 2012 +0530
[1790] Bugfix _do_auth_loadzone implementation
commit a1528b46bf4a76a2a07736ad2b3b5421298568ae
Author: Mukund Sivaraman <muks at isc.org>
Date: Fri Apr 20 10:18:48 2012 +0530
[master] Update the xfrin_bind10.feature test
* Remove the redundant CMDCTL_STARTED check
* Add checks for data/test_nonexistent_db.sqlite3
commit c2d70c85d3c5b06f05952cb4227485a2dc6630ac
Author: Mukund Sivaraman <muks at isc.org>
Date: Fri Apr 20 09:56:23 2012 +0530
[1900] Check for CC status before starting inmemory_over_sqlite3.feature
commit 9dc2c2ee14162ff74a1509ce620daa28fdf29261
Author: Mukund Sivaraman <muks at isc.org>
Date: Tue Apr 17 19:03:52 2012 +0530
[1790] After successful zone transfers, send b10-auth loadzone if necessary
-----------------------------------------------------------------------
Summary of changes:
src/bin/xfrin/tests/xfrin_test.py | 187 +++++++++++++++++++-
src/bin/xfrin/xfrin.py.in | 53 ++++++-
src/bin/xfrin/xfrin_messages.mes | 15 ++
src/lib/dns/rrparamregistry-placeholder.cc | 2 +-
.../inmemory_over_sqlite3/secondary.conf | 2 +-
.../secondary.conf => xfrin/inmem_slave.conf} | 10 +-
.../configurations/xfrin/retransfer_master.conf | 2 +-
tests/lettuce/data/inmem-xfrin | 7 +
.../lettuce/data/inmem-xfrin.sqlite3.orig | Bin 13312 -> 13312 bytes
tests/lettuce/features/example.feature | 16 +-
.../lettuce/features/inmemory_over_sqlite3.feature | 35 ++++-
tests/lettuce/features/terrain/terrain.py | 4 +-
tests/lettuce/features/xfrin_bind10.feature | 12 +-
13 files changed, 322 insertions(+), 23 deletions(-)
copy tests/lettuce/configurations/{inmemory_over_sqlite3/secondary.conf => xfrin/inmem_slave.conf} (78%)
create mode 100644 tests/lettuce/data/inmem-xfrin
copy src/bin/dbutil/tests/testdata/empty_version.sqlite3 => tests/lettuce/data/inmem-xfrin.sqlite3.orig (72%)
-----------------------------------------------------------------------
diff --git a/src/bin/xfrin/tests/xfrin_test.py b/src/bin/xfrin/tests/xfrin_test.py
index b88d6a9..a860022 100644
--- a/src/bin/xfrin/tests/xfrin_test.py
+++ b/src/bin/xfrin/tests/xfrin_test.py
@@ -2577,7 +2577,7 @@ class TestXfrin(unittest.TestCase):
self.common_ixfr_setup('refresh', False)
self.assertEqual(RRType.AXFR(), self.xfr.xfrin_started_request_type)
-class TextXfrinMemoryZones(unittest.TestCase):
+class TestXfrinMemoryZones(unittest.TestCase):
def setUp(self):
self.xfr = MockXfrin()
# Configuration snippet containing 2 memory datasources,
@@ -2736,6 +2736,44 @@ class TestMain(unittest.TestCase):
MockXfrin.check_command_hook = raise_exception
main(MockXfrin, False)
+class TestXfrinProcessMockCC:
+ def __init__(self):
+ self.get_called = False
+ self.get_called_correctly = False
+ self.config = []
+
+ def get_remote_config_value(self, module, identifier):
+ self.get_called = True
+ if module == 'Auth' and identifier == 'datasources':
+ self.get_called_correctly = True
+ return (self.config, False)
+ else:
+ return (None, True)
+
+class TestXfrinProcessMockCCSession:
+ def __init__(self):
+ self.send_called = False
+ self.send_called_correctly = False
+ self.recv_called = False
+ self.recv_called_correctly = False
+
+ def group_sendmsg(self, msg, module):
+ self.send_called = True
+ if module == 'Auth' and msg['command'][0] == 'loadzone':
+ self.send_called_correctly = True
+ seq = "random-e068c2de26d760f20cf10afc4b87ef0f"
+ else:
+ seq = None
+
+ return seq
+
+ def group_recvmsg(self, message, seq):
+ self.recv_called = True
+ if message == False and seq == "random-e068c2de26d760f20cf10afc4b87ef0f":
+ self.recv_called_correctly = True
+ # return values are ignored
+ return (None, None)
+
class TestXfrinProcess(unittest.TestCase):
"""
Some tests for the xfrin_process function. This replaces the
@@ -2751,6 +2789,8 @@ class TestXfrinProcess(unittest.TestCase):
Also sets up several internal variables to watch what happens.
"""
+ self._module_cc = TestXfrinProcessMockCC()
+ self._send_cc_session = TestXfrinProcessMockCCSession()
# This will hold a "log" of what transfers were attempted.
self.__transfers = []
# This will "log" if failures or successes happened.
@@ -2795,6 +2835,9 @@ class TestXfrinProcess(unittest.TestCase):
Part of pretending to be the server as well. This just logs the
success/failure of the previous operation.
"""
+ if ret == XFRIN_OK:
+ xfrin._do_auth_loadzone(self, zone_name, rrclass)
+
self.__published.append(ret)
def close(self):
@@ -2825,12 +2868,22 @@ class TestXfrinProcess(unittest.TestCase):
# Create a connection for each attempt
self.assertEqual(len(transfers), self.__created_connections)
self.assertEqual([published], self.__published)
+ if published == XFRIN_OK:
+ self.assertTrue(self._module_cc.get_called)
+ self.assertTrue(self._module_cc.get_called_correctly)
+ else:
+ self.assertFalse(self._module_cc.get_called)
+ self.assertFalse(self._module_cc.get_called_correctly)
def test_ixfr_ok(self):
"""
Everything OK the first time, over IXFR.
"""
self.__do_test([XFRIN_OK], [RRType.IXFR()], RRType.IXFR())
+ self.assertFalse(self._send_cc_session.send_called)
+ self.assertFalse(self._send_cc_session.send_called_correctly)
+ self.assertFalse(self._send_cc_session.recv_called)
+ self.assertFalse(self._send_cc_session.recv_called_correctly)
def test_axfr_ok(self):
"""
@@ -2861,6 +2914,138 @@ class TestXfrinProcess(unittest.TestCase):
"""
self.__do_test([XFRIN_FAIL, XFRIN_FAIL],
[RRType.IXFR(), RRType.AXFR()], RRType.IXFR())
+
+ def test_inmem_ok(self):
+ """
+ Inmem configuration where all the configuration is just right
+ for loadzone to be sent to b10-auth (origin is the name received
+ by xfrin, filetype is sqlite3, type is memory and class is the
+ one received by xfrin).
+ """
+ self._module_cc.config = [{'zones': [{'origin': 'example.org', 'filetype': 'sqlite3',
+ 'file': 'data/inmem-xfrin.sqlite3'}],
+ 'type': 'memory', 'class': 'IN'}]
+ self.__do_test([XFRIN_OK], [RRType.IXFR()], RRType.IXFR())
+ self.assertTrue(self._send_cc_session.send_called)
+ self.assertTrue(self._send_cc_session.send_called_correctly)
+ self.assertTrue(self._send_cc_session.recv_called)
+ self.assertTrue(self._send_cc_session.recv_called_correctly)
+
+ def test_inmem_datasource_type_not_memory(self):
+ """
+ Inmem configuration where the datasource type is not memory. In
+ this case, loadzone should not be sent to b10-auth.
+ """
+ self._module_cc.config = [{'zones': [{'origin': 'example.org', 'filetype': 'sqlite3',
+ 'file': 'data/inmem-xfrin.sqlite3'}],
+ 'type': 'punched-card', 'class': 'IN'}]
+ self.__do_test([XFRIN_OK], [RRType.IXFR()], RRType.IXFR())
+ self.assertFalse(self._send_cc_session.send_called)
+ self.assertFalse(self._send_cc_session.send_called_correctly)
+ self.assertFalse(self._send_cc_session.recv_called)
+ self.assertFalse(self._send_cc_session.recv_called_correctly)
+
+ def test_inmem_datasource_type_is_missing(self):
+ """
+ Inmem configuration where the datasource type is missing. In
+ this case, loadzone should not be sent to b10-auth.
+ """
+ self._module_cc.config = [{'zones': [{'origin': 'example.org', 'filetype': 'sqlite3',
+ 'file': 'data/inmem-xfrin.sqlite3'}],
+ 'class': 'IN'}]
+ self.__do_test([XFRIN_OK], [RRType.IXFR()], RRType.IXFR())
+ self.assertFalse(self._send_cc_session.send_called)
+ self.assertFalse(self._send_cc_session.send_called_correctly)
+ self.assertFalse(self._send_cc_session.recv_called)
+ self.assertFalse(self._send_cc_session.recv_called_correctly)
+
+ def test_inmem_backend_type_not_sqlite3(self):
+ """
+ Inmem configuration where the datasource backing file is not of
+ type sqlite3. In this case, loadzone should not be sent to
+ b10-auth.
+ """
+ self._module_cc.config = [{'zones': [{'origin': 'example.org', 'filetype': 'postgresql',
+ 'file': 'data/inmem-xfrin.db'}],
+ 'type': 'memory', 'class': 'IN'}]
+ self.__do_test([XFRIN_OK], [RRType.IXFR()], RRType.IXFR())
+ self.assertFalse(self._send_cc_session.send_called)
+ self.assertFalse(self._send_cc_session.send_called_correctly)
+ self.assertFalse(self._send_cc_session.recv_called)
+ self.assertFalse(self._send_cc_session.recv_called_correctly)
+
+ def test_inmem_backend_type_is_missing(self):
+ """
+ Inmem configuration where the datasource backing file type is
+ not set. In this case, loadzone should not be sent to b10-auth.
+ """
+ self._module_cc.config = [{'zones': [{'origin': 'example.org',
+ 'file': 'data/inmem-xfrin'}],
+ 'type': 'memory', 'class': 'IN'}]
+ self.__do_test([XFRIN_OK], [RRType.IXFR()], RRType.IXFR())
+ self.assertFalse(self._send_cc_session.send_called)
+ self.assertFalse(self._send_cc_session.send_called_correctly)
+ self.assertFalse(self._send_cc_session.recv_called)
+ self.assertFalse(self._send_cc_session.recv_called_correctly)
+
+ def test_inmem_class_is_different(self):
+ """
+ Inmem configuration where the datasource class does not match
+ the received class. In this case, loadzone should not be sent to
+ b10-auth.
+ """
+ self._module_cc.config = [{'zones': [{'origin': 'example.org', 'filetype': 'sqlite3',
+ 'file': 'data/inmem-xfrin.sqlite3'}],
+ 'type': 'memory', 'class': 'XX'}]
+ self.__do_test([XFRIN_OK], [RRType.IXFR()], RRType.IXFR())
+ self.assertFalse(self._send_cc_session.send_called)
+ self.assertFalse(self._send_cc_session.send_called_correctly)
+ self.assertFalse(self._send_cc_session.recv_called)
+ self.assertFalse(self._send_cc_session.recv_called_correctly)
+
+ def test_inmem_class_is_missing(self):
+ """
+ Inmem configuration where the datasource class is missing. In
+ this case, we assume the IN class and loadzone may be sent to
+ b10-auth if everything else matches.
+ """
+ self._module_cc.config = [{'zones': [{'origin': 'example.org', 'filetype': 'sqlite3',
+ 'file': 'data/inmem-xfrin.sqlite3'}],
+ 'type': 'memory'}]
+ self.__do_test([XFRIN_OK], [RRType.IXFR()], RRType.IXFR())
+ self.assertTrue(self._send_cc_session.send_called)
+ self.assertTrue(self._send_cc_session.send_called_correctly)
+ self.assertTrue(self._send_cc_session.recv_called)
+ self.assertTrue(self._send_cc_session.recv_called_correctly)
+
+ def test_inmem_name_doesnt_match(self):
+ """
+ Inmem configuration where the origin does not match the received
+ name. In this case, loadzone should not be sent to b10-auth.
+ """
+ self._module_cc.config = [{'zones': [{'origin': 'isc.org', 'filetype': 'sqlite3',
+ 'file': 'data/inmem-xfrin.sqlite3'}],
+ 'type': 'memory', 'class': 'IN'}]
+ self.__do_test([XFRIN_OK], [RRType.IXFR()], RRType.IXFR())
+ self.assertFalse(self._send_cc_session.send_called)
+ self.assertFalse(self._send_cc_session.send_called_correctly)
+ self.assertFalse(self._send_cc_session.recv_called)
+ self.assertFalse(self._send_cc_session.recv_called_correctly)
+
+ def test_inmem_name_is_missing(self):
+ """
+ Inmem configuration where the origin is missing. In this case,
+ loadzone should not be sent to b10-auth.
+ """
+ self._module_cc.config = [{'zones': [{'filetype': 'sqlite3',
+ 'file': 'data/inmem-xfrin.sqlite3'}],
+ 'type': 'memory', 'class': 'IN'}]
+ self.__do_test([XFRIN_OK], [RRType.IXFR()], RRType.IXFR())
+ self.assertFalse(self._send_cc_session.send_called)
+ self.assertFalse(self._send_cc_session.send_called_correctly)
+ self.assertFalse(self._send_cc_session.recv_called)
+ self.assertFalse(self._send_cc_session.recv_called_correctly)
+
class TestFormatting(unittest.TestCase):
# If the formatting functions are moved to a more general library
# (ticket #1379), these tests should be moved with them.
diff --git a/src/bin/xfrin/xfrin.py.in b/src/bin/xfrin/xfrin.py.in
index 27b91a9..114bac4 100755
--- a/src/bin/xfrin/xfrin.py.in
+++ b/src/bin/xfrin/xfrin.py.in
@@ -66,6 +66,7 @@ else:
SPECFILE_LOCATION = SPECFILE_PATH + "/xfrin.spec"
AUTH_SPECFILE_LOCATION = AUTH_SPECFILE_PATH + "/auth.spec"
+AUTH_MODULE_NAME = 'Auth'
XFROUT_MODULE_NAME = 'Xfrout'
ZONE_MANAGER_MODULE_NAME = 'Zonemgr'
REFRESH_FROM_ZONEMGR = 'refresh_from_zonemgr'
@@ -1246,6 +1247,52 @@ class ZoneInfo:
return (self.master_addr.family, socket.SOCK_STREAM,
(str(self.master_addr), self.master_port))
+def _do_auth_loadzone(server, zone_name, zone_class):
+ # On a successful zone transfer, if the zone is served by
+ # b10-auth in the in-memory data source using sqlite3 as a
+ # backend, send the "loadzone" command for the zone to auth.
+ datasources, is_default =\
+ server._module_cc.get_remote_config_value(AUTH_MODULE_NAME, "datasources")
+ if is_default:
+ return
+ for d in datasources:
+ if "type" not in d:
+ continue
+ try:
+ if "class" in d:
+ dclass = RRClass(d["class"])
+ else:
+ dclass = RRClass("IN")
+ except InvalidRRClass as err:
+ logger.info(XFRIN_AUTH_CONFIG_RRCLASS_ERROR, str(err))
+ continue
+
+ if d["type"].lower() == "memory" and dclass == zone_class:
+ for zone in d["zones"]:
+ if "filetype" not in zone:
+ continue
+ if "origin" not in zone:
+ continue
+ if "filetype" not in zone:
+ continue
+ try:
+ name = Name(zone["origin"])
+ except (EmptyLabel, TooLongLabel, BadLabelType, BadEscape, TooLongName, IncompleteName):
+ logger.info(XFRIN_AUTH_CONFIG_NAME_PARSER_ERROR, str(err))
+ continue
+
+ if zone["filetype"].lower() == "sqlite3" and name == zone_name:
+ param = {"origin": zone_name.to_text(),
+ "class": zone_class.to_text(),
+ "datasrc": d["type"]}
+
+ logger.debug(DBG_XFRIN_TRACE, XFRIN_AUTH_LOADZONE,
+ param["origin"], param["class"], param["datasrc"])
+
+ msg = create_command("loadzone", param)
+ seq = server._send_cc_session.group_sendmsg(msg, AUTH_MODULE_NAME)
+ answer, env = server._send_cc_session.group_recvmsg(False, seq)
+
class Xfrin:
def __init__(self):
self._max_transfers_in = 10
@@ -1529,7 +1576,7 @@ class Xfrin:
def _set_db_file(self):
db_file, is_default =\
- self._module_cc.get_remote_config_value("Auth", "database_file")
+ self._module_cc.get_remote_config_value(AUTH_MODULE_NAME, "database_file")
if is_default and "B10_FROM_BUILD" in os.environ:
# override the local database setting if it is default and we
# are running from the source tree
@@ -1539,7 +1586,7 @@ class Xfrin:
"bind10_zones.sqlite3"
self._db_file = db_file
- def publish_xfrin_news(self, zone_name, zone_class, xfr_result):
+ def publish_xfrin_news(self, zone_name, zone_class, xfr_result):
'''Send command to xfrout/zone manager module.
If xfrin has finished successfully for one zone, tell the good
news(command: zone_new_data_ready) to zone manager and xfrout.
@@ -1548,6 +1595,7 @@ class Xfrin:
param = {'zone_name': zone_name.to_text(),
'zone_class': zone_class.to_text()}
if xfr_result == XFRIN_OK:
+ _do_auth_loadzone(self, zone_name, zone_class)
msg = create_command(notify_out.ZONE_NEW_DATA_READY_CMD, param)
# catch the exception, in case msgq has been killed.
try:
@@ -1566,6 +1614,7 @@ class Xfrin:
pass # for now we just ignore the failure
except socket.error as err:
logger.error(XFRIN_MSGQ_SEND_ERROR, XFROUT_MODULE_NAME, ZONE_MANAGER_MODULE_NAME)
+
else:
msg = create_command(ZONE_XFRIN_FAILED, param)
# catch the exception, in case msgq has been killed.
diff --git a/src/bin/xfrin/xfrin_messages.mes b/src/bin/xfrin/xfrin_messages.mes
index 25a1fc1..60d7c9c 100644
--- a/src/bin/xfrin/xfrin_messages.mes
+++ b/src/bin/xfrin/xfrin_messages.mes
@@ -117,6 +117,21 @@ was killed.
There was a problem sending a message to the zone manager. This most
likely means that the msgq daemon has quit or was killed.
+% XFRIN_MSGQ_SEND_ERROR_AUTH error while contacting %1
+There was a problem sending a message to b10-auth. This most likely
+means that the msgq daemon has quit or was killed.
+
+% XFRIN_AUTH_CONFIG_RRCLASS_ERROR Invalid RRClass when parsing Auth configuration: %1
+There was an invalid RR class when parsing Auth configuration.
+
+% XFRIN_AUTH_CONFIG_NAME_PARSER_ERROR Invalid name when parsing Auth configuration: %1
+There was an invalid name when parsing Auth configuration.
+
+% XFRIN_AUTH_LOADZONE sending Auth loadzone for origin=%1, class=%2, datasrc=%3
+There was a successful zone transfer, and the zone is served by b10-auth
+in the in-memory data source using sqlite3 as a backend. We send the
+"loadzone" command for the zone to b10-auth.
+
% XFRIN_NOTIFY_UNKNOWN_MASTER got notification to retransfer zone %1 from %2, expected %3
The system received a notify for the given zone, but the address it came
from does not match the master address in the Xfrin configuration. The notify
diff --git a/src/lib/dns/rrparamregistry-placeholder.cc b/src/lib/dns/rrparamregistry-placeholder.cc
index 62a9e34..8b01e41 100644
--- a/src/lib/dns/rrparamregistry-placeholder.cc
+++ b/src/lib/dns/rrparamregistry-placeholder.cc
@@ -401,7 +401,7 @@ textToCode(const string& code_str, MS& stringmap) {
return (code);
}
}
- isc_throw(ET, "Unrecognized RR parameter string");
+ isc_throw(ET, "Unrecognized RR parameter string: " + code_str);
}
template <typename PT, typename MC>
diff --git a/tests/lettuce/configurations/inmemory_over_sqlite3/secondary.conf b/tests/lettuce/configurations/inmemory_over_sqlite3/secondary.conf
index a104726..8571015 100644
--- a/tests/lettuce/configurations/inmemory_over_sqlite3/secondary.conf
+++ b/tests/lettuce/configurations/inmemory_over_sqlite3/secondary.conf
@@ -4,7 +4,7 @@
"loggers": [ {
"debuglevel": 99,
"severity": "DEBUG",
- "name": "auth"
+ "name": "*"
} ]
},
"Auth": {
diff --git a/tests/lettuce/configurations/xfrin/inmem_slave.conf b/tests/lettuce/configurations/xfrin/inmem_slave.conf
new file mode 100644
index 0000000..a6d88ee
--- /dev/null
+++ b/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" }
+ }
+ }
+}
diff --git a/tests/lettuce/configurations/xfrin/retransfer_master.conf b/tests/lettuce/configurations/xfrin/retransfer_master.conf
index eae47a6..366fdb4 100644
--- a/tests/lettuce/configurations/xfrin/retransfer_master.conf
+++ b/tests/lettuce/configurations/xfrin/retransfer_master.conf
@@ -11,7 +11,7 @@
"database_file": "data/example.org.sqlite3",
"listen_on": [ {
"port": 47807,
- "address": "::1"
+ "address": "127.0.0.1"
} ]
},
"Xfrout": {
diff --git a/tests/lettuce/data/inmem-xfrin b/tests/lettuce/data/inmem-xfrin
new file mode 100644
index 0000000..9e02591
--- /dev/null
+++ b/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
diff --git a/tests/lettuce/data/inmem-xfrin.sqlite3.orig b/tests/lettuce/data/inmem-xfrin.sqlite3.orig
new file mode 100644
index 0000000..287d980
Binary files /dev/null and b/tests/lettuce/data/inmem-xfrin.sqlite3.orig differ
diff --git a/tests/lettuce/features/example.feature b/tests/lettuce/features/example.feature
index ca5ffbf..9b7c2ca 100644
--- a/tests/lettuce/features/example.feature
+++ b/tests/lettuce/features/example.feature
@@ -5,7 +5,7 @@ Feature: Example feature
is intentionally uncommented.
The later scenarios have comments to show what the test steps do and
support
-
+
Scenario: A simple example
Given I have bind10 running with configuration example.org.config
And wait for bind10 stderr message BIND10_STARTED_CC
@@ -29,9 +29,9 @@ Feature: Example feature
# Underwater, we take advantage of our intialization routines so
# that we are sure this file does not exist, see
# features/terrain/terrain.py
-
- # Standard check to test (non-)existence of a file
- # This file is actually automatically
+
+ # Standard check to test (non-)existence of a file.
+ # This file is actually automatically created.
The file data/test_nonexistent_db.sqlite3 should not exist
# In the first scenario, we used 'given I have bind10 running', which
@@ -43,6 +43,9 @@ Feature: Example feature
And wait for bind10 stderr message CMDCTL_STARTED
And wait for bind10 stderr message AUTH_SERVER_STARTED
+ # Now we use the first step again to see if the file has been created
+ The file data/test_nonexistent_db.sqlite3 should exist
+
bind10 module Auth should be running
And bind10 module Resolver should not be running
And bind10 module Xfrout should not be running
@@ -56,16 +59,13 @@ Feature: Example feature
# use in the start step (for bind 10, that is 'I start bind10 with')
# See scenario 'Multiple instances' for more.
Then stop process bind10
-
- # Now we use the first step again to see if the file has been created
- The file data/test_nonexistent_db.sqlite3 should exist
Scenario: example.org queries
# This scenario performs a number of queries and inspects the results
# Simple queries have already been show, but after we have sent a query,
# we can also do more extensive checks on the result.
# See querying.py for more information on these steps.
-
+
# note: lettuce can group similar checks by using tables, but we
# intentionally do not make use of that here
diff --git a/tests/lettuce/features/inmemory_over_sqlite3.feature b/tests/lettuce/features/inmemory_over_sqlite3.feature
index 85737e9..adc1315 100644
--- a/tests/lettuce/features/inmemory_over_sqlite3.feature
+++ b/tests/lettuce/features/inmemory_over_sqlite3.feature
@@ -3,8 +3,41 @@ Feature: In-memory zone using SQLite3 backend
data source that uses the SQLite3 data source as the backend, and tests
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
+ 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
A query for www.example.org should have rcode NOERROR
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
diff --git a/tests/lettuce/features/terrain/terrain.py b/tests/lettuce/features/terrain/terrain.py
index 9a04bf5..caa17ce 100644
--- a/tests/lettuce/features/terrain/terrain.py
+++ b/tests/lettuce/features/terrain/terrain.py
@@ -52,7 +52,9 @@ copylist = [
["configurations/resolver/resolver_basic.config.orig",
"configurations/resolver/resolver_basic.config"],
["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
diff --git a/tests/lettuce/features/xfrin_bind10.feature b/tests/lettuce/features/xfrin_bind10.feature
index 2a56356..3d6e5d2 100644
--- a/tests/lettuce/features/xfrin_bind10.feature
+++ b/tests/lettuce/features/xfrin_bind10.feature
@@ -2,6 +2,10 @@ Feature: Xfrin
Tests for Xfrin, specific for BIND 10 behaviour.
Scenario: Retransfer command
+ # Standard check to test (non-)existence of a file.
+ # This file is actually automatically created.
+ The file data/test_nonexistent_db.sqlite3 should not exist
+
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
@@ -16,9 +20,11 @@ Feature: Xfrin
And wait for bind10 stderr message XFRIN_STARTED
And wait for bind10 stderr message ZONEMGR_STARTED
+ # 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
- Wait for bind10 stderr message CMDCTL_STARTED
- When I send bind10 the command Xfrin retransfer example.org IN ::1 47807
+ 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
A query for www.example.org should have rcode NOERROR
@@ -27,5 +33,5 @@ Feature: Xfrin
# should be 13, counting the duplicated SOA.
# At this point we can confirm both in and out of AXFR for a zone
# containing an NSEC3 RR.
- When I do an AXFR transfer of example.org from ::1 47807
+ When I do an AXFR transfer of example.org from 127.0.0.1 47807
Then transfer result should have 13 rrs
More information about the bind10-changes
mailing list