]> git.ipfire.org Git - thirdparty/kea.git/commitdiff
[#65,!62] Small clarifications after review.
authorTomek Mrugalski <tomasz@isc.org>
Thu, 18 Oct 2018 11:11:25 +0000 (13:11 +0200)
committerFrancis Dupont <fdupont@isc.org>
Fri, 19 Oct 2018 14:05:31 +0000 (10:05 -0400)
src/lib/yang/adaptor_host.h
src/lib/yang/adaptor_option.h
src/lib/yang/adaptor_pool.h
src/lib/yang/tests/adaptor_pool_unittests.cc

index 4c12098d2b0cbe093cc62ff31ae6166230a063ce..918b4bf7b2198e5685b95cf111e71445200b023f 100644 (file)
@@ -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 {
index 69a3ce86e8cf358cb4877b295ba54de33ae60037..0d408f158155d4bf2ad1260ec7c78279d799b251 100644 (file)
@@ -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.
index 9d19c23f1ac905e57036c0e25349c40993bca731..40924a966981b7a20746e0497cd9257a40c31a98 100644 (file)
@@ -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.
index 564d037bf89880bb87f95f406ded1802c85361ba..be8e71ecbcb3e4f42f14b6cba4b3152469f27ded 100644 (file)
@@ -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);
 }