BIND 10 trac1462, updated. e99849d9e064c97545cda8826df2e05ee53cf7fa [1462] Changed 'int' serial to 'Serial' object.
BIND 10 source code commits
bind10-changes at lists.isc.org
Fri Dec 23 07:42:29 UTC 2011
The branch, trac1462 has been updated
via e99849d9e064c97545cda8826df2e05ee53cf7fa (commit)
from 9a304b1feebd2f06ddddbf5aa5e119cff672ae55 (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 e99849d9e064c97545cda8826df2e05ee53cf7fa
Author: Xie Jiagui <xiejiagui at cnnic.cn>
Date: Fri Dec 23 15:40:36 2011 +0800
[1462] Changed 'int' serial to 'Serial' object.
-----------------------------------------------------------------------
Summary of changes:
src/bin/xfrout/tests/xfrout_test.py.in | 18 ++++++++++++++++--
src/bin/xfrout/xfrout.py.in | 11 +++++------
2 files changed, 21 insertions(+), 8 deletions(-)
-----------------------------------------------------------------------
diff --git a/src/bin/xfrout/tests/xfrout_test.py.in b/src/bin/xfrout/tests/xfrout_test.py.in
index b509ab3..a4a39dd 100644
--- a/src/bin/xfrout/tests/xfrout_test.py.in
+++ b/src/bin/xfrout/tests/xfrout_test.py.in
@@ -727,7 +727,7 @@ class TestXfroutSession(TestXfroutSessionBase):
self.getmsg(), TEST_ZONE_NAME, TEST_RRCLASS), Rcode.NOERROR())
self.assertEqual(None, self.xfrsess._iterator)
self.assertEqual(None, self.xfrsess._jnl_reader)
-
+
# The data source doesn't support journaling. Should fallback to AXFR.
zone_name = Name('nojournal.example.com')
self.mdata = self.create_request_data(ixfr=IXFR_OK_VERSION,
@@ -1070,6 +1070,20 @@ class TestXfroutSessionWithSQLite3(TestXfroutSessionBase):
self.assertEqual(Rcode.NOERROR(), response.get_rcode())
self.check_axfr_stream(response)
+ def test_ixfr_to_axfr(self):
+ self.xfrsess._request_data = \
+ self.create_request_data(ixfr=IXFR_NG_VERSION)
+ XfroutSession._handle(self.xfrsess)
+ response = self.sock.read_msg(Message.PRESERVE_ORDER);
+ self.assertEqual(Rcode.NOERROR(), response.get_rcode())
+ # The SOA serial is greater than that of requested one.
+ # So only the SOA was send.
+ answers = response.get_section(Message.SECTION_ANSWER)
+ self.assertEqual(1, len(answers))
+ self.assertTrue(rrsets_equal(create_soa(SOA_CURRENT_VERSION),
+ answers[0]))
+ self.assertEqual(RRType.IXFR(), response.get_question()[0].get_type())
+
def test_ixfr_normal_session(self):
# See testdata/creatediff.py. There are 8 changes between two
# versions. So the answer section should contain all of these and
@@ -1077,7 +1091,7 @@ class TestXfroutSessionWithSQLite3(TestXfroutSessionBase):
self.xfrsess._request_data = \
self.create_request_data(ixfr=IXFR_OK_VERSION)
XfroutSession._handle(self.xfrsess)
- response = self.sock.read_msg(Message.PRESERVE_ORDER);
+ response = self.sock.read_msg(Message.PRESERVE_ORDER)
actual_records = response.get_section(Message.SECTION_ANSWER)
expected_records = [create_soa(2011112001), create_soa(2011111802),
create_soa(2011111900),
diff --git a/src/bin/xfrout/xfrout.py.in b/src/bin/xfrout/xfrout.py.in
index 9aa1887..127c613 100755
--- a/src/bin/xfrout/xfrout.py.in
+++ b/src/bin/xfrout/xfrout.py.in
@@ -140,10 +140,9 @@ def get_rrset_len(rrset):
return len(bytes)
def get_soa_serial(soa_rdata):
- '''Extract the serial field of an SOA RDATA and returns it as an intger.
- (borrowed from xfrin)
+ '''Extract the serial field of an SOA RDATA and returns it as an Serial object.
'''
- return int(soa_rdata.to_text().split()[2])
+ return Serial(int(soa_rdata.to_text().split()[2]))
class XfroutSession():
def __init__(self, sock_fd, request_data, server, tsig_key_ring, remote,
@@ -423,11 +422,11 @@ class XfroutSession():
format_zone_str(zone_name, zone_class),
begin_serial, end_serial)
return Rcode.NOERROR()
-
+
# Set up the journal reader or fall back to AXFR-style IXFR
try:
code, self._jnl_reader = self._datasrc_client.get_journal_reader(
- zone_name, begin_serial, end_serial)
+ zone_name, begin_serial.get_value(), end_serial.get_value())
except isc.datasrc.NotImplemented as ex:
# The underlying data source doesn't support journaling.
# Fall back to AXFR-style IXFR.
@@ -451,7 +450,7 @@ class XfroutSession():
# Use the reader as the iterator to generate the response.
self._iterator = self._jnl_reader
-
+
return Rcode.NOERROR()
def _xfrout_setup(self, request_msg, zone_name, zone_class):
More information about the bind10-changes
mailing list