mirror of
https://gitlab.isc.org/isc-projects/kea
synced 2025-08-30 13:37:55 +00:00
[1627] Add a couple more testcases
* Case when no file is specified * Case where both origin and file are not specified
This commit is contained in:
parent
6ac392ce79
commit
f95e202d7e
@ -313,6 +313,13 @@ TEST_F(MemoryDatasrcConfigTest, addDuplicateZones) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
TEST_F(MemoryDatasrcConfigTest, addBadZone) {
|
TEST_F(MemoryDatasrcConfigTest, addBadZone) {
|
||||||
|
// origin and file are missing
|
||||||
|
EXPECT_THROW(parser->build(
|
||||||
|
Element::fromJSON(
|
||||||
|
"[{\"type\": \"memory\","
|
||||||
|
" \"zones\": [{}]}]")),
|
||||||
|
AuthConfigError);
|
||||||
|
|
||||||
// origin is missing
|
// origin is missing
|
||||||
EXPECT_THROW(parser->build(
|
EXPECT_THROW(parser->build(
|
||||||
Element::fromJSON(
|
Element::fromJSON(
|
||||||
@ -320,6 +327,13 @@ TEST_F(MemoryDatasrcConfigTest, addBadZone) {
|
|||||||
" \"zones\": [{\"file\": \"example.zone\"}]}]")),
|
" \"zones\": [{\"file\": \"example.zone\"}]}]")),
|
||||||
AuthConfigError);
|
AuthConfigError);
|
||||||
|
|
||||||
|
// file is missing
|
||||||
|
EXPECT_THROW(parser->build(
|
||||||
|
Element::fromJSON(
|
||||||
|
"[{\"type\": \"memory\","
|
||||||
|
" \"zones\": [{\"origin\": \"example.com\"}]}]")),
|
||||||
|
AuthConfigError);
|
||||||
|
|
||||||
// missing zone file
|
// missing zone file
|
||||||
EXPECT_THROW(parser->build(
|
EXPECT_THROW(parser->build(
|
||||||
Element::fromJSON(
|
Element::fromJSON(
|
||||||
|
Loading…
x
Reference in New Issue
Block a user