Commit c7d730d7 authored by Thomas Markwalder's avatar Thomas Markwalder
Browse files

[3436] Found a couple of spots missig position info

parent 1cae4e83
......@@ -206,12 +206,21 @@ D2CfgMgr::buildParams(isc::data::ConstElementPtr params_config) {
// We validate them here rather than just relying on D2Param constructor
// so we can spit out config text position info with errors.
// Fetch and validate io_address.
// Fetch and validate ip_address.
D2CfgContextPtr context = getD2CfgContext();
isc::dhcp::StringStoragePtr strings = context->getStringStorage();
asiolink::IOAddress ip_address(strings->
getOptionalParam("ip_address",
D2Params::DFT_IP_ADDRESS));
asiolink::IOAddress ip_address(D2Params::DFT_IP_ADDRESS);
std::string ip_address_str = strings->getOptionalParam("ip_address",
D2Params::
DFT_IP_ADDRESS);
try {
ip_address = asiolink::IOAddress(ip_address_str);
} catch (const std::exception& ex) {
isc_throw(D2CfgError, "IP address invalid : \""
<< ip_address_str << "\" : "
<< strings->getPosition("ip_address"));
}
if ((ip_address.toText() == "0.0.0.0") || (ip_address.toText() == "::")) {
isc_throw(D2CfgError, "IP address cannot be \"" << ip_address << "\" : "
......
......@@ -643,7 +643,8 @@ build(isc::data::ConstElementPtr server_list){
// Domains must have at least one server.
if (parsers_.size() == 0) {
isc_throw (D2CfgError, "Server List must contain at least one server");
isc_throw (D2CfgError, "Server List must contain at least one server"
<< " : " << server_list->getPosition());
}
}
......
......@@ -206,9 +206,10 @@ DCfgMgrBase::parseConfig(isc::data::ConstElementPtr config_set) {
objects_map.erase(it);
}
else {
isc_throw(DCfgMgrBaseError, "Element:" << element_id <<
" is listed in the parse order but is not "
" present in the configuration");
isc_throw(DCfgMgrBaseError,
"Element required by parsing order is missing: "
<< element_id << " : "
<< config_set->getPosition());
}
}
......
......@@ -849,6 +849,33 @@
}
}
#-----
,{
"description" : "D2.forward_ddns.dhcp_ddns.dns_servers.ip_address invalid address ",
"should_fail" : true,
"data" :
{
"forward_ddns" :
{
"ddns_domains" :
[
{
"name" : "four.example.com.",
"dns_servers" :
[
{
"ip_address" : "bogus"
}
]
}
]
},
"reverse_ddns" : {},
"tsig_keys" : []
}
}
#-----
,{
"description" : "D2.forward_ddns.dhcp_ddns.dns_servers.port valid value ",
......@@ -1215,6 +1242,32 @@
"tsig_keys" : []
}
}
#-----
,{
"description" : "D2.reverse_ddns.dhcp_ddns.dns_servers.ip_address invalid value",
"should_fail" : true,
"data" :
{
"forward_ddns" : {},
"reverse_ddns" :
{
"ddns_domains" :
[
{
"name" : "2.0.192.in-addr.arpa.",
"dns_servers" :
[
{
"ip_address" : "bogus"
}
]
}
]
},
"tsig_keys" : []
}
}
#-----
,{
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment