Browse Source

[1259] More TTL tweaks

These are just tests and logging messages.
Michal 'vorner' Vaner 13 years ago
parent
commit
af927e2c39

+ 3 - 4
src/lib/python/isc/xfrin/libxfrin_messages.mes

@@ -15,8 +15,7 @@
 # No namespace declaration - these constants go in the global namespace
 # of the libxfrin_messages python module.
 
-% LIBXFRIN_DIFFERENT_TTL multiple data with different TTLs (%1, %2) on %3/%4
+% LIBXFRIN_DIFFERENT_TTL multiple data with different TTLs (%1, %2) on %3/%4. Adjusting %2 -> %1.
 The xfrin module received an update containing multiple rdata changes for the
-same RRset. But the TTLs of these don't match each other. The data will be put
-into the underlying data source. What happens with the TTLs is up to the
-data source.
+same RRset. But the TTLs of these don't match each other. As we combine them
+together, the later one get's overwritten to the earlier one in the sequence.

+ 7 - 0
src/lib/python/isc/xfrin/tests/diff_tests.py

@@ -418,9 +418,16 @@ class DiffTest(unittest.TestCase):
                                   self.__type, RRTTL(120))
             rrset2.add_rdata(Rdata(self.__type, self.__rrclass, '192.10.2.2'))
             diff.add_data(rrset2)
+            rrset2 = RRset(Name('a.example.org.'), self.__rrclass,
+                                  self.__type, RRTTL(6000))
+            rrset2.add_rdata(Rdata(self.__type, self.__rrclass, '192.10.2.3'))
+            diff.add_data(rrset2)
             # They should get compacted together and complain.
             diff.compact()
             self.assertEqual(1, len(diff.get_buffer()))
+            # The TTL stays on the first value, no matter if smaller or bigger
+            # ones come later.
+            self.assertEqual(self.__ttl, diff.get_buffer()[0][1].get_ttl())
             self.assertTrue(self.__warn_called)
         finally:
             isc.xfrin.diff.logger = orig_logger