]> git.ipfire.org Git - thirdparty/kea.git/commitdiff
[#110,!156] Compilation fix. 156-libprocess-dependency-fix
authorTomek Mrugalski <tomasz@isc.org>
Mon, 5 Nov 2018 04:52:48 +0000 (11:52 +0700)
committerTomek Mrugalski <tomasz@isc.org>
Mon, 5 Nov 2018 04:52:48 +0000 (11:52 +0700)
src/bin/dhcp4/json_config_parser.cc
src/bin/dhcp4/tests/config_parser_unittest.cc
src/bin/dhcp6/json_config_parser.cc
src/bin/dhcp6/tests/config_parser_unittest.cc
src/lib/dhcpsrv/srv_config.cc
src/lib/dhcpsrv/tests/srv_config_unittest.cc
src/lib/process/tests/config_base_unittests.cc

index 2b8ad3cdbfff9e207368f2570e4fe02b3d6a26b3..19b9be39644e07ab13c178cf4e5a18ad9fda583d 100644 (file)
@@ -29,7 +29,7 @@
 #include <dhcpsrv/parsers/sanity_checks_parser.h>
 #include <dhcpsrv/host_data_source_factory.h>
 #include <dhcpsrv/timer_mgr.h>
-#include <process/config_ctl_parser.h>
+#include <database/config_ctl_parser.h>
 #include <hooks/hooks_parser.h>
 #include <config/command_mgr.h>
 #include <util/encode/hex.h>
@@ -53,6 +53,7 @@ using namespace isc::asiolink;
 using namespace isc::hooks;
 using namespace isc::process;
 using namespace isc::config;
+using namespace isc::db;
 
 namespace {
 
index fbb8599e21c2f1da9ddbad59e45cdad51bb83253..4d5f603740a6c68cd844522a19a4df924e7915f5 100644 (file)
@@ -26,7 +26,7 @@
 #include <dhcpsrv/cfg_subnets4.h>
 #include <dhcpsrv/testutils/config_result_check.h>
 #include <dhcpsrv/testutils/test_config_backend_dhcp4.h>
-#include <process/config_ctl_info.h>
+#include <database/config_ctl_info.h>
 #include <hooks/hooks_manager.h>
 
 #include "marker_file.h"
@@ -50,6 +50,7 @@ using namespace isc::data;
 using namespace isc::dhcp;
 using namespace isc::dhcp::test;
 using namespace isc::hooks;
+using namespace isc::db;
 using namespace std;
 
 namespace {
index c0a5aab29c2ad7a8b2e9aacafa503b889cf5a798..5336547de60ab67cff4ebf7ca0a3708f08898b2a 100644 (file)
@@ -37,7 +37,7 @@
 #include <dhcpsrv/host_data_source_factory.h>
 #include <hooks/hooks_parser.h>
 #include <log/logger_support.h>
-#include <process/config_ctl_parser.h>
+#include <database/config_ctl_parser.h>
 #include <util/encode/hex.h>
 #include <util/strutil.h>
 
@@ -61,6 +61,7 @@ using namespace isc::data;
 using namespace isc::dhcp;
 using namespace isc::asiolink;
 using namespace isc::hooks;
+using namespace isc::db;
 
 namespace {
 
@@ -612,8 +613,8 @@ configureDhcp6Server(Dhcpv6Srv& server, isc::data::ConstElementPtr config_set,
             }
 
             if (config_pair.first == "config-control") {
-                process::ConfigControlParser parser;
-                process::ConfigControlInfoPtr config_ctl_info = parser.parse(config_pair.second);
+                db::ConfigControlParser parser;
+                db::ConfigControlInfoPtr config_ctl_info = parser.parse(config_pair.second);
                 CfgMgr::instance().getStagingCfg()->setConfigControlInfo(config_ctl_info);
                 continue;
             }
index eab081dcf22a6eaab837ca828ba8e4db926eecb4..131cf7e7b7786581e11f3c048d7a76f7c440f37b 100644 (file)
@@ -25,7 +25,7 @@
 #include <dhcpsrv/subnet_selector.h>
 #include <dhcpsrv/testutils/config_result_check.h>
 #include <hooks/hooks_manager.h>
-#include <process/config_ctl_info.h>
+#include <database/config_ctl_info.h>
 
 #include "test_data_files_config.h"
 #include "test_libraries.h"
@@ -53,6 +53,7 @@ using namespace isc::data;
 using namespace isc::dhcp;
 using namespace isc::dhcp::test;
 using namespace isc::hooks;
+using namespace isc::db;
 using namespace std;
 
 namespace {
@@ -6870,12 +6871,12 @@ TEST_F(Dhcp6ParserTest, configControlInfo) {
     configure(config, CONTROL_RESULT_SUCCESS, "");
 
     // Make sure the config control info is there.
-    process::ConstConfigControlInfoPtr info =
+    db::ConstConfigControlInfoPtr info =
         CfgMgr::instance().getStagingCfg()->getConfigControlInfo();
     ASSERT_TRUE(info);
 
     // Fetch the list of config dbs.  It should have two entries.
-    const process::ConfigDbInfoList& dblist = info->getConfigDatabases();
+    const db::ConfigDbInfoList& dblist = info->getConfigDatabases();
     ASSERT_EQ(2, dblist.size());
 
     // Make sure the entries are what we expect and in the right order.
index ca4369709a1e0e44b0f4ab80e62123dc59dac215..c923d14c3b1030b8be7b3a076b81ad3435966bcb 100644 (file)
@@ -19,6 +19,7 @@
 using namespace isc::log;
 using namespace isc::data;
 using namespace isc::process;
+using namespace isc::db;
 
 namespace isc {
 namespace dhcp {
index 1b7f56f90f0eb1db33c6c44a48802687c79e61ce..b78f5796ae83a89e5f7dc1df072c8d7fd5345c17 100644 (file)
@@ -18,6 +18,7 @@ using namespace isc::asiolink;
 using namespace isc::dhcp;
 using namespace isc::data;
 using namespace isc::process;
+using namespace isc::db;
 
 // Those are the tests for SrvConfig storage. Right now they are minimal,
 // but the number is expected to grow significantly once we migrate more
@@ -974,4 +975,38 @@ TEST_F(SrvConfigTest, unparseConfigControlInfo6) {
     EXPECT_TRUE(info_elem->equals(*check));
 }
 
+
+// Verifies construction, copy, and equality of
+// ConfigBase with respect to ConfigControInfo.
+TEST_F(SrvConfigTest, configControlInfoTests) {
+
+    // Create a control info instance
+    ConfigControlInfoPtr ctl_info1(new ConfigControlInfo());
+    ctl_info1->addConfigDatabase("type=mysql host=example.com");
+    ctl_info1->addConfigDatabase("type=mysql host=example2.com");
+
+    // Create a ConfigBase
+    SrvConfig base1;
+    base1.setConfigControlInfo(ctl_info1);
+
+    // Clone the ConfigBase
+    SrvConfig base2;
+    base1.copy(base2);
+
+    // They should be equal.
+    EXPECT_TRUE(base1.equals(base2));
+
+    // Reset control info for one of them.
+    base1.setConfigControlInfo(ConfigControlInfoPtr());
+
+    // They should not be equal.
+    EXPECT_FALSE(base1.equals(base2));
+
+    // Reset control info for the other one.
+    base2.setConfigControlInfo(ConfigControlInfoPtr());
+
+    // They should be equal again.
+    EXPECT_TRUE(base1.equals(base2));
+}
+
 } // end of anonymous namespace
index 0b45bd03cc149bbbe254830789cb383ce348f6fa..046182e58038d0a01b99e7c9d99e38d77782cb7d 100644 (file)
@@ -30,30 +30,20 @@ public:
 TEST(ConfigBase, configControlInfoTests) {
 
     // Create a control info instance
-    ConfigControlInfoPtr ctl_info1(new ConfigControlInfo());
-    ctl_info1->addConfigDatabase("type=mysql host=example.com");
-    ctl_info1->addConfigDatabase("type=mysql host=example2.com");
+    LoggingInfo log_info;
 
     // Create a ConfigBase
     ConfigBaseImpl base1;
-    base1.setConfigControlInfo(ctl_info1);
 
     // Clone the ConfigBase
     ConfigBaseImpl base2;
-    base1.copy(base2);
 
     // They should be equal.
     EXPECT_TRUE(base1.equals(base2));
 
     // Reset control info for one of them.
-    base1.setConfigControlInfo(ConfigControlInfoPtr());
+    base1.addLoggingInfo(log_info);
 
-    // They should not be equal.
+    // They should not be equal anymore.
     EXPECT_FALSE(base1.equals(base2));
-
-    // Reset control info for the other one.
-    base2.setConfigControlInfo(ConfigControlInfoPtr());
-
-    // They should be equal again.
-    EXPECT_TRUE(base1.equals(base2));
 }