]> git.ipfire.org Git - thirdparty/pdns.git/commitdiff
rec: Work around a RRSIG year-2038 issue in the negcache unit tests
authorRemi Gacogne <remi.gacogne@powerdns.com>
Tue, 5 Dec 2017 13:47:39 +0000 (14:47 +0100)
committerPieter Lexis <pieter.lexis@powerdns.com>
Mon, 26 Mar 2018 09:17:02 +0000 (11:17 +0200)
On 32-bit OS with a signed 32-bit `time_t`, we have a known issue with
dates later than 2038 in `RecordTextWriter::xfrTime()`. For now we will
just use an earlier date than 2038 in these tests since the date has no
relevance there.

(cherry picked from commit 08d99e35da19dc35a966418f888222fbd598f269)

pdns/recursordist/test-negcache_cc.cc

index 1ea064791a5cd2e826b346f17fea14db62e45f2f..77418c9a50a2bb0f73e24dcc5bd2607a7b62bbdd 100644 (file)
@@ -20,7 +20,7 @@ static recordsAndSignatures genRecsAndSigs(const DNSName& name, const uint16_t q
 
   if (sigs) {
     rec.d_type = QType::RRSIG;
-    rec.d_content = std::make_shared<RRSIGRecordContent>(QType(qtype).getName() + " 5 3 600 2100010100000000 2100010100000000 24567 dummy data");
+    rec.d_content = std::make_shared<RRSIGRecordContent>(QType(qtype).getName() + " 5 3 600 2037010100000000 2037010100000000 24567 dummy data");
     ret.signatures.push_back(rec);
   }
 
@@ -358,10 +358,10 @@ BOOST_AUTO_TEST_CASE(test_dumpToFile) {
   vector<string> expected;
   expected.push_back("www1.powerdns.com. 600 IN TYPE0 VIA powerdns.com. ; (Indeterminate)\n");
   expected.push_back("www1.powerdns.com. 600 IN NSEC deadbeef. ; (Indeterminate)\n");
-  expected.push_back("www1.powerdns.com. 600 IN RRSIG NSEC 5 3 600 21000101000000 21000101000000 24567 dummy. data ;\n");
+  expected.push_back("www1.powerdns.com. 600 IN RRSIG NSEC 5 3 600 20370101000000 20370101000000 24567 dummy. data ;\n");
   expected.push_back("www2.powerdns.com. 600 IN TYPE0 VIA powerdns.com. ; (Indeterminate)\n");
   expected.push_back("www2.powerdns.com. 600 IN NSEC deadbeef. ; (Indeterminate)\n");
-  expected.push_back("www2.powerdns.com. 600 IN RRSIG NSEC 5 3 600 21000101000000 21000101000000 24567 dummy. data ;\n");
+  expected.push_back("www2.powerdns.com. 600 IN RRSIG NSEC 5 3 600 20370101000000 20370101000000 24567 dummy. data ;\n");
 
   struct timeval now;
   Utility::gettimeofday(&now, 0);