From: Remi Gacogne Date: Tue, 5 Dec 2017 13:47:39 +0000 (+0100) Subject: rec: Work around a RRSIG year-2038 issue in the negcache unit tests X-Git-Tag: rec-4.1.2~1^2~1^2 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=86ecf4f9a22f9c0f5f412c6b32fe2cf93b62e7d0;p=pdns rec: Work around a RRSIG year-2038 issue in the negcache unit tests 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) --- diff --git a/pdns/recursordist/test-negcache_cc.cc b/pdns/recursordist/test-negcache_cc.cc index 1ea064791..77418c9a5 100644 --- a/pdns/recursordist/test-negcache_cc.cc +++ b/pdns/recursordist/test-negcache_cc.cc @@ -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(QType(qtype).getName() + " 5 3 600 2100010100000000 2100010100000000 24567 dummy data"); + rec.d_content = std::make_shared(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 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);