From: Thomas Markwalder Date: Wed, 27 Mar 2019 14:12:14 +0000 (-0400) Subject: [#104,!290] Addressed review comments X-Git-Tag: Kea-1.6.0-beta~309^2 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=04ccb188cef0f02048f5d49afdf780442790ebbd;p=thirdparty%2Fkea.git [#104,!290] Addressed review comments --- diff --git a/src/bin/dhcp4/ctrl_dhcp4_srv.cc b/src/bin/dhcp4/ctrl_dhcp4_srv.cc index 3aa2e2d14c..0595c1ad01 100644 --- a/src/bin/dhcp4/ctrl_dhcp4_srv.cc +++ b/src/bin/dhcp4/ctrl_dhcp4_srv.cc @@ -972,9 +972,7 @@ void ControlledDhcpv4Srv::cbFetchUpdates(const SrvConfigPtr& srv_cfg, boost::shared_ptr 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; diff --git a/src/bin/dhcp4/tests/kea_controller_unittest.cc b/src/bin/dhcp4/tests/kea_controller_unittest.cc index 51360cc67b..0c069cc4dd 100644 --- a/src/bin/dhcp4/tests/kea_controller_unittest.cc +++ b/src/bin/dhcp4/tests/kea_controller_unittest.cc @@ -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. diff --git a/src/bin/dhcp6/ctrl_dhcp6_srv.cc b/src/bin/dhcp6/ctrl_dhcp6_srv.cc index 3e009bb67f..c76c82af98 100644 --- a/src/bin/dhcp6/ctrl_dhcp6_srv.cc +++ b/src/bin/dhcp6/ctrl_dhcp6_srv.cc @@ -994,9 +994,7 @@ void ControlledDhcpv6Srv::cbFetchUpdates(const SrvConfigPtr& srv_cfg, boost::shared_ptr 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; diff --git a/src/bin/dhcp6/tests/config_backend_unittest.cc b/src/bin/dhcp6/tests/config_backend_unittest.cc index 3875818184..fe995168fe 100644 --- a/src/bin/dhcp6/tests/config_backend_unittest.cc +++ b/src/bin/dhcp6/tests/config_backend_unittest.cc @@ -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 } diff --git a/src/bin/dhcp6/tests/kea_controller_unittest.cc b/src/bin/dhcp6/tests/kea_controller_unittest.cc index d13c1ea03a..fb58c802a1 100644 --- a/src/bin/dhcp6/tests/kea_controller_unittest.cc +++ b/src/bin/dhcp6/tests/kea_controller_unittest.cc @@ -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. diff --git a/src/lib/dhcpsrv/Makefile.am b/src/lib/dhcpsrv/Makefile.am index ab5b800333..39a13ec4d1 100644 --- a/src/lib/dhcpsrv/Makefile.am +++ b/src/lib/dhcpsrv/Makefile.am @@ -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 \