Commit b187146b authored by Tomek Mrugalski's avatar Tomek Mrugalski 🛰 Committed by Francis Dupont

[#65,!62] Small clarifications after review.

parent c929ddb9
......@@ -15,7 +15,7 @@ namespace yang {
/// @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 {
......
......@@ -55,13 +55,13 @@ public:
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.
......
......@@ -40,9 +40,11 @@ public:
/// @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.
......@@ -52,9 +54,11 @@ public:
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.
......
......@@ -108,13 +108,16 @@ TEST(AdaptorPoolTest, fromSubnetKea) {
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);
}
......
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