|
@@ -193,7 +193,7 @@ public:
|
|
}
|
|
}
|
|
|
|
|
|
// simplified version of 'loading' data
|
|
// simplified version of 'loading' data
|
|
- void addZoneData(const ConstRRsetPtr rrset) {
|
|
|
|
|
|
+ void addToZoneData(const ConstRRsetPtr rrset) {
|
|
updater_.add(rrset, rrset->getRRsig());
|
|
updater_.add(rrset, rrset->getRRsig());
|
|
}
|
|
}
|
|
|
|
|
|
@@ -419,7 +419,7 @@ TEST_F(InMemoryZoneFinderTest, constructor) {
|
|
|
|
|
|
TEST_F(InMemoryZoneFinderTest, findCNAME) {
|
|
TEST_F(InMemoryZoneFinderTest, findCNAME) {
|
|
// install CNAME RR
|
|
// install CNAME RR
|
|
- addZoneData(rr_cname_);
|
|
|
|
|
|
+ addToZoneData(rr_cname_);
|
|
|
|
|
|
// Find A RR of the same. Should match the CNAME
|
|
// Find A RR of the same. Should match the CNAME
|
|
findTest(rr_cname_->getName(), RRType::NS(), ZoneFinder::CNAME, true,
|
|
findTest(rr_cname_->getName(), RRType::NS(), ZoneFinder::CNAME, true,
|
|
@@ -434,10 +434,10 @@ TEST_F(InMemoryZoneFinderTest, findCNAMEUnderZoneCut) {
|
|
// There's nothing special when we find a CNAME under a zone cut
|
|
// There's nothing special when we find a CNAME under a zone cut
|
|
// (with FIND_GLUE_OK). The behavior is different from BIND 9,
|
|
// (with FIND_GLUE_OK). The behavior is different from BIND 9,
|
|
// so we test this case explicitly.
|
|
// so we test this case explicitly.
|
|
- addZoneData(rr_child_ns_);
|
|
|
|
|
|
+ addToZoneData(rr_child_ns_);
|
|
ConstRRsetPtr rr_cname_under_cut_ = textToRRset(
|
|
ConstRRsetPtr rr_cname_under_cut_ = textToRRset(
|
|
"cname.child.example.org. 300 IN CNAME target.child.example.org.");
|
|
"cname.child.example.org. 300 IN CNAME target.child.example.org.");
|
|
- addZoneData(rr_cname_under_cut_);
|
|
|
|
|
|
+ addToZoneData(rr_cname_under_cut_);
|
|
findTest(Name("cname.child.example.org"), RRType::AAAA(),
|
|
findTest(Name("cname.child.example.org"), RRType::AAAA(),
|
|
ZoneFinder::CNAME, true, rr_cname_under_cut_,
|
|
ZoneFinder::CNAME, true, rr_cname_under_cut_,
|
|
ZoneFinder::RESULT_DEFAULT, NULL, ZoneFinder::FIND_GLUE_OK);
|
|
ZoneFinder::RESULT_DEFAULT, NULL, ZoneFinder::FIND_GLUE_OK);
|
|
@@ -445,7 +445,7 @@ TEST_F(InMemoryZoneFinderTest, findCNAMEUnderZoneCut) {
|
|
|
|
|
|
// Search under a DNAME record. It should return the DNAME
|
|
// Search under a DNAME record. It should return the DNAME
|
|
TEST_F(InMemoryZoneFinderTest, findBelowDNAME) {
|
|
TEST_F(InMemoryZoneFinderTest, findBelowDNAME) {
|
|
- EXPECT_NO_THROW(addZoneData(rr_dname_));
|
|
|
|
|
|
+ EXPECT_NO_THROW(addToZoneData(rr_dname_));
|
|
findTest(Name("below.dname.example.org"), RRType::A(), ZoneFinder::DNAME,
|
|
findTest(Name("below.dname.example.org"), RRType::A(), ZoneFinder::DNAME,
|
|
true, rr_dname_);
|
|
true, rr_dname_);
|
|
}
|
|
}
|
|
@@ -453,8 +453,8 @@ TEST_F(InMemoryZoneFinderTest, findBelowDNAME) {
|
|
// Search at the domain with DNAME. It should act as DNAME isn't there, DNAME
|
|
// Search at the domain with DNAME. It should act as DNAME isn't there, DNAME
|
|
// influences only the data below (see RFC 2672, section 3)
|
|
// influences only the data below (see RFC 2672, section 3)
|
|
TEST_F(InMemoryZoneFinderTest, findAtDNAME) {
|
|
TEST_F(InMemoryZoneFinderTest, findAtDNAME) {
|
|
- EXPECT_NO_THROW(addZoneData(rr_dname_));
|
|
|
|
- EXPECT_NO_THROW(addZoneData(rr_dname_a_));
|
|
|
|
|
|
+ EXPECT_NO_THROW(addToZoneData(rr_dname_));
|
|
|
|
+ EXPECT_NO_THROW(addToZoneData(rr_dname_a_));
|
|
|
|
|
|
const Name dname_name(rr_dname_->getName());
|
|
const Name dname_name(rr_dname_->getName());
|
|
findTest(dname_name, RRType::A(), ZoneFinder::SUCCESS, true, rr_dname_a_);
|
|
findTest(dname_name, RRType::A(), ZoneFinder::SUCCESS, true, rr_dname_a_);
|
|
@@ -466,8 +466,8 @@ TEST_F(InMemoryZoneFinderTest, findAtDNAME) {
|
|
// Try searching something that is both under NS and DNAME, without and with
|
|
// Try searching something that is both under NS and DNAME, without and with
|
|
// GLUE_OK mode (it should stop at the NS and DNAME respectively).
|
|
// GLUE_OK mode (it should stop at the NS and DNAME respectively).
|
|
TEST_F(InMemoryZoneFinderTest, DNAMEUnderNS) {
|
|
TEST_F(InMemoryZoneFinderTest, DNAMEUnderNS) {
|
|
- addZoneData(rr_child_ns_);
|
|
|
|
- addZoneData(rr_child_dname_);
|
|
|
|
|
|
+ addToZoneData(rr_child_ns_);
|
|
|
|
+ addToZoneData(rr_child_dname_);
|
|
|
|
|
|
Name lowName("below.dname.child.example.org.");
|
|
Name lowName("below.dname.child.example.org.");
|
|
|
|
|
|
@@ -479,10 +479,10 @@ TEST_F(InMemoryZoneFinderTest, DNAMEUnderNS) {
|
|
// Test adding child zones and zone cut handling
|
|
// Test adding child zones and zone cut handling
|
|
TEST_F(InMemoryZoneFinderTest, delegationNS) {
|
|
TEST_F(InMemoryZoneFinderTest, delegationNS) {
|
|
// add in-zone data
|
|
// add in-zone data
|
|
- EXPECT_NO_THROW(addZoneData(rr_ns_));
|
|
|
|
|
|
+ EXPECT_NO_THROW(addToZoneData(rr_ns_));
|
|
|
|
|
|
// install a zone cut
|
|
// install a zone cut
|
|
- EXPECT_NO_THROW(addZoneData(rr_child_ns_));
|
|
|
|
|
|
+ EXPECT_NO_THROW(addToZoneData(rr_child_ns_));
|
|
|
|
|
|
// below the zone cut
|
|
// below the zone cut
|
|
findTest(Name("www.child.example.org"), RRType::A(),
|
|
findTest(Name("www.child.example.org"), RRType::A(),
|
|
@@ -499,7 +499,7 @@ TEST_F(InMemoryZoneFinderTest, delegationNS) {
|
|
findTest(origin_, RRType::NS(), ZoneFinder::SUCCESS, true, rr_ns_);
|
|
findTest(origin_, RRType::NS(), ZoneFinder::SUCCESS, true, rr_ns_);
|
|
|
|
|
|
// unusual case of "nested delegation": the highest cut should be used.
|
|
// unusual case of "nested delegation": the highest cut should be used.
|
|
- EXPECT_NO_THROW(addZoneData(rr_grandchild_ns_));
|
|
|
|
|
|
+ EXPECT_NO_THROW(addToZoneData(rr_grandchild_ns_));
|
|
findTest(Name("www.grand.child.example.org"), RRType::A(),
|
|
findTest(Name("www.grand.child.example.org"), RRType::A(),
|
|
// note: !rr_grandchild_ns_
|
|
// note: !rr_grandchild_ns_
|
|
ZoneFinder::DELEGATION, true, rr_child_ns_);
|
|
ZoneFinder::DELEGATION, true, rr_child_ns_);
|
|
@@ -508,9 +508,9 @@ TEST_F(InMemoryZoneFinderTest, delegationNS) {
|
|
TEST_F(InMemoryZoneFinderTest, delegationWithDS) {
|
|
TEST_F(InMemoryZoneFinderTest, delegationWithDS) {
|
|
// Similar setup to the previous one, but with DS RR at the delegation
|
|
// Similar setup to the previous one, but with DS RR at the delegation
|
|
// point.
|
|
// point.
|
|
- addZoneData(rr_ns_);
|
|
|
|
- addZoneData(rr_child_ns_);
|
|
|
|
- addZoneData(rr_child_ds_);
|
|
|
|
|
|
+ addToZoneData(rr_ns_);
|
|
|
|
+ addToZoneData(rr_child_ns_);
|
|
|
|
+ addToZoneData(rr_child_ds_);
|
|
|
|
|
|
// Normal types of query should result in delegation, but DS query
|
|
// Normal types of query should result in delegation, but DS query
|
|
// should be considered in-zone (but only exactly at the delegation point).
|
|
// should be considered in-zone (but only exactly at the delegation point).
|
|
@@ -528,9 +528,9 @@ TEST_F(InMemoryZoneFinderTest, delegationWithDS) {
|
|
}
|
|
}
|
|
|
|
|
|
TEST_F(InMemoryZoneFinderTest, findAny) {
|
|
TEST_F(InMemoryZoneFinderTest, findAny) {
|
|
- EXPECT_NO_THROW(addZoneData(rr_a_));
|
|
|
|
- EXPECT_NO_THROW(addZoneData(rr_ns_));
|
|
|
|
- EXPECT_NO_THROW(addZoneData(rr_child_glue_));
|
|
|
|
|
|
+ EXPECT_NO_THROW(addToZoneData(rr_a_));
|
|
|
|
+ EXPECT_NO_THROW(addToZoneData(rr_ns_));
|
|
|
|
+ EXPECT_NO_THROW(addToZoneData(rr_child_glue_));
|
|
|
|
|
|
vector<ConstRRsetPtr> expected_sets;
|
|
vector<ConstRRsetPtr> expected_sets;
|
|
|
|
|
|
@@ -549,7 +549,7 @@ TEST_F(InMemoryZoneFinderTest, findAny) {
|
|
findAllTest(rr_child_glue_->getName(), ZoneFinder::SUCCESS, expected_sets);
|
|
findAllTest(rr_child_glue_->getName(), ZoneFinder::SUCCESS, expected_sets);
|
|
|
|
|
|
// add zone cut
|
|
// add zone cut
|
|
- EXPECT_NO_THROW(addZoneData(rr_child_ns_));
|
|
|
|
|
|
+ EXPECT_NO_THROW(addToZoneData(rr_child_ns_));
|
|
|
|
|
|
// zone cut
|
|
// zone cut
|
|
findAllTest(rr_child_ns_->getName(), ZoneFinder::DELEGATION,
|
|
findAllTest(rr_child_ns_->getName(), ZoneFinder::DELEGATION,
|
|
@@ -565,16 +565,16 @@ TEST_F(InMemoryZoneFinderTest, findAny) {
|
|
TEST_F(InMemoryZoneFinderTest, glue) {
|
|
TEST_F(InMemoryZoneFinderTest, glue) {
|
|
// install zone data:
|
|
// install zone data:
|
|
// a zone cut
|
|
// a zone cut
|
|
- EXPECT_NO_THROW(addZoneData(rr_child_ns_));
|
|
|
|
|
|
+ EXPECT_NO_THROW(addToZoneData(rr_child_ns_));
|
|
// glue for this cut
|
|
// glue for this cut
|
|
- EXPECT_NO_THROW(addZoneData(rr_child_glue_));
|
|
|
|
|
|
+ EXPECT_NO_THROW(addToZoneData(rr_child_glue_));
|
|
// a nested zone cut (unusual)
|
|
// a nested zone cut (unusual)
|
|
- EXPECT_NO_THROW(addZoneData(rr_grandchild_ns_));
|
|
|
|
|
|
+ EXPECT_NO_THROW(addToZoneData(rr_grandchild_ns_));
|
|
// glue under the deeper zone cut
|
|
// glue under the deeper zone cut
|
|
- EXPECT_NO_THROW(addZoneData(rr_grandchild_glue_));
|
|
|
|
|
|
+ EXPECT_NO_THROW(addToZoneData(rr_grandchild_glue_));
|
|
// glue 'at the' zone cut
|
|
// glue 'at the' zone cut
|
|
- EXPECT_NO_THROW(addZoneData(rr_ns_a_));
|
|
|
|
- EXPECT_NO_THROW(addZoneData(rr_ns_ns_));
|
|
|
|
|
|
+ EXPECT_NO_THROW(addToZoneData(rr_ns_a_));
|
|
|
|
+ EXPECT_NO_THROW(addToZoneData(rr_ns_ns_));
|
|
|
|
|
|
// by default glue is hidden due to the zone cut
|
|
// by default glue is hidden due to the zone cut
|
|
findTest(rr_child_glue_->getName(), RRType::A(), ZoneFinder::DELEGATION,
|
|
findTest(rr_child_glue_->getName(), RRType::A(), ZoneFinder::DELEGATION,
|
|
@@ -630,16 +630,16 @@ InMemoryZoneFinderTest::findCheck(ZoneFinder::FindResultFlags expected_flags,
|
|
rr_a_->addRRsig(createRdata(RRType::RRSIG(), RRClass::IN(),
|
|
rr_a_->addRRsig(createRdata(RRType::RRSIG(), RRClass::IN(),
|
|
"A 5 3 3600 20120814220826 20120715220826 "
|
|
"A 5 3 3600 20120814220826 20120715220826 "
|
|
"1234 example.com. FAKE"));
|
|
"1234 example.com. FAKE"));
|
|
- EXPECT_NO_THROW(addZoneData(rr_ns_));
|
|
|
|
- EXPECT_NO_THROW(addZoneData(rr_ns_a_));
|
|
|
|
- EXPECT_NO_THROW(addZoneData(rr_ns_aaaa_));
|
|
|
|
- EXPECT_NO_THROW(addZoneData(rr_a_));
|
|
|
|
|
|
+ EXPECT_NO_THROW(addToZoneData(rr_ns_));
|
|
|
|
+ EXPECT_NO_THROW(addToZoneData(rr_ns_a_));
|
|
|
|
+ EXPECT_NO_THROW(addToZoneData(rr_ns_aaaa_));
|
|
|
|
+ EXPECT_NO_THROW(addToZoneData(rr_a_));
|
|
if ((expected_flags & ZoneFinder::RESULT_NSEC3_SIGNED) != 0) {
|
|
if ((expected_flags & ZoneFinder::RESULT_NSEC3_SIGNED) != 0) {
|
|
- addZoneData(rr_nsec3_);
|
|
|
|
|
|
+ addToZoneData(rr_nsec3_);
|
|
zone_data_->setSigned(true);
|
|
zone_data_->setSigned(true);
|
|
}
|
|
}
|
|
if ((expected_flags & ZoneFinder::RESULT_NSEC_SIGNED) != 0) {
|
|
if ((expected_flags & ZoneFinder::RESULT_NSEC_SIGNED) != 0) {
|
|
- addZoneData(rr_nsec_);
|
|
|
|
|
|
+ addToZoneData(rr_nsec_);
|
|
zone_data_->setSigned(true);
|
|
zone_data_->setSigned(true);
|
|
}
|
|
}
|
|
|
|
|
|
@@ -686,7 +686,7 @@ InMemoryZoneFinderTest::findCheck(ZoneFinder::FindResultFlags expected_flags,
|
|
expected_nsec, expected_flags, NULL, find_options);
|
|
expected_nsec, expected_flags, NULL, find_options);
|
|
|
|
|
|
if ((expected_flags & ZoneFinder::RESULT_NSEC_SIGNED) != 0) {
|
|
if ((expected_flags & ZoneFinder::RESULT_NSEC_SIGNED) != 0) {
|
|
- addZoneData(rr_ns_nsec_);
|
|
|
|
|
|
+ addToZoneData(rr_ns_nsec_);
|
|
zone_data_->setSigned(true);
|
|
zone_data_->setSigned(true);
|
|
if ((find_options & ZoneFinder::FIND_DNSSEC) != 0) {
|
|
if ((find_options & ZoneFinder::FIND_DNSSEC) != 0) {
|
|
expected_nsec = rr_ns_nsec_;
|
|
expected_nsec = rr_ns_nsec_;
|
|
@@ -722,8 +722,8 @@ InMemoryZoneFinderTest::findNSECENTCheck(const Name& ent_name,
|
|
ConstRRsetPtr expected_nsec,
|
|
ConstRRsetPtr expected_nsec,
|
|
ZoneFinder::FindResultFlags expected_flags)
|
|
ZoneFinder::FindResultFlags expected_flags)
|
|
{
|
|
{
|
|
- addZoneData(rr_emptywild_);
|
|
|
|
- addZoneData(rr_under_wild_);
|
|
|
|
|
|
+ addToZoneData(rr_emptywild_);
|
|
|
|
+ addToZoneData(rr_under_wild_);
|
|
|
|
|
|
// Sanity check: Should result in NXRRSET
|
|
// Sanity check: Should result in NXRRSET
|
|
findTest(ent_name, RRType::A(), ZoneFinder::NXRRSET, true,
|
|
findTest(ent_name, RRType::A(), ZoneFinder::NXRRSET, true,
|
|
@@ -735,10 +735,10 @@ InMemoryZoneFinderTest::findNSECENTCheck(const Name& ent_name,
|
|
|
|
|
|
// Now add the NSEC rrs making it a 'complete' zone (in terms of NSEC,
|
|
// Now add the NSEC rrs making it a 'complete' zone (in terms of NSEC,
|
|
// there are no sigs)
|
|
// there are no sigs)
|
|
- addZoneData(rr_nsec_);
|
|
|
|
- addZoneData(rr_ent_nsec2_);
|
|
|
|
- addZoneData(rr_ent_nsec3_);
|
|
|
|
- addZoneData(rr_ent_nsec4_);
|
|
|
|
|
|
+ addToZoneData(rr_nsec_);
|
|
|
|
+ addToZoneData(rr_ent_nsec2_);
|
|
|
|
+ addToZoneData(rr_ent_nsec3_);
|
|
|
|
+ addToZoneData(rr_ent_nsec4_);
|
|
zone_data_->setSigned(true);
|
|
zone_data_->setSigned(true);
|
|
|
|
|
|
// Should result in NXRRSET, and RESULT_NSEC_SIGNED
|
|
// Should result in NXRRSET, and RESULT_NSEC_SIGNED
|
|
@@ -796,14 +796,14 @@ InMemoryZoneFinderTest::emptyNodeCheck(
|
|
for (int i = 0; names[i] != NULL; ++i) {
|
|
for (int i = 0; names[i] != NULL; ++i) {
|
|
ConstRRsetPtr rrset = textToRRset(string(names[i]) +
|
|
ConstRRsetPtr rrset = textToRRset(string(names[i]) +
|
|
" 300 IN A 192.0.2.1");
|
|
" 300 IN A 192.0.2.1");
|
|
- addZoneData(rrset);
|
|
|
|
|
|
+ addToZoneData(rrset);
|
|
}
|
|
}
|
|
if ((expected_flags & ZoneFinder::RESULT_NSEC3_SIGNED) != 0) {
|
|
if ((expected_flags & ZoneFinder::RESULT_NSEC3_SIGNED) != 0) {
|
|
- addZoneData(rr_nsec3_);
|
|
|
|
|
|
+ addToZoneData(rr_nsec3_);
|
|
zone_data_->setSigned(true);
|
|
zone_data_->setSigned(true);
|
|
}
|
|
}
|
|
if ((expected_flags & ZoneFinder::RESULT_NSEC_SIGNED) != 0) {
|
|
if ((expected_flags & ZoneFinder::RESULT_NSEC_SIGNED) != 0) {
|
|
- addZoneData(rr_nsec_);
|
|
|
|
|
|
+ addToZoneData(rr_nsec_);
|
|
zone_data_->setSigned(true);
|
|
zone_data_->setSigned(true);
|
|
}
|
|
}
|
|
|
|
|
|
@@ -870,15 +870,15 @@ InMemoryZoneFinderTest::wildcardCheck(
|
|
"RRSIG CNAME " +
|
|
"RRSIG CNAME " +
|
|
string(rrsig_common)));
|
|
string(rrsig_common)));
|
|
}
|
|
}
|
|
- addZoneData(rr_wild_);
|
|
|
|
- addZoneData(rr_cnamewild_);
|
|
|
|
|
|
+ addToZoneData(rr_wild_);
|
|
|
|
+ addToZoneData(rr_cnamewild_);
|
|
// If the zone is expected to be "signed" with NSEC3, add an NSEC3.
|
|
// If the zone is expected to be "signed" with NSEC3, add an NSEC3.
|
|
// (the content of the NSEC3 shouldn't matter)
|
|
// (the content of the NSEC3 shouldn't matter)
|
|
if ((expected_flags & ZoneFinder::RESULT_NSEC3_SIGNED) != 0) {
|
|
if ((expected_flags & ZoneFinder::RESULT_NSEC3_SIGNED) != 0) {
|
|
- addZoneData(rr_nsec3_);
|
|
|
|
|
|
+ addToZoneData(rr_nsec3_);
|
|
}
|
|
}
|
|
if ((expected_flags & ZoneFinder::RESULT_NSEC_SIGNED) != 0) {
|
|
if ((expected_flags & ZoneFinder::RESULT_NSEC_SIGNED) != 0) {
|
|
- addZoneData(rr_nsec_);
|
|
|
|
|
|
+ addToZoneData(rr_nsec_);
|
|
}
|
|
}
|
|
|
|
|
|
// Search at the parent. The parent will not have the A, but it will
|
|
// Search at the parent. The parent will not have the A, but it will
|
|
@@ -954,7 +954,7 @@ InMemoryZoneFinderTest::wildcardCheck(
|
|
wild_expected_flags, NULL, find_options, wild_ok);
|
|
wild_expected_flags, NULL, find_options, wild_ok);
|
|
}
|
|
}
|
|
|
|
|
|
- addZoneData(rr_under_wild_);
|
|
|
|
|
|
+ addToZoneData(rr_under_wild_);
|
|
{
|
|
{
|
|
SCOPED_TRACE("Search under non-wildcard");
|
|
SCOPED_TRACE("Search under non-wildcard");
|
|
findTest(Name("bar.foo.wild.example.org"), RRType::A(),
|
|
findTest(Name("bar.foo.wild.example.org"), RRType::A(),
|
|
@@ -971,7 +971,7 @@ InMemoryZoneFinderTest::wildcardCheck(
|
|
// NO_WILDCARD effect itself can be checked by the result code (NXDOMAIN).
|
|
// NO_WILDCARD effect itself can be checked by the result code (NXDOMAIN).
|
|
ConstRRsetPtr expected_wild_nsec; // by default it's NULL
|
|
ConstRRsetPtr expected_wild_nsec; // by default it's NULL
|
|
if ((expected_flags & ZoneFinder::RESULT_NSEC_SIGNED) != 0) {
|
|
if ((expected_flags & ZoneFinder::RESULT_NSEC_SIGNED) != 0) {
|
|
- addZoneData(rr_wild_nsec_);
|
|
|
|
|
|
+ addToZoneData(rr_wild_nsec_);
|
|
expected_wild_nsec = rr_wild_nsec_;
|
|
expected_wild_nsec = rr_wild_nsec_;
|
|
}
|
|
}
|
|
{
|
|
{
|
|
@@ -1008,8 +1008,8 @@ TEST_F(InMemoryZoneFinderTest, wildcardDisabledWithoutNSEC) {
|
|
* the wildcard defaults."
|
|
* the wildcard defaults."
|
|
*/
|
|
*/
|
|
TEST_F(InMemoryZoneFinderTest, delegatedWildcard) {
|
|
TEST_F(InMemoryZoneFinderTest, delegatedWildcard) {
|
|
- addZoneData(rr_child_wild_);
|
|
|
|
- addZoneData(rr_child_ns_);
|
|
|
|
|
|
+ addToZoneData(rr_child_wild_);
|
|
|
|
+ addToZoneData(rr_child_ns_);
|
|
|
|
|
|
{
|
|
{
|
|
SCOPED_TRACE("Looking under delegation point");
|
|
SCOPED_TRACE("Looking under delegation point");
|
|
@@ -1030,12 +1030,12 @@ void
|
|
InMemoryZoneFinderTest::anyWildcardCheck(
|
|
InMemoryZoneFinderTest::anyWildcardCheck(
|
|
ZoneFinder::FindResultFlags expected_flags)
|
|
ZoneFinder::FindResultFlags expected_flags)
|
|
{
|
|
{
|
|
- addZoneData(rr_wild_);
|
|
|
|
|
|
+ addToZoneData(rr_wild_);
|
|
if ((expected_flags & ZoneFinder::RESULT_NSEC3_SIGNED) != 0) {
|
|
if ((expected_flags & ZoneFinder::RESULT_NSEC3_SIGNED) != 0) {
|
|
- addZoneData(rr_nsec3_);
|
|
|
|
|
|
+ addToZoneData(rr_nsec3_);
|
|
}
|
|
}
|
|
if ((expected_flags & ZoneFinder::RESULT_NSEC_SIGNED) != 0) {
|
|
if ((expected_flags & ZoneFinder::RESULT_NSEC_SIGNED) != 0) {
|
|
- addZoneData(rr_nsec_);
|
|
|
|
|
|
+ addToZoneData(rr_nsec_);
|
|
}
|
|
}
|
|
|
|
|
|
vector<ConstRRsetPtr> expected_sets;
|
|
vector<ConstRRsetPtr> expected_sets;
|
|
@@ -1087,12 +1087,12 @@ InMemoryZoneFinderTest::emptyWildcardCheck(
|
|
* *
|
|
* *
|
|
* wild
|
|
* wild
|
|
*/
|
|
*/
|
|
- addZoneData(rr_emptywild_);
|
|
|
|
|
|
+ addToZoneData(rr_emptywild_);
|
|
if ((expected_flags & ZoneFinder::RESULT_NSEC3_SIGNED) != 0) {
|
|
if ((expected_flags & ZoneFinder::RESULT_NSEC3_SIGNED) != 0) {
|
|
- addZoneData(rr_nsec3_);
|
|
|
|
|
|
+ addToZoneData(rr_nsec3_);
|
|
}
|
|
}
|
|
if ((expected_flags & ZoneFinder::RESULT_NSEC_SIGNED) != 0) {
|
|
if ((expected_flags & ZoneFinder::RESULT_NSEC_SIGNED) != 0) {
|
|
- addZoneData(rr_nsec_);
|
|
|
|
|
|
+ addToZoneData(rr_nsec_);
|
|
}
|
|
}
|
|
|
|
|
|
{
|
|
{
|
|
@@ -1144,7 +1144,7 @@ TEST_F(InMemoryZoneFinderTest, emptyWildcardNSEC) {
|
|
|
|
|
|
// Same as emptyWildcard, but with multiple * in the path.
|
|
// Same as emptyWildcard, but with multiple * in the path.
|
|
TEST_F(InMemoryZoneFinderTest, nestedEmptyWildcard) {
|
|
TEST_F(InMemoryZoneFinderTest, nestedEmptyWildcard) {
|
|
- addZoneData(rr_nested_emptywild_);
|
|
|
|
|
|
+ addToZoneData(rr_nested_emptywild_);
|
|
|
|
|
|
{
|
|
{
|
|
SCOPED_TRACE("Asking for the original record under wildcards");
|
|
SCOPED_TRACE("Asking for the original record under wildcards");
|
|
@@ -1275,8 +1275,8 @@ InMemoryZoneFinderTest::doCancelWildcardCheck(
|
|
* shouldn't be canceled isn't.
|
|
* shouldn't be canceled isn't.
|
|
*/
|
|
*/
|
|
TEST_F(InMemoryZoneFinderTest, cancelWildcard) {
|
|
TEST_F(InMemoryZoneFinderTest, cancelWildcard) {
|
|
- addZoneData(rr_wild_);
|
|
|
|
- addZoneData(rr_not_wild_);
|
|
|
|
|
|
+ addToZoneData(rr_wild_);
|
|
|
|
+ addToZoneData(rr_not_wild_);
|
|
|
|
|
|
{
|
|
{
|
|
SCOPED_TRACE("Runnig with single entry under foo.wild.example.org");
|
|
SCOPED_TRACE("Runnig with single entry under foo.wild.example.org");
|
|
@@ -1286,7 +1286,7 @@ TEST_F(InMemoryZoneFinderTest, cancelWildcard) {
|
|
// Try putting another one under foo.wild....
|
|
// Try putting another one under foo.wild....
|
|
// The result should be the same but it will be done in another way in the
|
|
// The result should be the same but it will be done in another way in the
|
|
// code, because the foo.wild.example.org will exist in the tree.
|
|
// code, because the foo.wild.example.org will exist in the tree.
|
|
- addZoneData(rr_not_wild_another_);
|
|
|
|
|
|
+ addToZoneData(rr_not_wild_another_);
|
|
{
|
|
{
|
|
SCOPED_TRACE("Runnig with two entries under foo.wild.example.org");
|
|
SCOPED_TRACE("Runnig with two entries under foo.wild.example.org");
|
|
doCancelWildcardCheck();
|
|
doCancelWildcardCheck();
|
|
@@ -1295,15 +1295,15 @@ TEST_F(InMemoryZoneFinderTest, cancelWildcard) {
|
|
|
|
|
|
// Same tests as cancelWildcard for NSEC3-signed zone
|
|
// Same tests as cancelWildcard for NSEC3-signed zone
|
|
TEST_F(InMemoryZoneFinderTest, cancelWildcardNSEC3) {
|
|
TEST_F(InMemoryZoneFinderTest, cancelWildcardNSEC3) {
|
|
- addZoneData(rr_wild_);
|
|
|
|
- addZoneData(rr_not_wild_);
|
|
|
|
- addZoneData(rr_nsec3_);
|
|
|
|
|
|
+ addToZoneData(rr_wild_);
|
|
|
|
+ addToZoneData(rr_not_wild_);
|
|
|
|
+ addToZoneData(rr_nsec3_);
|
|
|
|
|
|
{
|
|
{
|
|
SCOPED_TRACE("Runnig with single entry under foo.wild.example.org");
|
|
SCOPED_TRACE("Runnig with single entry under foo.wild.example.org");
|
|
doCancelWildcardCheck(ZoneFinder::RESULT_NSEC3_SIGNED);
|
|
doCancelWildcardCheck(ZoneFinder::RESULT_NSEC3_SIGNED);
|
|
}
|
|
}
|
|
- addZoneData(rr_not_wild_another_);
|
|
|
|
|
|
+ addToZoneData(rr_not_wild_another_);
|
|
{
|
|
{
|
|
SCOPED_TRACE("Runnig with two entries under foo.wild.example.org");
|
|
SCOPED_TRACE("Runnig with two entries under foo.wild.example.org");
|
|
doCancelWildcardCheck(ZoneFinder::RESULT_NSEC3_SIGNED);
|
|
doCancelWildcardCheck(ZoneFinder::RESULT_NSEC3_SIGNED);
|
|
@@ -1314,9 +1314,9 @@ TEST_F(InMemoryZoneFinderTest, cancelWildcardNSEC3) {
|
|
// or without FIND_DNSSEC option. NSEC should be returned only when the option
|
|
// or without FIND_DNSSEC option. NSEC should be returned only when the option
|
|
// is given.
|
|
// is given.
|
|
TEST_F(InMemoryZoneFinderTest, cancelWildcardNSEC) {
|
|
TEST_F(InMemoryZoneFinderTest, cancelWildcardNSEC) {
|
|
- addZoneData(rr_wild_);
|
|
|
|
- addZoneData(rr_not_wild_);
|
|
|
|
- addZoneData(rr_nsec_);
|
|
|
|
|
|
+ addToZoneData(rr_wild_);
|
|
|
|
+ addToZoneData(rr_not_wild_);
|
|
|
|
+ addToZoneData(rr_nsec_);
|
|
|
|
|
|
{
|
|
{
|
|
SCOPED_TRACE("Runnig with single entry under foo.wild.example.org");
|
|
SCOPED_TRACE("Runnig with single entry under foo.wild.example.org");
|
|
@@ -1324,7 +1324,7 @@ TEST_F(InMemoryZoneFinderTest, cancelWildcardNSEC) {
|
|
ZoneFinder::FIND_DNSSEC);
|
|
ZoneFinder::FIND_DNSSEC);
|
|
doCancelWildcardCheck(ZoneFinder::RESULT_NSEC_SIGNED);
|
|
doCancelWildcardCheck(ZoneFinder::RESULT_NSEC_SIGNED);
|
|
}
|
|
}
|
|
- addZoneData(rr_not_wild_another_);
|
|
|
|
|
|
+ addToZoneData(rr_not_wild_another_);
|
|
{
|
|
{
|
|
SCOPED_TRACE("Runnig with two entries under foo.wild.example.org");
|
|
SCOPED_TRACE("Runnig with two entries under foo.wild.example.org");
|
|
doCancelWildcardCheck(ZoneFinder::RESULT_NSEC_SIGNED,
|
|
doCancelWildcardCheck(ZoneFinder::RESULT_NSEC_SIGNED,
|
|
@@ -1345,7 +1345,7 @@ TEST_F(InMemoryZoneFinderTest, findNSEC3ForBadZone) {
|
|
DataSourceError);
|
|
DataSourceError);
|
|
|
|
|
|
// Only having NSEC3PARAM isn't enough
|
|
// Only having NSEC3PARAM isn't enough
|
|
- addZoneData(textToRRset("example.org. 300 IN NSEC3PARAM "
|
|
|
|
|
|
+ addToZoneData(textToRRset("example.org. 300 IN NSEC3PARAM "
|
|
"1 0 12 aabbccdd"));
|
|
"1 0 12 aabbccdd"));
|
|
EXPECT_THROW(zone_finder_.findNSEC3(Name("www.example.org"), true),
|
|
EXPECT_THROW(zone_finder_.findNSEC3(Name("www.example.org"), true),
|
|
DataSourceError);
|
|
DataSourceError);
|
|
@@ -1354,7 +1354,7 @@ TEST_F(InMemoryZoneFinderTest, findNSEC3ForBadZone) {
|
|
// is guaranteed.
|
|
// is guaranteed.
|
|
const string ns1_nsec3_text = string(ns1_hash) + ".example.org." +
|
|
const string ns1_nsec3_text = string(ns1_hash) + ".example.org." +
|
|
string(nsec3_common);
|
|
string(nsec3_common);
|
|
- addZoneData(textToRRset(ns1_nsec3_text));
|
|
|
|
|
|
+ addToZoneData(textToRRset(ns1_nsec3_text));
|
|
EXPECT_THROW(zone_finder_.findNSEC3(Name("www.example.org"), true),
|
|
EXPECT_THROW(zone_finder_.findNSEC3(Name("www.example.org"), true),
|
|
DataSourceError);
|
|
DataSourceError);
|
|
}
|
|
}
|
|
@@ -1373,16 +1373,16 @@ public:
|
|
// zzz.example.org: hash=R5..
|
|
// zzz.example.org: hash=R5..
|
|
const string apex_nsec3_text = string(apex_hash) + ".example.org." +
|
|
const string apex_nsec3_text = string(apex_hash) + ".example.org." +
|
|
string(nsec3_common);
|
|
string(nsec3_common);
|
|
- addZoneData(textToRRset(apex_nsec3_text));
|
|
|
|
|
|
+ addToZoneData(textToRRset(apex_nsec3_text));
|
|
const string ns1_nsec3_text = string(ns1_hash) + ".example.org." +
|
|
const string ns1_nsec3_text = string(ns1_hash) + ".example.org." +
|
|
string(nsec3_common);
|
|
string(nsec3_common);
|
|
- addZoneData(textToRRset(ns1_nsec3_text));
|
|
|
|
|
|
+ addToZoneData(textToRRset(ns1_nsec3_text));
|
|
const string w_nsec3_text = string(w_hash) + ".example.org." +
|
|
const string w_nsec3_text = string(w_hash) + ".example.org." +
|
|
string(nsec3_common);
|
|
string(nsec3_common);
|
|
- addZoneData(textToRRset(w_nsec3_text));
|
|
|
|
|
|
+ addToZoneData(textToRRset(w_nsec3_text));
|
|
const string zzz_nsec3_text = string(zzz_hash) + ".example.org." +
|
|
const string zzz_nsec3_text = string(zzz_hash) + ".example.org." +
|
|
string(nsec3_common);
|
|
string(nsec3_common);
|
|
- addZoneData(textToRRset(zzz_nsec3_text));
|
|
|
|
|
|
+ addToZoneData(textToRRset(zzz_nsec3_text));
|
|
}
|
|
}
|
|
|
|
|
|
private:
|
|
private:
|