mirror of
https://gitlab.isc.org/isc-projects/kea
synced 2025-08-30 13:37:55 +00:00
[2585] don't replace the name in findAll unless it's wildcard substituion.
This commit is contained in:
@@ -865,7 +865,8 @@ InMemoryZoneFinder::findInternal(const isc::dns::Name& name,
|
|||||||
const RdataSet* cur_rds = node->getData();
|
const RdataSet* cur_rds = node->getData();
|
||||||
while (cur_rds != NULL) {
|
while (cur_rds != NULL) {
|
||||||
target->push_back(createTreeNodeRRset(node, cur_rds, rrclass_,
|
target->push_back(createTreeNodeRRset(node, cur_rds, rrclass_,
|
||||||
options, &name));
|
options,
|
||||||
|
wild ? &name : NULL));
|
||||||
cur_rds = cur_rds->getNext();
|
cur_rds = cur_rds->getNext();
|
||||||
}
|
}
|
||||||
LOG_DEBUG(logger, DBG_TRACE_DATA, DATASRC_MEM_ANY_SUCCESS).
|
LOG_DEBUG(logger, DBG_TRACE_DATA, DATASRC_MEM_ANY_SUCCESS).
|
||||||
|
@@ -442,14 +442,23 @@ protected:
|
|||||||
}
|
}
|
||||||
EXPECT_EQ((expected_flags & ZoneFinder::RESULT_WILDCARD) != 0,
|
EXPECT_EQ((expected_flags & ZoneFinder::RESULT_WILDCARD) != 0,
|
||||||
find_result->isWildcard());
|
find_result->isWildcard());
|
||||||
EXPECT_EQ((expected_flags & ZoneFinder::RESULT_NSEC_SIGNED)
|
EXPECT_EQ((expected_flags & ZoneFinder::RESULT_NSEC_SIGNED) != 0,
|
||||||
!= 0, find_result->isNSECSigned());
|
find_result->isNSECSigned());
|
||||||
EXPECT_EQ((expected_flags & ZoneFinder::RESULT_NSEC3_SIGNED)
|
EXPECT_EQ((expected_flags & ZoneFinder::RESULT_NSEC3_SIGNED) != 0,
|
||||||
!= 0, find_result->isNSEC3Signed());
|
find_result->isNSEC3Signed());
|
||||||
// Convert all rrsets to 'full' ones before checking
|
// Convert all rrsets to 'full' ones before checking. Also, confirm
|
||||||
|
// each RRset of the vector is of the "same kind" as one would be
|
||||||
|
// found by the find() method.
|
||||||
std::vector<ConstRRsetPtr> converted_rrsets;
|
std::vector<ConstRRsetPtr> converted_rrsets;
|
||||||
BOOST_FOREACH(ConstRRsetPtr cur_rrset, target) {
|
BOOST_FOREACH(ConstRRsetPtr cur_rrset, target) {
|
||||||
converted_rrsets.push_back(convertRRset(cur_rrset));
|
converted_rrsets.push_back(convertRRset(cur_rrset));
|
||||||
|
|
||||||
|
// As we know findAll() succeeded, this find() should also
|
||||||
|
// succeed, and the two sets should be "identical".
|
||||||
|
const ZoneFinderContextPtr result =
|
||||||
|
finder->find(name, cur_rrset->getType());
|
||||||
|
ASSERT_TRUE(result->rrset);
|
||||||
|
EXPECT_TRUE(result->rrset->isSameKind(*cur_rrset));
|
||||||
}
|
}
|
||||||
rrsetsCheck(expected_rrsets.begin(), expected_rrsets.end(),
|
rrsetsCheck(expected_rrsets.begin(), expected_rrsets.end(),
|
||||||
converted_rrsets.begin(), converted_rrsets.end());
|
converted_rrsets.begin(), converted_rrsets.end());
|
||||||
|
Reference in New Issue
Block a user