2
0
mirror of https://gitlab.isc.org/isc-projects/kea synced 2025-10-09 13:46:20 +00:00

[1177] Don't propagate name exceptions from findPreviousName

They should be turned into DataSourceError instead, as they mean bad
data in the DB.
This commit is contained in:
Michal 'vorner' Vaner
2011-09-21 10:53:09 +02:00
parent 2a5c5383e3
commit a59c7f28a4
2 changed files with 25 additions and 2 deletions

View File

@@ -566,6 +566,8 @@ public:
return ("www.example.org.");
} else if (rname == "org.example.badnsec2.") {
return ("badnsec1.example.org.");
} else if (rname == "org.example.brokenname.") {
return ("brokenname...example.org.");
} else if (rname == "org.example.notimplnsec." ||
rname == "org.example.wild.here.") {
isc_throw(isc::NotImplemented, "Not implemented in this test");
@@ -2347,4 +2349,11 @@ TEST_F(MockDatabaseClientTest, missingNSEC) {
DataSourceError);
}
TEST_F(MockDatabaseClientTest, badName) {
shared_ptr<DatabaseClient::Finder> finder(this->getFinder());
EXPECT_THROW(finder->findPreviousName(Name("brokenname.example.org.")),
DataSourceError);
}
}