mirror of
https://gitlab.isc.org/isc-projects/kea
synced 2025-08-31 05:55:28 +00:00
[#1405] fixed unittests
This commit is contained in:
@@ -224,6 +224,26 @@ size_t SimpleParser::setDefaults(ElementPtr scope,
|
||||
x.reset(new DoubleElement(dbl_value, pos));
|
||||
break;
|
||||
}
|
||||
case Element::map: {
|
||||
auto data = Element::fromJSON(def_value.value_);
|
||||
if (data->getType() != Element::map) {
|
||||
isc_throw(BadValue,
|
||||
"Internal error. Incorrect map value type for "
|
||||
<< def_value.name_ << " : " << def_value.value_);
|
||||
}
|
||||
x = data;
|
||||
break;
|
||||
}
|
||||
case Element::list: {
|
||||
auto data = Element::fromJSON(def_value.value_);
|
||||
if (data->getType() != Element::list) {
|
||||
isc_throw(BadValue,
|
||||
"Internal error. Incorrect list value type for "
|
||||
<< def_value.name_ << " : " << def_value.value_);
|
||||
}
|
||||
x = data;
|
||||
break;
|
||||
}
|
||||
default:
|
||||
// No default values for null, list or map
|
||||
isc_throw(DhcpConfigError,
|
||||
|
@@ -70,7 +70,6 @@ const SimpleKeywords SimpleParser4::GLOBAL4_PARAMETERS = {
|
||||
{ "reservations", Element::list },
|
||||
{ "config-control", Element::map },
|
||||
{ "server-tag", Element::string },
|
||||
{ "reservation-mode", Element::string },
|
||||
{ "reservation-modes", Element::map },
|
||||
{ "calculate-tee-times", Element::boolean },
|
||||
{ "t1-percent", Element::real },
|
||||
@@ -111,7 +110,6 @@ const SimpleDefaults SimpleParser4::GLOBAL4_DEFAULTS = {
|
||||
{ "server-hostname", Element::string, "" },
|
||||
{ "boot-file-name", Element::string, "" },
|
||||
{ "server-tag", Element::string, "" },
|
||||
{ "reservation-mode", Element::string, "all" },
|
||||
{ "reservation-modes", Element::map, "{\"in-subnet\": true, \"out-of-pool\": true}" },
|
||||
{ "calculate-tee-times", Element::boolean, "false" },
|
||||
{ "t1-percent", Element::real, ".50" },
|
||||
@@ -208,7 +206,6 @@ const SimpleKeywords SimpleParser4::SUBNET4_PARAMETERS = {
|
||||
{ "client-class", Element::string },
|
||||
{ "require-client-classes", Element::list },
|
||||
{ "reservations", Element::list },
|
||||
{ "reservation-mode", Element::string },
|
||||
{ "reservation-modes", Element::map, },
|
||||
{ "relay", Element::map },
|
||||
{ "match-client-id", Element::boolean },
|
||||
@@ -326,7 +323,6 @@ const SimpleKeywords SimpleParser4::SHARED_NETWORK4_PARAMETERS = {
|
||||
{ "server-hostname", Element::string },
|
||||
{ "boot-file-name", Element::string },
|
||||
{ "relay", Element::map },
|
||||
{ "reservation-mode", Element::string },
|
||||
{ "reservation-modes", Element::map },
|
||||
{ "client-class", Element::string },
|
||||
{ "require-client-classes", Element::list },
|
||||
|
@@ -71,7 +71,6 @@ const SimpleKeywords SimpleParser6::GLOBAL6_PARAMETERS = {
|
||||
{ "reservations", Element::list },
|
||||
{ "config-control", Element::map },
|
||||
{ "server-tag", Element::string },
|
||||
{ "reservation-mode", Element::string },
|
||||
{ "reservation-modes", Element::map },
|
||||
{ "calculate-tee-times", Element::boolean },
|
||||
{ "t1-percent", Element::real },
|
||||
@@ -107,7 +106,6 @@ const SimpleDefaults SimpleParser6::GLOBAL6_DEFAULTS = {
|
||||
{ "decline-probation-period", Element::integer, "86400" }, // 24h
|
||||
{ "dhcp4o6-port", Element::integer, "0" },
|
||||
{ "server-tag", Element::string, "" },
|
||||
{ "reservation-mode", Element::string, "all" },
|
||||
{ "reservation-modes", Element::map, "{\"in-subnet\": true, \"out-of-pool\": true}" },
|
||||
{ "calculate-tee-times", Element::boolean, "true" },
|
||||
{ "t1-percent", Element::real, ".50" },
|
||||
@@ -210,7 +208,6 @@ const SimpleKeywords SimpleParser6::SUBNET6_PARAMETERS = {
|
||||
{ "client-class", Element::string },
|
||||
{ "require-client-classes", Element::list },
|
||||
{ "reservations", Element::list },
|
||||
{ "reservation-mode", Element::string },
|
||||
{ "reservation-modes", Element::map },
|
||||
{ "relay", Element::map },
|
||||
{ "user-context", Element::map },
|
||||
@@ -335,7 +332,6 @@ const SimpleKeywords SimpleParser6::SHARED_NETWORK6_PARAMETERS = {
|
||||
{ "rebind-timer", Element::integer },
|
||||
{ "option-data", Element::list },
|
||||
{ "relay", Element::map },
|
||||
{ "reservation-mode", Element::string },
|
||||
{ "reservation-modes", Element::map },
|
||||
{ "client-class", Element::string },
|
||||
{ "require-client-classes", Element::list },
|
||||
|
Reference in New Issue
Block a user