BIND 10 trac811_new, updated. 7a1c4cc8e1baaf51a2058edd0a4179bd586345f3 [trac811_new] added some trivial editorial changes. also added a test case with an invalid tsigkey string.
BIND 10 source code commits
bind10-changes at lists.isc.org
Tue May 17 00:06:36 UTC 2011
The branch, trac811_new has been updated
via 7a1c4cc8e1baaf51a2058edd0a4179bd586345f3 (commit)
from b6982ea32af206b6ef661b492eea7b274af97bd2 (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 7a1c4cc8e1baaf51a2058edd0a4179bd586345f3
Author: JINMEI Tatuya <jinmei at isc.org>
Date: Mon May 16 17:06:11 2011 -0700
[trac811_new] added some trivial editorial changes. also added a test
case with an invalid tsigkey string.
-----------------------------------------------------------------------
Summary of changes:
src/bin/xfrin/tests/xfrin_test.py | 20 +++++++++++++++++---
src/bin/xfrin/xfrin.py.in | 6 +++---
2 files changed, 20 insertions(+), 6 deletions(-)
-----------------------------------------------------------------------
diff --git a/src/bin/xfrin/tests/xfrin_test.py b/src/bin/xfrin/tests/xfrin_test.py
index e2ad329..abb0bd2 100644
--- a/src/bin/xfrin/tests/xfrin_test.py
+++ b/src/bin/xfrin/tests/xfrin_test.py
@@ -90,8 +90,8 @@ class MockXfrin(Xfrin):
if MockXfrin.check_command_hook:
MockXfrin.check_command_hook()
- def xfrin_start(self, zone_name, rrclass, db_file, master_addrinfo, tsig_key_str,
- check_soa = True):
+ def xfrin_start(self, zone_name, rrclass, db_file, master_addrinfo,
+ tsig_key_str, check_soa=True):
# store some of the arguments for verification, then call this
# method in the superclass
self.xfrin_started_zone_name = zone_name
@@ -101,7 +101,7 @@ class MockXfrin(Xfrin):
self.xfrin_started_tsig_key_str = tsig_key_str
return Xfrin.xfrin_start(self, zone_name, rrclass, db_file,
master_addrinfo, tsig_key_str,
- check_soa = True)
+ check_soa=True)
class MockXfrinConnection(XfrinConnection):
def __init__(self, sock_map, zone_name, rrclass, db_file, shutdown_event,
@@ -560,6 +560,7 @@ class TestXfrin(unittest.TestCase):
def test_command_handler_retransfer_short_command1(self):
# try it when only specifying the zone name (of unknown zone)
+ # this should fail because master address is not specified.
short_args = {}
short_args['zone_name'] = TEST_ZONE_NAME_STR
self.assertEqual(self.xfr.command_handler("retransfer",
@@ -567,6 +568,7 @@ class TestXfrin(unittest.TestCase):
def test_command_handler_retransfer_short_command2(self):
# try it when only specifying the zone name (of unknown zone)
+ # this should fail because master address is not specified.
short_args = {}
short_args['zone_name'] = TEST_ZONE_NAME_STR
self.assertEqual(self.xfr.command_handler("retransfer",
@@ -779,6 +781,18 @@ class TestXfrin(unittest.TestCase):
# since this has failed, we should still have the previous config
self._check_zones_config(zones2)
+ zones = { 'zones': [
+ { 'name': 'test.example',
+ 'master_addr': '192.0.2.7',
+ 'master_port': 53,
+ # using a bad TSIG key spec
+ 'tsig_key': "bad..example.com:SFuWd/q99SzF8Yzd1QbB9g=="
+ }
+ ]}
+ self.assertEqual(self.xfr.config_handler(zones)['result'][0], 1)
+ # since this has failed, we should still have the previous config
+ self._check_zones_config(zones2)
+
# let's also add a zone that is correct too, and make sure
# that the new config is not partially taken
zones = { 'zones': [
diff --git a/src/bin/xfrin/xfrin.py.in b/src/bin/xfrin/xfrin.py.in
index a9871a7..d565312 100755
--- a/src/bin/xfrin/xfrin.py.in
+++ b/src/bin/xfrin/xfrin.py.in
@@ -77,8 +77,8 @@ class XfrinConfigException(Exception):
pass
def _check_zone_name(zone_name_str):
- """Checks if the given zone name is a valid domain name, and returns it as a Name object.
- Raises an XfrinException if it is not."""
+ """Checks if the given zone name is a valid domain name, and returns
+ it as a Name object. Raises an XfrinException if it is not."""
try:
return Name(zone_name_str)
except (EmptyLabel, TooLongLabel, BadLabelType, BadEscape,
@@ -406,7 +406,7 @@ class XfrinRecorder:
return ret
class ZoneInfo:
- def __init__(self, config_data, module_cc = None):
+ def __init__(self, config_data, module_cc=None):
"""Creates a zone_info with the config data element as
specified by the 'zones' list in xfrin.spec. Module_cc is
needed to get the defaults from the specification"""
More information about the bind10-changes
mailing list