]> git.ipfire.org Git - thirdparty/pdns.git/commitdiff
rec: Check that we get the SOA on a direct query for a non-existing DS
authorRemi Gacogne <remi.gacogne@powerdns.com>
Wed, 23 Jun 2021 08:54:05 +0000 (10:54 +0200)
committerRemi Gacogne <remi.gacogne@powerdns.com>
Wed, 23 Jun 2021 08:54:05 +0000 (10:54 +0200)
pdns/recursordist/test-syncres_cc7.cc

index 1b5c70d73d054bb3daf7d2f136912a3b1ae3cfa1..7d4484175ff5631628e58eb96c8ad02957473712 100644 (file)
@@ -244,6 +244,23 @@ BOOST_AUTO_TEST_CASE(test_dnssec_secure_to_insecure_nodata)
   BOOST_CHECK_EQUAL(sr->getValidationState(), vState::Insecure);
   BOOST_REQUIRE_EQUAL(ret.size(), 1U);
   BOOST_CHECK_EQUAL(queriesCount, 5U);
+
+  /* Request the DS for powerdns.com, which does not exist. We should get
+     the denial proof AND the SOA */
+  ret.clear();
+  res = sr->beginResolve(target, QType(QType::DS), QClass::IN, ret);
+  BOOST_CHECK_EQUAL(res, RCode::NoError);
+  BOOST_CHECK_EQUAL(sr->getValidationState(), vState::Secure);
+  BOOST_REQUIRE_EQUAL(ret.size(), 4U);
+  bool soaFound = false;
+  for (const auto& record : ret) {
+    if (record.d_type == QType::SOA) {
+      soaFound = true;
+      break;
+    }
+  }
+  BOOST_CHECK_EQUAL(soaFound, true);
+  BOOST_CHECK_EQUAL(queriesCount, 6U);
 }
 
 BOOST_AUTO_TEST_CASE(test_dnssec_secure_to_insecure_cname)