mirror of
https://gitlab.isc.org/isc-projects/kea
synced 2025-08-29 13:07:50 +00:00
[1577] Test findNSEC3 throws on non-NSEC3 zone
Just confirming it throws in case there's no NSEC3PARAM to compute the hash by.
This commit is contained in:
parent
76f364b152
commit
b407617f16
@ -3575,8 +3575,6 @@ TEST_F(MockDatabaseClientTest, journalWithBadData) {
|
||||
TEST_F(MockDatabaseClientTest, findNSEC3) {
|
||||
// Set up the faked hash calculator.
|
||||
setNSEC3HashCreator(&test_nsec3_hash_creator_);
|
||||
// And enable NSEC3 in the zone.
|
||||
this->current_accessor_->enableNSEC3();
|
||||
|
||||
DataSourceClient::FindResult
|
||||
zone(this->client_->findZone(Name("example.org")));
|
||||
@ -3584,6 +3582,12 @@ TEST_F(MockDatabaseClientTest, findNSEC3) {
|
||||
boost::shared_ptr<DatabaseClient::Finder> finder(
|
||||
dynamic_pointer_cast<DatabaseClient::Finder>(zone.zone_finder));
|
||||
|
||||
// It'll complain if there is no NSEC3PARAM yet
|
||||
EXPECT_THROW(finder->findNSEC3(Name("example.org"), false),
|
||||
DataSourceError);
|
||||
// And enable NSEC3 in the zone.
|
||||
this->current_accessor_->enableNSEC3();
|
||||
|
||||
// Parameter validation: the query name must be in or below the zone
|
||||
EXPECT_THROW(finder->findNSEC3(Name("example.com"), false), OutOfZone);
|
||||
EXPECT_THROW(finder->findNSEC3(Name("org"), true), OutOfZone);
|
||||
|
Loading…
x
Reference in New Issue
Block a user