/// @brief JSON adaptor for host reservations quoting identifiers.
///
/// The identifier type and identifier value are used as keys in YANG
-/// host reservation lists so soem constraints were put on their contents.
+/// host reservation lists so some constraints were put on their contents.
/// For instance a quoted flex-id identifier raises an error (keys
/// are between quotes in setItem commands).
class AdaptorHost {
static void setSpace(isc::data::ElementPtr option,
const std::string& space);
- /// @brief Check type (option definition).
+ /// @brief Checks if type is specified in option definition.
///
/// @param option The option.
/// @throw MissingKey if the type is not present.
static void checkType(isc::data::ConstElementPtr option);
- /// @brief Check code.
+ /// @brief Check if code is specified in option defintion.
///
/// @param option The option.
/// @throw MissingKey if the code is not present.
/// @param pool The pool.
static void canonizePool(isc::data::ElementPtr pool);
- /// @brief From subnets.
+ /// @brief Moves parameters from subnets to pools.
///
- /// Move parameters from the subnet to each pool.
+ /// Move parameters from the subnet to each pool. Currently the only
+ /// supported model is ietf-dhcpv6-server. The parameters moved are
+ /// valid-lifetime, preferred-lifetime, renew-timer, renbind-timer.
///
/// @param model Model name.
/// @param subnet The subnet element.
isc::data::ConstElementPtr subnet,
isc::data::ConstElementPtr pools);
- /// @brief To subnet.
+ /// @brief Move parameters from pools to the subnet.
///
- /// Move parameters from pools to the subnet.
+ /// Move parameters from pool to its partent subnet. Currently the only
+ /// supported model is ietf-dhcpv6-server. The parameters moved are
+ /// valid-lifetime, preferred-lifetime, renew-timer, renbind-timer.
///
/// @param model Model name.
/// @param subnet The subnet element.
ASSERT_NO_THROW(json = Element::fromJSON(config));
ConstElementPtr copied = copy(json);
ConstElementPtr pools = json->get("pools");
+
+ // This should be no-op for kea-dhcp4-server and kea-dhcp6-server models
EXPECT_NO_THROW(AdaptorPool::fromSubnet(KEA_DHCP4_SERVER, json, pools));
EXPECT_TRUE(copied->equals(*json));
// The model is checked first.
EXPECT_NO_THROW(AdaptorPool::fromSubnet(KEA_DHCP6_SERVER, json, pools));
EXPECT_TRUE(copied->equals(*json));
- // Model name is not free: an error is raised if it is not expected.
- EXPECT_THROW(AdaptorPool::fromSubnet("keatest-module", json, pools),
+
+ // Check that the model name is actually checked.
+ EXPECT_THROW(AdaptorPool::fromSubnet("non-existent-module", json, pools),
NotImplemented);
}