]> git.ipfire.org Git - thirdparty/kea.git/commitdiff
[#104,!290] Addressed review comments 104-cb-add-periodic-fetch-of-the-incremental-dhcpv6-configuration-changes
authorThomas Markwalder <tmark@isc.org>
Wed, 27 Mar 2019 14:12:14 +0000 (10:12 -0400)
committerThomas Markwalder <tmark@isc.org>
Wed, 27 Mar 2019 14:12:14 +0000 (10:12 -0400)
src/bin/dhcp4/ctrl_dhcp4_srv.cc
src/bin/dhcp4/tests/kea_controller_unittest.cc
src/bin/dhcp6/ctrl_dhcp6_srv.cc
src/bin/dhcp6/tests/config_backend_unittest.cc
src/bin/dhcp6/tests/kea_controller_unittest.cc
src/lib/dhcpsrv/Makefile.am

index 3aa2e2d14c99c2929ee21097ad4766b2ffadc75e..0595c1ad01e68e1e3866322401fdca97614e095d 100644 (file)
@@ -972,9 +972,7 @@ void
 ControlledDhcpv4Srv::cbFetchUpdates(const SrvConfigPtr& srv_cfg,
                                     boost::shared_ptr<unsigned> failure_count) {
     try {
-        // The true value indicates that the server should not reconnect
-        // to the configuration backends and should take into account
-        // audit entries stored in the database since last fetch.
+        // Fetch any configuration backend updates since our last fetch.
         server_->getCBControl()->databaseConfigFetch(srv_cfg,
                                                      CBControlDHCPv4::FetchMode::FETCH_UPDATE);
         (*failure_count) = 0;
index 51360cc67bcb76801d350b85539f440791d0bb6c..0c069cc4ddc919639c248c70c965ee247c9bd1a2 100644 (file)
@@ -77,10 +77,12 @@ public:
 
     /// @brief Stub implementation of the "fetch" function.
     ///
-    /// It checks if the @c fetch_updates_only is set to true when it
-    /// is a later than first invocation of the function. It also
-    /// throws an exception when desired by a test, to verify that the
-    /// server gracefully handles such exception.
+    /// If this is not the first invocation of this function, it
+    /// verifies that the @c fetch_mode has been correctly set to
+    /// @c FetchMode::FETCH_UPDATE.
+    ///
+    /// It also throws an exception when desired by a test, to
+    /// verify that the server gracefully handles such exception.
     ///
     /// @param fetch_mode value indicating if the method is called upon the
     /// server start up or it is called to fetch configuration updates.
index 3e009bb67f22786666f7e01749ee458c5e31096d..c76c82af9833a0b3b17c7dac0b1b0ab12f00e239 100644 (file)
@@ -994,9 +994,7 @@ void
 ControlledDhcpv6Srv::cbFetchUpdates(const SrvConfigPtr& srv_cfg,
                                     boost::shared_ptr<unsigned> failure_count) {
     try {
-        // The true value indicates that the server should not reconnect
-        // to the configuration backends and should take into account
-        // audit entries stored in the database since last fetch.
+        // Fetch any configuration backend updates since our last fetch.
         server_->getCBControl()->databaseConfigFetch(srv_cfg,
                                                      CBControlDHCPv6::FetchMode::FETCH_UPDATE);
         (*failure_count) = 0;
index 387581818444be5e6a7a2a43ab482d87874dd049..fe995168fec1738e7a49baff0f19d50c6e8e311c 100644 (file)
@@ -162,7 +162,7 @@ public:
 
 // This test verifies that externally configured globals are
 // merged correctly into staging configuration.
-TEST_F(Dhcp6CBTest, mergeGlobals) {
+TEST_F(Dhcp6CBTest, DISABLED_mergeGlobals) {
     string base_config =
         "{ \n"
         "    \"interfaces-config\": { \n"
@@ -230,10 +230,9 @@ TEST_F(Dhcp6CBTest, mergeGlobals) {
     ASSERT_NO_FATAL_FAILURE(checkConfiguredGlobal(staging_cfg, renew_timer));
 }
 
-#if 0
 // This test verifies that externally configured option definitions
 // merged correctly into staging configuration.
-TEST_F(Dhcp6CBTest, mergeOptionDefs) {
+TEST_F(Dhcp6CBTest, DISABLED_mergeOptionDefs) {
     string base_config =
         "{ \n"
         "    \"option-def\": [ { \n"
@@ -309,7 +308,7 @@ TEST_F(Dhcp6CBTest, mergeOptionDefs) {
 
 // This test verifies that externally configured options
 // merged correctly into staging configuration.
-TEST_F(Dhcp6CBTest, mergeOptions) {
+TEST_F(Dhcp6CBTest, DISABLED_mergeOptions) {
     string base_config =
         "{ \n"
         "    \"option-data\": [ { \n"
@@ -387,7 +386,7 @@ TEST_F(Dhcp6CBTest, mergeOptions) {
 
 // This test verifies that externally configured shared-networks are
 // merged correctly into staging configuration.
-TEST_F(Dhcp6CBTest, mergeSharedNetworks) {
+TEST_F(Dhcp6CBTest, DISABLED_mergeSharedNetworks) {
     string base_config =
         "{ \n"
         "    \"interfaces-config\": { \n"
@@ -447,7 +446,7 @@ TEST_F(Dhcp6CBTest, mergeSharedNetworks) {
 
 // This test verifies that externally configured subnets are
 // merged correctly into staging configuration.
-TEST_F(Dhcp6CBTest, mergeSubnets) {
+TEST_F(Dhcp6CBTest, DISABLED_mergeSubnets) {
     string base_config =
         "{ \n"
         "    \"interfaces-config\": { \n"
@@ -505,6 +504,5 @@ TEST_F(Dhcp6CBTest, mergeSubnets) {
     staged_subnet = subnets->getSubnet(3);
     ASSERT_FALSE(staged_subnet);
 }
-#endif
 
 }
index d13c1ea03a45f61bbba00bf2ed3aea97ebbb8169..fb58c802a10cb69bff2567f597bebc83092ec95b 100644 (file)
@@ -74,10 +74,12 @@ public:
 
     /// @brief Stub implementation of the "fetch" function.
     ///
-    /// It checks if the @c fetch_updates_only is set to true when it
-    /// is a later than first invocation of the function. It also
-    /// throws an exception when desired by a test, to verify that the
-    /// server gracefully handles such exception.
+    /// If this is not the first invocation of this function, it
+    /// verifies that the @c fetch_mode has been correctly set to
+    /// @c FetchMode::FETCH_UPDATE.
+    ///
+    /// It also throws an exception when desired by a test, to
+    /// verify that the server gracefully handles such exception.
     ///
     /// @param fetch_mode value indicating if the method is called upon the
     /// server start up or it is called to fetch configuration updates.
index ab5b8003339ab0dcace1a5fe5c96ca5c0c57dad6..39a13ec4d16def7ff6f57aac0844181992fb9108 100644 (file)
@@ -287,6 +287,7 @@ libkea_dhcpsrv_include_HEADERS = \
        callout_handle_store.h \
        cb_ctl_dhcp.h \
        cb_ctl_dhcp4.h \
+       cb_ctl_dhcp6.h \
        cfg_4o6.h \
        cfg_consistency.h \
        cfg_db_access.h \