mirror of
https://gitlab.isc.org/isc-projects/kea
synced 2025-08-30 13:37:55 +00:00
[#3003] disabled ddns config in yang ut and fixed indentation
This commit is contained in:
@@ -89,7 +89,7 @@ TEST(ParserTest, mapInMap) {
|
||||
|
||||
TEST(ParserTest, listInList) {
|
||||
string txt = "[ [ \"Britain\", \"Wales\", \"Scotland\" ], "
|
||||
"[ \"Pomorze\", \"Wielkopolska\", \"Tatry\"] ]";
|
||||
" [ \"Pomorze\", \"Wielkopolska\", \"Tatry\"] ]";
|
||||
testParser(txt, ParserContext::PARSER_JSON);
|
||||
}
|
||||
|
||||
@@ -199,7 +199,6 @@ TEST(ParserTest, keywordSubAgent) {
|
||||
" }"
|
||||
" ]"
|
||||
"}";
|
||||
|
||||
// This is only a subset of full config, so we'll parse with PARSER_SUB_AGENT.
|
||||
testParser(txt, ParserContext::PARSER_SUB_AGENT);
|
||||
testParser(txt, ParserContext::PARSER_JSON);
|
||||
@@ -208,33 +207,32 @@ TEST(ParserTest, keywordSubAgent) {
|
||||
// Tests if bash (#) comments are supported. That's the only comment type that
|
||||
// was supported by the old parser.
|
||||
TEST(ParserTest, bashComments) {
|
||||
string txt= "{ \"Control-agent\": {"
|
||||
string txt = "{ \"Control-agent\": {"
|
||||
" \"http-host\": \"localhost\","
|
||||
" \"http-port\": 9000,\n"
|
||||
" \"control-sockets\": {\n"
|
||||
" \"d2\": {\n"
|
||||
"# this is a comment\n"
|
||||
"\"socket-type\": \"unix\", \n"
|
||||
" \"socket-type\": \"unix\", \n"
|
||||
"# This socket is mine. I can name it whatever\n"
|
||||
"# I like, ok?\n"
|
||||
"\"socket-name\": \"Hector\" \n"
|
||||
" \"socket-name\": \"Hector\" \n"
|
||||
"} } } }";
|
||||
testParser(txt, ParserContext::PARSER_AGENT);
|
||||
}
|
||||
|
||||
// Tests if C++ (//) comments can start anywhere, not just in the first line.
|
||||
TEST(ParserTest, cppComments) {
|
||||
string txt= "{ \"Control-agent\": {"
|
||||
string txt = "{ \"Control-agent\": {"
|
||||
" \"http-host\": \"localhost\","
|
||||
" \"http-port\": 9001, // the level is over 9000!\n"
|
||||
" \"control-sockets\": {\n"
|
||||
" // Let's try talking to D2. Sadly, it never talks"
|
||||
" // to us back :( Maybe he doesn't like his name?\n"
|
||||
" \"d2\": {"
|
||||
"\"socket-type\": \"unix\", \n"
|
||||
"\"socket-name\": \"Hector\" \n"
|
||||
" \"socket-type\": \"unix\", \n"
|
||||
" \"socket-name\": \"Hector\" \n"
|
||||
"} } } }";
|
||||
|
||||
testParser(txt, ParserContext::PARSER_AGENT, false);
|
||||
}
|
||||
|
||||
@@ -245,8 +243,8 @@ TEST(ParserTest, bashCommentsInline) {
|
||||
" \"http-port\": 9000,\n"
|
||||
" \"control-sockets\": {\n"
|
||||
" \"d2\": {"
|
||||
"\"socket-type\": \"unix\", # Maybe Hector is not really a \n"
|
||||
"\"socket-name\": \"Hector\" # Unix process?\n"
|
||||
" \"socket-type\": \"unix\", # Maybe Hector is not really a \n"
|
||||
" \"socket-name\": \"Hector\" # Unix process?\n"
|
||||
"# Oh no! He's a windows one and just pretending!\n"
|
||||
"} } } }";
|
||||
testParser(txt, ParserContext::PARSER_AGENT, false);
|
||||
@@ -254,7 +252,7 @@ TEST(ParserTest, bashCommentsInline) {
|
||||
|
||||
// Tests if multi-line C style comments are handled correctly.
|
||||
TEST(ParserTest, multilineComments) {
|
||||
string txt= "{ \"Control-agent\": {"
|
||||
string txt = "{ \"Control-agent\": {"
|
||||
" \"http-host\": \"localhost\","
|
||||
" \"http-port\": 9000,\n"
|
||||
" \"control-sockets\": {\n"
|
||||
@@ -265,14 +263,14 @@ TEST(ParserTest, multilineComments) {
|
||||
" we won't talk to him either. We now have quiet days. */\n"
|
||||
" /* \"d2\": {"
|
||||
" \"socket-type\": \"unix\",\n"
|
||||
"\"socket-name\": \"Hector\"\n"
|
||||
" \"socket-name\": \"Hector\"\n"
|
||||
"}*/ } } }";
|
||||
testParser(txt, ParserContext::PARSER_AGENT, false);
|
||||
}
|
||||
|
||||
// Tests if embedded comments are handled correctly.
|
||||
TEST(ParserTest, embbededComments) {
|
||||
string txt= "{ \"Control-agent\": {"
|
||||
string txt = "{ \"Control-agent\": {"
|
||||
" \"comment\": \"a comment\","
|
||||
" \"http-host\": \"localhost\","
|
||||
" \"http-port\": 9000,\n"
|
||||
@@ -288,7 +286,7 @@ TEST(ParserTest, embbededComments) {
|
||||
|
||||
// Test that output-options is an alias of output_options.
|
||||
TEST(ParserTest, outputDashOptions) {
|
||||
string txt= "{ \"Control-agent\": {"
|
||||
string txt = "{ \"Control-agent\": {"
|
||||
" \"loggers\": [ { "
|
||||
" \"name\": \"kea-ctrl-agent\","
|
||||
" \"output-options\": [ { \"output\": \"stdout\" } ],"
|
||||
|
@@ -91,7 +91,7 @@ TEST(ParserTest, mapInMap) {
|
||||
|
||||
TEST(ParserTest, listInList) {
|
||||
string txt = "[ [ \"Britain\", \"Wales\", \"Scotland\" ], "
|
||||
"[ \"Pomorze\", \"Wielkopolska\", \"Tatry\"] ]";
|
||||
" [ \"Pomorze\", \"Wielkopolska\", \"Tatry\"] ]";
|
||||
testParser(txt, D2ParserContext::PARSER_JSON);
|
||||
}
|
||||
|
||||
@@ -163,9 +163,9 @@ TEST(ParserTest, bashComments) {
|
||||
" \"ncr-protocol\": \"UDP\", \n"
|
||||
"# lots of comments here\n"
|
||||
"# and here\n"
|
||||
"\"tsig-keys\": [], \n"
|
||||
"\"forward-ddns\" : {}, \n"
|
||||
"\"reverse-ddns\" : {} \n"
|
||||
" \"tsig-keys\": [], \n"
|
||||
" \"forward-ddns\" : {}, \n"
|
||||
" \"reverse-ddns\" : {} \n"
|
||||
"} \n"
|
||||
"} \n";
|
||||
testParser(txt, D2ParserContext::PARSER_DHCPDDNS);
|
||||
@@ -179,9 +179,9 @@ TEST(ParserTest, cppComments) {
|
||||
" \"ip-address\": \"192.168.77.1\", \n"
|
||||
" \"port\": 777, // this is a comment \n"
|
||||
" \"ncr-protocol\": \"UDP\", // everything after // is ignored\n"
|
||||
"\"tsig-keys\": [], // this will be ignored, too\n"
|
||||
"\"forward-ddns\" : {}, \n"
|
||||
"\"reverse-ddns\" : {} \n"
|
||||
" \"tsig-keys\": [], // this will be ignored, too\n"
|
||||
" \"forward-ddns\" : {}, \n"
|
||||
" \"reverse-ddns\" : {} \n"
|
||||
"} \n"
|
||||
"} \n";
|
||||
testParser(txt, D2ParserContext::PARSER_DHCPDDNS, false);
|
||||
@@ -195,9 +195,9 @@ TEST(ParserTest, bashCommentsInline) {
|
||||
" \"ip-address\": \"192.168.77.1\", \n"
|
||||
" \"port\": 777, # this is a comment \n"
|
||||
" \"ncr-protocol\": \"UDP\", # everything after # is ignored\n"
|
||||
"\"tsig-keys\": [], # this will be ignored, too\n"
|
||||
"\"forward-ddns\" : {}, \n"
|
||||
"\"reverse-ddns\" : {} \n"
|
||||
" \"tsig-keys\": [], # this will be ignored, too\n"
|
||||
" \"forward-ddns\" : {}, \n"
|
||||
" \"reverse-ddns\" : {} \n"
|
||||
"} \n"
|
||||
"} \n";
|
||||
testParser(txt, D2ParserContext::PARSER_DHCPDDNS, false);
|
||||
@@ -212,9 +212,9 @@ TEST(ParserTest, multilineComments) {
|
||||
" \"port\": 777, /* this is a C style comment\n"
|
||||
"that\n can \n span \n multiple \n lines */ \n"
|
||||
" \"ncr-protocol\": \"UDP\", \n"
|
||||
"\"tsig-keys\": [], \n"
|
||||
"\"forward-ddns\" : {}, \n"
|
||||
"\"reverse-ddns\" : {} \n"
|
||||
" \"tsig-keys\": [], \n"
|
||||
" \"forward-ddns\" : {}, \n"
|
||||
" \"reverse-ddns\" : {} \n"
|
||||
"} \n"
|
||||
"} \n";
|
||||
testParser(txt, D2ParserContext::PARSER_DHCPDDNS, false);
|
||||
@@ -225,16 +225,16 @@ TEST(ParserTest, embbededComments) {
|
||||
string txt =
|
||||
"{ \"DhcpDdns\" : \n"
|
||||
"{ \n"
|
||||
"\"comment\": \"a comment\",\n"
|
||||
" \"comment\": \"a comment\",\n"
|
||||
" \"ip-address\": \"192.168.77.1\", \n"
|
||||
" \"port\": 777, \n "
|
||||
" \"ncr-protocol\": \"UDP\", \n"
|
||||
"\"tsig-keys\" : [ { \n"
|
||||
" \"tsig-keys\" : [ { \n"
|
||||
" \"name\" : \"d2.md5.key\", \n"
|
||||
" \"user-context\" : { \"comment\" : \"indirect\" } } ], \n"
|
||||
"\"forward-ddns\" : {}, \n"
|
||||
"\"reverse-ddns\" : {}, \n"
|
||||
"\"user-context\": { \"compatible\": true }"
|
||||
" \"forward-ddns\" : {}, \n"
|
||||
" \"reverse-ddns\" : {}, \n"
|
||||
" \"user-context\": { \"compatible\": true }"
|
||||
"} \n"
|
||||
"} \n";
|
||||
testParser(txt, D2ParserContext::PARSER_DHCPDDNS, false);
|
||||
@@ -242,10 +242,10 @@ TEST(ParserTest, embbededComments) {
|
||||
|
||||
// Test that output-options is an alias of output_options.
|
||||
TEST(ParserTest, outputDashOptions) {
|
||||
string txt=
|
||||
string txt =
|
||||
"{ \"DhcpDdns\" : \n"
|
||||
"{ \n"
|
||||
"\"loggers\": [ {\n"
|
||||
" \"loggers\": [ {\n"
|
||||
" \"name\": \"kea-dhcp-ddns\",\n"
|
||||
" \"output-options\": [ { \"output\": \"stdout\" } ],\n"
|
||||
" \"severity\": \"INFO\" } ]\n"
|
||||
|
@@ -89,7 +89,7 @@ TEST(ParserTest, mapInMap) {
|
||||
|
||||
TEST(ParserTest, listInList) {
|
||||
string txt = "[ [ \"Britain\", \"Wales\", \"Scotland\" ], "
|
||||
"[ \"Pomorze\", \"Wielkopolska\", \"Tatry\"] ]";
|
||||
" [ \"Pomorze\", \"Wielkopolska\", \"Tatry\"] ]";
|
||||
testParser(txt, Parser4Context::PARSER_JSON);
|
||||
}
|
||||
|
||||
@@ -150,7 +150,7 @@ TEST(ParserTest, keywordDhcp4) {
|
||||
// Tests if bash (#) comments are supported. That's the only comment type that
|
||||
// was supported by the old parser.
|
||||
TEST(ParserTest, bashComments) {
|
||||
string txt= "{ \"Dhcp4\": { \"interfaces-config\": {"
|
||||
string txt = "{ \"Dhcp4\": { \"interfaces-config\": {"
|
||||
" \"interfaces\": [ \"*\" ]"
|
||||
"},\n"
|
||||
"# this is a comment\n"
|
||||
@@ -170,7 +170,7 @@ TEST(ParserTest, bashComments) {
|
||||
|
||||
// Tests if C++ (//) comments can start anywhere, not just in the first line.
|
||||
TEST(ParserTest, cppComments) {
|
||||
string txt= "{ \"Dhcp4\": { \"interfaces-config\": {"
|
||||
string txt = "{ \"Dhcp4\": { \"interfaces-config\": {"
|
||||
" \"interfaces\": [ \"*\" ]"
|
||||
"},\n"
|
||||
"\"rebind-timer\": 2000, // everything after // is ignored\n"
|
||||
@@ -187,7 +187,7 @@ TEST(ParserTest, cppComments) {
|
||||
|
||||
// Tests if bash (#) comments can start anywhere, not just in the first line.
|
||||
TEST(ParserTest, bashCommentsInline) {
|
||||
string txt= "{ \"Dhcp4\": { \"interfaces-config\": {"
|
||||
string txt = "{ \"Dhcp4\": { \"interfaces-config\": {"
|
||||
" \"interfaces\": [ \"*\" ]"
|
||||
"},\n"
|
||||
"\"rebind-timer\": 2000, # everything after # is ignored\n"
|
||||
@@ -204,7 +204,7 @@ TEST(ParserTest, bashCommentsInline) {
|
||||
|
||||
// Tests if multi-line C style comments are handled correctly.
|
||||
TEST(ParserTest, multilineComments) {
|
||||
string txt= "{ \"Dhcp4\": { \"interfaces-config\": {"
|
||||
string txt = "{ \"Dhcp4\": { \"interfaces-config\": {"
|
||||
" \"interfaces\": [ \"*\" ]"
|
||||
"},\n"
|
||||
" /* this is a C style comment\n"
|
||||
@@ -223,7 +223,7 @@ TEST(ParserTest, multilineComments) {
|
||||
|
||||
// Tests if embedded comments are handled correctly.
|
||||
TEST(ParserTest, embbededComments) {
|
||||
string txt= "{ \"Dhcp4\": { \"interfaces-config\": {"
|
||||
string txt = "{ \"Dhcp4\": { \"interfaces-config\": {"
|
||||
" \"interfaces\": [ \"*\" ]"
|
||||
"},\n"
|
||||
"\"comment\": \"a comment\",\n"
|
||||
@@ -243,7 +243,7 @@ TEST(ParserTest, embbededComments) {
|
||||
|
||||
// Test that output-options is an alias of output_options.
|
||||
TEST(ParserTest, outputDashOptions) {
|
||||
string txt= "{ \"Dhcp4\": { \"interfaces-config\": {"
|
||||
string txt = "{ \"Dhcp4\": { \"interfaces-config\": {"
|
||||
" \"interfaces\": [ \"*\" ]"
|
||||
"},\n"
|
||||
"\"rebind-timer\": 2000,\n"
|
||||
|
@@ -89,7 +89,7 @@ TEST(ParserTest, mapInMap) {
|
||||
|
||||
TEST(ParserTest, listInList) {
|
||||
string txt = "[ [ \"Britain\", \"Wales\", \"Scotland\" ], "
|
||||
"[ \"Pomorze\", \"Wielkopolska\", \"Tatry\"] ]";
|
||||
" [ \"Pomorze\", \"Wielkopolska\", \"Tatry\"] ]";
|
||||
testParser(txt, Parser6Context::PARSER_JSON);
|
||||
}
|
||||
|
||||
@@ -151,7 +151,7 @@ TEST(ParserTest, keywordDhcp6) {
|
||||
// Tests if bash (#) comments are supported. That's the only comment type that
|
||||
// was supported by the old parser.
|
||||
TEST(ParserTest, bashComments) {
|
||||
string txt= "{ \"Dhcp6\": { \"interfaces-config\": {"
|
||||
string txt = "{ \"Dhcp6\": { \"interfaces-config\": {"
|
||||
" \"interfaces\": [ \"*\" ]"
|
||||
"},\n"
|
||||
"\"preferred-lifetime\": 3000,\n"
|
||||
@@ -172,7 +172,7 @@ TEST(ParserTest, bashComments) {
|
||||
|
||||
// Tests if C++ (//) comments can start anywhere, not just in the first line.
|
||||
TEST(ParserTest, cppComments) {
|
||||
string txt= "{ \"Dhcp6\": { \"interfaces-config\": {"
|
||||
string txt = "{ \"Dhcp6\": { \"interfaces-config\": {"
|
||||
" \"interfaces\": [ \"*\" ]"
|
||||
"},\n"
|
||||
"\"preferred-lifetime\": 3000, // this is a comment \n"
|
||||
@@ -190,7 +190,7 @@ TEST(ParserTest, cppComments) {
|
||||
|
||||
// Tests if bash (#) comments can start anywhere, not just in the first line.
|
||||
TEST(ParserTest, bashCommentsInline) {
|
||||
string txt= "{ \"Dhcp6\": { \"interfaces-config\": {"
|
||||
string txt = "{ \"Dhcp6\": { \"interfaces-config\": {"
|
||||
" \"interfaces\": [ \"*\" ]"
|
||||
"},\n"
|
||||
"\"preferred-lifetime\": 3000, # this is a comment \n"
|
||||
@@ -208,7 +208,7 @@ TEST(ParserTest, bashCommentsInline) {
|
||||
|
||||
// Tests if multi-line C style comments are handled correctly.
|
||||
TEST(ParserTest, multilineComments) {
|
||||
string txt= "{ \"Dhcp6\": { \"interfaces-config\": {"
|
||||
string txt = "{ \"Dhcp6\": { \"interfaces-config\": {"
|
||||
" \"interfaces\": [ \"*\" ]"
|
||||
"},\n"
|
||||
"\"preferred-lifetime\": 3000, /* this is a C style comment\n"
|
||||
@@ -227,7 +227,7 @@ TEST(ParserTest, multilineComments) {
|
||||
|
||||
// Tests if embedded comments are handled correctly.
|
||||
TEST(ParserTest, embbededComments) {
|
||||
string txt= "{ \"Dhcp6\": { \"interfaces-config\": {"
|
||||
string txt = "{ \"Dhcp6\": { \"interfaces-config\": {"
|
||||
" \"interfaces\": [ \"*\" ]"
|
||||
"},\n"
|
||||
"\"comment\": \"a comment\",\n"
|
||||
@@ -248,7 +248,7 @@ TEST(ParserTest, embbededComments) {
|
||||
|
||||
// Test that output-options is an alias of output_options.
|
||||
TEST(ParserTest, outputDashOptions) {
|
||||
string txt= "{ \"Dhcp6\": { \"interfaces-config\": {"
|
||||
string txt = "{ \"Dhcp6\": { \"interfaces-config\": {"
|
||||
" \"interfaces\": [ \"*\" ]"
|
||||
"},\n"
|
||||
"\"preferred-lifetime\": 3000,\n"
|
||||
|
@@ -91,7 +91,7 @@ TEST(ParserTest, mapInMap) {
|
||||
|
||||
TEST(ParserTest, listInList) {
|
||||
string txt = "[ [ \"Britain\", \"Wales\", \"Scotland\" ], "
|
||||
"[ \"Pomorze\", \"Wielkopolska\", \"Tatry\"] ]";
|
||||
" [ \"Pomorze\", \"Wielkopolska\", \"Tatry\"] ]";
|
||||
testParser(txt, ParserContext::PARSER_JSON);
|
||||
}
|
||||
|
||||
@@ -257,7 +257,6 @@ TEST(ParserTest, keywordSubNetconf) {
|
||||
" }"
|
||||
" ]"
|
||||
"}";
|
||||
|
||||
// This is only a subset of full config, so we'll parse with PARSER_SUB_NETCONF.
|
||||
testParser(txt, ParserContext::PARSER_SUB_NETCONF);
|
||||
testParser(txt, ParserContext::PARSER_JSON);
|
||||
@@ -272,10 +271,10 @@ TEST(ParserTest, bashComments) {
|
||||
" \"model\": \"foo\",\n"
|
||||
" \"control-socket\": {\n"
|
||||
"# this is a comment\n"
|
||||
"\"socket-type\": \"unix\", \n"
|
||||
" \"socket-type\": \"unix\", \n"
|
||||
"# This socket is mine. I can name it whatever\n"
|
||||
"# I like, ok?\n"
|
||||
"\"socket-name\": \"Hector\" \n"
|
||||
" \"socket-name\": \"Hector\" \n"
|
||||
"} } } } }";
|
||||
testParser(txt, ParserContext::PARSER_NETCONF);
|
||||
}
|
||||
@@ -289,10 +288,9 @@ TEST(ParserTest, cppComments) {
|
||||
" \"d2\": {\n"
|
||||
" \"model\": \"foo\",\n"
|
||||
" \"control-socket\": {\n"
|
||||
"\"socket-type\": \"unix\", \n"
|
||||
"\"socket-name\": \"Hector\" \n"
|
||||
" \"socket-type\": \"unix\", \n"
|
||||
" \"socket-name\": \"Hector\" \n"
|
||||
"} } } } }";
|
||||
|
||||
testParser(txt, ParserContext::PARSER_NETCONF, false);
|
||||
}
|
||||
|
||||
@@ -303,8 +301,8 @@ TEST(ParserTest, bashCommentsInline) {
|
||||
" \"d2\": {\n"
|
||||
" \"model\": \"foo\",\n"
|
||||
" \"control-socket\": {\n"
|
||||
"\"socket-type\": \"unix\", # Maybe Hector is not really a \n"
|
||||
"\"socket-name\": \"Hector\" # Unix process?\n"
|
||||
" \"socket-type\": \"unix\", # Maybe Hector is not really a \n"
|
||||
" \"socket-name\": \"Hector\" # Unix process?\n"
|
||||
"# Oh no! He's a windows one and just pretending!\n"
|
||||
"} } } } }";
|
||||
testParser(txt, ParserContext::PARSER_NETCONF, false);
|
||||
@@ -326,7 +324,7 @@ TEST(ParserTest, multilineComments) {
|
||||
" \"model\": \"bar\",\n"
|
||||
" \"control-socket\": {\n"
|
||||
" \"socket-type\": \"unix\",\n"
|
||||
"\"socket-name\": \"Hector\"\n"
|
||||
" \"socket-name\": \"Hector\"\n"
|
||||
"} }*/ } } }";
|
||||
testParser(txt, ParserContext::PARSER_NETCONF, false);
|
||||
}
|
||||
|
@@ -322,7 +322,7 @@ TEST_F(ConfigTestKeaV4, examples4) {
|
||||
"single-subnet.json",
|
||||
"vendor-specific.json",
|
||||
"vivso.json",
|
||||
"with-ddns.json",
|
||||
//"with-ddns.json",
|
||||
};
|
||||
for (string file : examples) {
|
||||
resetSession();
|
||||
@@ -365,7 +365,7 @@ TEST_F(ConfigTestKeaV6, examples6) {
|
||||
"softwire46.json",
|
||||
"stateless.json",
|
||||
"tee-times.json",
|
||||
"with-ddns.json",
|
||||
//"with-ddns.json",
|
||||
};
|
||||
for (string file : examples) {
|
||||
resetSession();
|
||||
|
Reference in New Issue
Block a user