Browse Source

[2310] added a test case where the original TTL is smaller than SOA minttl.

JINMEI Tatuya 12 years ago
parent
commit
2ca96761f1
1 changed files with 8 additions and 0 deletions
  1. 8 0
      src/lib/datasrc/tests/memory/zone_finder_unittest.cc

+ 8 - 0
src/lib/datasrc/tests/memory/zone_finder_unittest.cc

@@ -739,6 +739,14 @@ TEST_F(InMemoryZoneFinderTest, findAtOriginWithMinTTL) {
                      ZoneFinder::RESULT_DEFAULT, NULL,
                      ZoneFinder::FIND_DEFAULT, false);
 
+    // If the found RRset has a smaller TTL than SOA, the original TTL should
+    // win.
+    rr_a_->setTTL(RRTTL(10));
+    addToZoneData(rr_a_);
+    findAtOriginTest(RRType::A(), ZoneFinder::SUCCESS, true, rr_a_,
+                     ZoneFinder::RESULT_DEFAULT, NULL,
+                     ZoneFinder::FIND_DEFAULT, true);
+
     // If no RRset is returned, use_minttl doesn't matter (it shouldn't cause
     // disruption)
     findAtOriginTest(RRType::TXT(), ZoneFinder::NXRRSET, true, ConstRRsetPtr(),