BIND 10 trac1389, updated. 144549c04afdc36a98c7530eaebafb2b3d38d545 [1389] make RR set sequence comparison independent from SQLite3 implementation details. This should solve failure of some AXFR tests using SQLite3 on some systems.

BIND 10 source code commits bind10-changes at lists.isc.org
Wed Nov 30 22:39:32 UTC 2011


The branch, trac1389 has been updated
       via  144549c04afdc36a98c7530eaebafb2b3d38d545 (commit)
      from  f06cabd31d8e43781e4e32bdfdf24c78931d3ca8 (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 144549c04afdc36a98c7530eaebafb2b3d38d545
Author: JINMEI Tatuya <jinmei at isc.org>
Date:   Wed Nov 30 14:38:36 2011 -0800

    [1389] make RR set sequence comparison independent from SQLite3 implementation
    details.  This should solve failure of some AXFR tests using SQLite3 on
    some systems.

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

Summary of changes:
 src/bin/xfrout/tests/xfrout_test.py.in |   23 ++++++++++++++++-------
 1 files changed, 16 insertions(+), 7 deletions(-)

-----------------------------------------------------------------------
diff --git a/src/bin/xfrout/tests/xfrout_test.py.in b/src/bin/xfrout/tests/xfrout_test.py.in
index cfc5c28..8373e15 100644
--- a/src/bin/xfrout/tests/xfrout_test.py.in
+++ b/src/bin/xfrout/tests/xfrout_test.py.in
@@ -1045,13 +1045,22 @@ class TestXfroutSessionWithSQLite3(TestXfroutSessionBase):
         # This zone contains two A RRs for the same name with different TTLs.
         # These TTLs should be preseved in the AXFR stream.
         actual_records = response.get_section(Message.SECTION_ANSWER)
-        expected_records = [create_soa(2011112001),
-                            create_ns(self.ns_name),
-                            create_a(Name(self.ns_name), '192.0.2.1', 3600),
-                            create_a(Name(self.ns_name), '192.0.2.2', 7200),
-                            create_soa(2011112001)]
-        self.assertEqual(len(expected_records), len(actual_records))
-        for (expected_rr, actual_rr) in zip(expected_records, actual_records):
+        self.assertEqual(5, len(actual_records))
+        # The first and last RR should be the expected SOA
+        expected_soa = create_soa(2011112001)
+        self.assertTrue(rrsets_equal(expected_soa, actual_records[0]))
+        self.assertTrue(rrsets_equal(expected_soa, actual_records[-1]))
+
+        # The ordering of the intermediate RRs can differ depending on the
+        # internal details of the SQLite3 library, so we sort them by a simple
+        # rule sufficient for the purpose here, and then compare them.
+        expected_others = [create_ns(self.ns_name),
+                           create_a(Name(self.ns_name), '192.0.2.1', 3600),
+                           create_a(Name(self.ns_name), '192.0.2.2', 7200)]
+        keyfn = lambda x: (x.get_type(), x.get_ttl())
+        for (expected_rr, actual_rr) in zip(sorted(expected_others, key=keyfn),
+                                            sorted(actual_records[1:4],
+                                                   key=keyfn)):
             self.assertTrue(rrsets_equal(expected_rr, actual_rr))
 
     def test_axfr_normal_session(self):




More information about the bind10-changes mailing list