From: Tomek Mrugalski Date: Thu, 18 Oct 2018 11:11:25 +0000 (+0200) Subject: [#65,!62] Small clarifications after review. X-Git-Tag: 65-libyang-config-adaptor_base~8 X-Git-Url: http://git.ipfire.org/gitweb/gitweb.cgi?a=commitdiff_plain;h=b187146bc303f39d9534cffd9805be5fe4a3ac59;p=thirdparty%2Fkea.git [#65,!62] Small clarifications after review. --- diff --git a/src/lib/yang/adaptor_host.h b/src/lib/yang/adaptor_host.h index 4c12098d2b..918b4bf7b2 100644 --- a/src/lib/yang/adaptor_host.h +++ b/src/lib/yang/adaptor_host.h @@ -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 { diff --git a/src/lib/yang/adaptor_option.h b/src/lib/yang/adaptor_option.h index 69a3ce86e8..0d408f1581 100644 --- a/src/lib/yang/adaptor_option.h +++ b/src/lib/yang/adaptor_option.h @@ -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. diff --git a/src/lib/yang/adaptor_pool.h b/src/lib/yang/adaptor_pool.h index 9d19c23f1a..40924a9669 100644 --- a/src/lib/yang/adaptor_pool.h +++ b/src/lib/yang/adaptor_pool.h @@ -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. diff --git a/src/lib/yang/tests/adaptor_pool_unittests.cc b/src/lib/yang/tests/adaptor_pool_unittests.cc index 564d037bf8..be8e71ecbc 100644 --- a/src/lib/yang/tests/adaptor_pool_unittests.cc +++ b/src/lib/yang/tests/adaptor_pool_unittests.cc @@ -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); }