From 08d99e35da19dc35a966418f888222fbd598f269 Mon Sep 17 00:00:00 2001 From: Remi Gacogne Date: Tue, 5 Dec 2017 14:47:39 +0100 Subject: [PATCH] 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. --- pdns/recursordist/test-negcache_cc.cc | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) 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); -- 2.40.0