]> git.ipfire.org Git - thirdparty/kea.git/commitdiff
[#3536] remove HAVE_MYSQL and HAVE_PGSQL
authorRazvan Becheriu <razvan@isc.org>
Mon, 16 Sep 2024 21:10:10 +0000 (00:10 +0300)
committerRazvan Becheriu <razvan@isc.org>
Thu, 3 Oct 2024 18:04:36 +0000 (21:04 +0300)
30 files changed:
src/bin/d2/tests/Makefile.am
src/bin/dhcp4/Makefile.am
src/bin/dhcp4/dhcp4_srv.cc
src/bin/dhcp4/json_config_parser.cc
src/bin/dhcp4/tests/Makefile.am
src/bin/dhcp4/tests/decline_unittest.cc
src/bin/dhcp4/tests/dora_unittest.cc
src/bin/dhcp4/tests/kea_controller_unittest.cc
src/bin/dhcp6/Makefile.am
src/bin/dhcp6/dhcp6_srv.cc
src/bin/dhcp6/json_config_parser.cc
src/bin/dhcp6/tests/Makefile.am
src/bin/dhcp6/tests/decline_unittest.cc
src/bin/dhcp6/tests/kea_controller_unittest.cc
src/bin/lfc/Makefile.am
src/bin/lfc/tests/Makefile.am
src/hooks/dhcp/mysql_hb/mysql_host_data_source.cc
src/hooks/dhcp/mysql_hb/mysql_host_data_source.h
src/hooks/dhcp/mysql_lb/mysql_lease_mgr.cc
src/hooks/dhcp/mysql_lb/mysql_lease_mgr.h
src/hooks/dhcp/pgsql_hb/pgsql_host_data_source.cc
src/hooks/dhcp/pgsql_hb/pgsql_host_data_source.h
src/hooks/dhcp/pgsql_lb/pgsql_lease_mgr.cc
src/hooks/dhcp/pgsql_lb/pgsql_lease_mgr.h
src/hooks/dhcp/stat_cmds/tests/Makefile.am
src/lib/dhcpsrv/Makefile.am
src/lib/dhcpsrv/tests/Makefile.am
src/lib/dhcpsrv/tests/alloc_engine4_unittest.cc
src/lib/dhcpsrv/tests/cfg_db_access_unittest.cc
src/lib/dhcpsrv/testutils/Makefile.am

index 544000a2a9ead1764166046ce30bdf09bb51ee79..c341e90300506e2a2acda375b3ff66f4860205ef 100644 (file)
@@ -60,12 +60,7 @@ d2_unittests_SOURCES += check_exists_remove_unittests.cc
 
 d2_unittests_CPPFLAGS = $(AM_CPPFLAGS) $(GTEST_INCLUDES)
 d2_unittests_LDFLAGS = $(AM_LDFLAGS) $(CRYPTO_LDFLAGS)
-if HAVE_MYSQL
-d2_unittests_LDFLAGS += $(MYSQL_LIBS)
-endif
-if HAVE_PGSQL
-d2_unittests_LDFLAGS += $(PGSQL_LIBS)
-endif
+
 d2_unittests_LDFLAGS += $(GTEST_LDFLAGS)
 
 d2_unittests_LDADD  = $(top_builddir)/src/bin/d2/libd2.la
index 67436d6c72d4a31fac3c9ae078ba87b1bbb5f124..c496c1f6666a037935504db308677ea4166c1acd 100644 (file)
@@ -4,12 +4,6 @@ AM_CPPFLAGS = -I$(top_srcdir)/src/lib -I$(top_builddir)/src/lib
 AM_CPPFLAGS += -I$(top_srcdir)/src/bin -I$(top_builddir)/src/bin
 AM_CPPFLAGS += -I$(top_srcdir)/src -I$(top_builddir)/src
 AM_CPPFLAGS += $(BOOST_INCLUDES) $(CRYPTO_CFLAGS) $(CRYPTO_INCLUDES)
-if HAVE_MYSQL
-AM_CPPFLAGS += $(MYSQL_CPPFLAGS)
-endif
-if HAVE_PGSQL
-AM_CPPFLAGS += $(PGSQL_CPPFLAGS)
-endif
 
 AM_CXXFLAGS = $(KEA_CXXFLAGS)
 
@@ -44,19 +38,6 @@ sbin_PROGRAMS = kea-dhcp4
 kea_dhcp4_SOURCES  = main.cc
 
 kea_dhcp4_LDADD  = libdhcp4.la
-
-# to be removed
-if HAVE_PGSQL
-kea_dhcp4_LDADD += $(top_builddir)/src/hooks/dhcp/pgsql_lb/libpgsqllb.la
-kea_dhcp4_LDADD += $(top_builddir)/src/hooks/dhcp/pgsql_hb/libpgsqlhb.la
-endif
-
-# to be removed
-if HAVE_MYSQL
-kea_dhcp4_LDADD += $(top_builddir)/src/hooks/dhcp/mysql_lb/libmysqllb.la
-kea_dhcp4_LDADD += $(top_builddir)/src/hooks/dhcp/mysql_hb/libmysqlhb.la
-endif
-
 kea_dhcp4_LDADD += $(top_builddir)/src/lib/dhcpsrv/libkea-dhcpsrv.la
 kea_dhcp4_LDADD += $(top_builddir)/src/lib/process/libkea-process.la
 kea_dhcp4_LDADD += $(top_builddir)/src/lib/eval/libkea-eval.la
@@ -66,17 +47,6 @@ kea_dhcp4_LDADD += $(top_builddir)/src/lib/config/libkea-cfgclient.la
 kea_dhcp4_LDADD += $(top_builddir)/src/lib/http/libkea-http.la
 kea_dhcp4_LDADD += $(top_builddir)/src/lib/dhcp/libkea-dhcp++.la
 kea_dhcp4_LDADD += $(top_builddir)/src/lib/hooks/libkea-hooks.la
-
-# to be removed
-if HAVE_PGSQL
-kea_dhcp4_LDADD += $(top_builddir)/src/lib/pgsql/libkea-pgsql.la
-endif
-
-# to be removed
-if HAVE_MYSQL
-kea_dhcp4_LDADD += $(top_builddir)/src/lib/mysql/libkea-mysql.la
-endif
-
 kea_dhcp4_LDADD += $(top_builddir)/src/lib/database/libkea-database.la
 kea_dhcp4_LDADD += $(top_builddir)/src/lib/cc/libkea-cc.la
 kea_dhcp4_LDADD += $(top_builddir)/src/lib/asiolink/libkea-asiolink.la
@@ -87,20 +57,7 @@ kea_dhcp4_LDADD += $(top_builddir)/src/lib/util/libkea-util.la
 kea_dhcp4_LDADD += $(top_builddir)/src/lib/exceptions/libkea-exceptions.la
 kea_dhcp4_LDADD += $(LOG4CPLUS_LIBS) $(CRYPTO_LIBS) $(BOOST_LIBS)
 
-if HAVE_MYSQL
-kea_dhcp4_LDADD += $(MYSQL_LIBS)
-endif
-if HAVE_PGSQL
-kea_dhcp4_LDADD += $(PGSQL_LIBS)
-endif
-
 kea_dhcp4_LDFLAGS = $(AM_LDFLAGS) $(CRYPTO_LDFLAGS)
-if HAVE_MYSQL
-kea_dhcp4_LDFLAGS += $(MYSQL_LIBS)
-endif
-if HAVE_PGSQL
-kea_dhcp4_LDFLAGS += $(PGSQL_LIBS)
-endif
 
 kea_dhcp4dir = $(pkgdatadir)
 
index 7c941627ea240bbcb93895f295b1cbee087a8906..75913eeb5583bb20f09061d65c9a066f1e42c5a5 100644 (file)
 #include <log/logger.h>
 #include <cryptolink/cryptolink.h>
 #include <process/cfgrpt/config_report.h>
-#include <dhcpsrv/memfile_lease_mgr.h>
-
-#ifdef HAVE_MYSQL
-#include <hooks/dhcp/mysql_lb/mysql_lease_mgr.h>
-#endif
-#ifdef HAVE_PGSQL
-#include <hooks/dhcp/pgsql_lb/pgsql_lease_mgr.h>
-#endif
 
 #include <boost/algorithm/string.hpp>
 #include <boost/foreach.hpp>
@@ -5025,6 +5017,8 @@ Dhcpv4Srv::getVersion(bool extended) {
         tmp << "- " << Logger::getVersion() << endl;
         tmp << "- " << CryptoLink::getVersion() << endl;
         tmp << "backends:" << endl;
+        /*
+TODO - implement LeaseMgrFactory::getDBVersions
 #ifdef HAVE_MYSQL
         tmp << "- " << MySqlLeaseMgr::getDBVersion() << endl;
 #endif
@@ -5034,6 +5028,7 @@ Dhcpv4Srv::getVersion(bool extended) {
         tmp << "- " << Memfile_LeaseMgr::getDBVersion(Memfile_LeaseMgr::V4);
 
         // @todo: more details about database runtime
+*/
     }
 
     return (tmp.str());
index 6c190e32324c6e0306eacda73f8959a5d62b0066..89e50edea1cfd6291662fed82280b834e81ec64d 100644 (file)
 #include <process/config_ctl_parser.h>
 #include <util/encode/encode.h>
 #include <util/multi_threading_mgr.h>
-
-#ifdef HAVE_MYSQL
-#include <hooks/dhcp/mysql_lb/mysql_lease_mgr.h>
-#include <hooks/dhcp/mysql_hb/mysql_host_data_source.h>
-#endif
-
-#ifdef HAVE_PGSQL
-#include <hooks/dhcp/pgsql_lb/pgsql_lease_mgr.h>
-#include <hooks/dhcp/pgsql_hb/pgsql_host_data_source.h>
-#endif
-
 #include <boost/algorithm/string.hpp>
 #include <boost/lexical_cast.hpp>
 
@@ -84,20 +73,6 @@ using namespace std;
 //
 namespace {
 
-// Code will be moved to appropriate hook library.
-#ifdef HAVE_MYSQL
-// Database backend will be registered at object initialization
-MySqlLeaseMgrInit mysql_init_lease;
-MySqlHostDataSourceInit mysql_init_host;
-#endif
-
-// Code will be moved to appropriate hook library.
-#ifdef HAVE_PGSQL
-// Database backend will be registered at object initialization
-PgSqlLeaseMgrInit pgsql_init_lease;
-PgSqlHostDataSourceInit pgsql_init_host;
-#endif
-
 /// @brief Parser that takes care of global DHCPv4 parameters and utility
 ///        functions that work on global level.
 ///
index 952b26b9132e8ad559b5d4f74cac7a37ff3d988e..f826f8e1e5df872eca02d25d2151a11ca27c6b6e 100644 (file)
@@ -27,6 +27,13 @@ AM_CPPFLAGS += -DSYNTAX_FILE=\"$(abs_srcdir)/../dhcp4_parser.yy\"
 AM_CPPFLAGS += -DKEA_LFC_EXECUTABLE=\"$(abs_top_builddir)/src/bin/lfc/kea-lfc\"
 AM_CPPFLAGS += -DTEST_CA_DIR=\"$(abs_top_srcdir)/src/lib/asiolink/testutils/ca\"
 
+if HAVE_MYSQL
+AM_CPPFLAGS += $(MYSQL_CPPFLAGS)
+endif
+if HAVE_PGSQL
+AM_CPPFLAGS += $(PGSQL_CPPFLAGS)
+endif
+
 AM_CXXFLAGS = $(KEA_CXXFLAGS)
 
 if USE_STATIC_LINK
@@ -114,6 +121,7 @@ dhcp4_unittests_SOURCES += vendor_opts_unittest.cc
 nodist_dhcp4_unittests_SOURCES = marker_file.h test_libraries.h
 
 dhcp4_unittests_CPPFLAGS = $(AM_CPPFLAGS) $(GTEST_INCLUDES)
+
 dhcp4_unittests_LDFLAGS = $(AM_LDFLAGS) $(CRYPTO_LDFLAGS)
 if HAVE_MYSQL
 dhcp4_unittests_LDFLAGS += $(MYSQL_LIBS)
index 325184fa3b6441f010c3f13da60a3348b491f4c4..b21779635493dcf2963d470515474a0fc0f8d7d5 100644 (file)
@@ -8,10 +8,22 @@
 #include <config.h>
 #include <asiolink/io_address.h>
 #include <cc/data.h>
+#include <database/database_connection.h>
 #include <dhcp/dhcp4.h>
 #include <dhcp/testutils/iface_mgr_test_config.h>
 #include <dhcpsrv/cfgmgr.h>
 #include <dhcpsrv/subnet_id.h>
+
+#ifdef HAVE_MYSQL
+#include <mysql/testutils/mysql_schema.h>
+#include <hooks/dhcp/mysql_lb/mysql_lease_mgr.h>
+#endif
+
+#ifdef HAVE_PGSQL
+#include <pgsql/testutils/pgsql_schema.h>
+#include <hooks/dhcp/pgsql_lb/pgsql_lease_mgr.h>
+#endif
+
 #include <dhcp4/tests/dhcp4_test_utils.h>
 #include <dhcp4/tests/dhcp4_client.h>
 #include <stats/stats_mgr.h>
@@ -21,6 +33,7 @@
 using namespace isc;
 using namespace isc::asiolink;
 using namespace isc::data;
+using namespace isc::db;
 using namespace isc::dhcp;
 using namespace isc::dhcp::test;
 using namespace isc::stats;
@@ -257,6 +270,7 @@ TEST_F(DeclineTest, declineNoIdentifierChangeMemfile) {
 #ifdef HAVE_MYSQL
 // This test checks that the client can acquire and decline the lease.
 TEST_F(DeclineTest, declineNoIdentifierChangeMySQL) {
+    Initializer<MySqlLeaseMgrInit> init;
     Dhcp4Client client(Dhcp4Client::SELECTING);
     acquireAndDecline(client, "01:02:03:04:05:06", "12:14",
                       "01:02:03:04:05:06", "12:14",
@@ -267,6 +281,7 @@ TEST_F(DeclineTest, declineNoIdentifierChangeMySQL) {
 #ifdef HAVE_PGSQL
 // This test checks that the client can acquire and decline the lease.
 TEST_F(DeclineTest, declineNoIdentifierChangePgSQL) {
+    Initializer<PgSqlLeaseMgrInit> init;
     Dhcp4Client client(Dhcp4Client::SELECTING);
     acquireAndDecline(client, "01:02:03:04:05:06", "12:14",
                       "01:02:03:04:05:06", "12:14",
index d2be81dfeae0b2324487adb55e793a6a3b62819a..de57629bddb774b758624e6ef3c11df0c8d3f812 100644 (file)
@@ -7,6 +7,7 @@
 #include <config.h>
 #include <asiolink/io_address.h>
 #include <cc/data.h>
+#include <database/database_connection.h>
 #include <dhcp/dhcp4.h>
 #include <dhcp/testutils/iface_mgr_test_config.h>
 #include <dhcpsrv/cfgmgr.h>
 
 #ifdef HAVE_MYSQL
 #include <mysql/testutils/mysql_schema.h>
+#include <hooks/dhcp/mysql_lb/mysql_lease_mgr.h>
 #endif
 
 #ifdef HAVE_PGSQL
 #include <pgsql/testutils/pgsql_schema.h>
+#include <hooks/dhcp/pgsql_lb/pgsql_lease_mgr.h>
 #endif
 
 #include <dhcp4/tests/dhcp4_test_utils.h>
@@ -34,6 +37,7 @@
 using namespace isc;
 using namespace isc::asiolink;
 using namespace isc::data;
+using namespace isc::db;
 using namespace isc::dhcp;
 using namespace isc::dhcp::test;
 using namespace isc::stats;
@@ -3342,6 +3346,9 @@ public:
         // If data wipe enabled, delete transient data otherwise destroy the schema.
         db::test::destroyMySQLSchema();
     }
+
+    /// @brief Initializer.
+    Initializer<MySqlLeaseMgrInit> init_;
 };
 
 // Test that the client using the same hardware address but multiple
@@ -3385,6 +3392,9 @@ public:
         // If data wipe enabled, delete transient data otherwise destroy the schema
         db::test::destroyPgSQLSchema();
     }
+
+    /// @brief Initializer.
+    Initializer<PgSqlLeaseMgrInit> init_;
 };
 
 // Test that the client using the same hardware address but multiple
index e47c3ae14be8f02047a61f91aaa1392713912319..d2af15e91faa77ce318b656991dbf997190c6af4 100644 (file)
@@ -10,6 +10,7 @@
 #include <asiolink/io_address.h>
 #include <asiolink/io_service.h>
 #include <cc/command_interpreter.h>
+#include <database/database_connection.h>
 #include <dhcp/dhcp4.h>
 #include <dhcp/hwaddr.h>
 #include <dhcp/iface_mgr.h>
@@ -24,6 +25,7 @@
 
 #ifdef HAVE_MYSQL
 #include <mysql/testutils/mysql_schema.h>
+#include <hooks/dhcp/mysql_lb/mysql_lease_mgr.h>
 #endif
 
 #include <log/logger_support.h>
@@ -47,6 +49,7 @@ using namespace isc;
 using namespace isc::asiolink;
 using namespace isc::config;
 using namespace isc::data;
+using namespace isc::db;
 
 #ifdef HAVE_MYSQL
 using namespace isc::db::test;
@@ -1000,6 +1003,9 @@ public:
     /// reconfiguration.
     void testBackendReconfiguration(const std::string& backend_first,
                                     const std::string& backend_second);
+
+    /// @brief Initializer.
+    Initializer<MySqlLeaseMgrInit> init_;
 };
 
 std::string
index 84f91be3bf2f305b982f5dccc089165c83b3ffd7..4ec3e18db94c1dc519d0b2157874980883800614 100644 (file)
@@ -4,12 +4,6 @@ AM_CPPFLAGS = -I$(top_srcdir)/src/lib -I$(top_builddir)/src/lib
 AM_CPPFLAGS += -I$(top_srcdir)/src/bin -I$(top_builddir)/src/bin
 AM_CPPFLAGS += -I$(top_srcdir)/src -I$(top_builddir)/src
 AM_CPPFLAGS += $(BOOST_INCLUDES) $(CRYPTO_CFLAGS) $(CRYPTO_INCLUDES)
-if HAVE_MYSQL
-AM_CPPFLAGS += $(MYSQL_CPPFLAGS)
-endif
-if HAVE_PGSQL
-AM_CPPFLAGS += $(PGSQL_CPPFLAGS)
-endif
 
 AM_CXXFLAGS = $(KEA_CXXFLAGS)
 
@@ -44,19 +38,6 @@ sbin_PROGRAMS = kea-dhcp6
 kea_dhcp6_SOURCES  = main.cc
 
 kea_dhcp6_LDADD  = libdhcp6.la
-
-# to be removed
-if HAVE_PGSQL
-kea_dhcp6_LDADD += $(top_builddir)/src/hooks/dhcp/pgsql_lb/libpgsqllb.la
-kea_dhcp6_LDADD += $(top_builddir)/src/hooks/dhcp/pgsql_hb/libpgsqlhb.la
-endif
-
-# to be removed
-if HAVE_MYSQL
-kea_dhcp6_LDADD += $(top_builddir)/src/hooks/dhcp/mysql_lb/libmysqllb.la
-kea_dhcp6_LDADD += $(top_builddir)/src/hooks/dhcp/mysql_hb/libmysqlhb.la
-endif
-
 kea_dhcp6_LDADD += $(top_builddir)/src/lib/dhcpsrv/libkea-dhcpsrv.la
 kea_dhcp6_LDADD += $(top_builddir)/src/lib/process/libkea-process.la
 kea_dhcp6_LDADD += $(top_builddir)/src/lib/eval/libkea-eval.la
@@ -66,17 +47,6 @@ kea_dhcp6_LDADD += $(top_builddir)/src/lib/config/libkea-cfgclient.la
 kea_dhcp6_LDADD += $(top_builddir)/src/lib/http/libkea-http.la
 kea_dhcp6_LDADD += $(top_builddir)/src/lib/dhcp/libkea-dhcp++.la
 kea_dhcp6_LDADD += $(top_builddir)/src/lib/hooks/libkea-hooks.la
-
-# to be removed
-if HAVE_PGSQL
-kea_dhcp6_LDADD += $(top_builddir)/src/lib/pgsql/libkea-pgsql.la
-endif
-
-# to be removed
-if HAVE_MYSQL
-kea_dhcp6_LDADD += $(top_builddir)/src/lib/mysql/libkea-mysql.la
-endif
-
 kea_dhcp6_LDADD += $(top_builddir)/src/lib/database/libkea-database.la
 kea_dhcp6_LDADD += $(top_builddir)/src/lib/cc/libkea-cc.la
 kea_dhcp6_LDADD += $(top_builddir)/src/lib/asiolink/libkea-asiolink.la
@@ -87,20 +57,7 @@ kea_dhcp6_LDADD += $(top_builddir)/src/lib/util/libkea-util.la
 kea_dhcp6_LDADD += $(top_builddir)/src/lib/exceptions/libkea-exceptions.la
 kea_dhcp6_LDADD += $(LOG4CPLUS_LIBS) $(CRYPTO_LIBS) $(BOOST_LIBS)
 
-if HAVE_MYSQL
-kea_dhcp6_LDADD += $(MYSQL_LIBS)
-endif
-if HAVE_PGSQL
-kea_dhcp6_LDADD += $(PGSQL_LIBS)
-endif
-
 kea_dhcp6_LDFLAGS = $(AM_LDFLAGS) $(CRYPTO_LDFLAGS)
-if HAVE_MYSQL
-kea_dhcp6_LDFLAGS += $(MYSQL_LIBS)
-endif
-if HAVE_PGSQL
-kea_dhcp6_LDFLAGS += $(PGSQL_LIBS)
-endif
 
 kea_dhcp6dir = $(pkgdatadir)
 
index 24301ea45c6868550e3e7f3f202d4df1782ecc9d..6fe3f8eb2ea785a909bb44b77538d94636426e01 100644 (file)
 #include <log/logger.h>
 #include <cryptolink/cryptolink.h>
 #include <process/cfgrpt/config_report.h>
-#include <dhcpsrv/memfile_lease_mgr.h>
-
-#ifdef HAVE_MYSQL
-#include <hooks/dhcp/mysql_lb/mysql_lease_mgr.h>
-#endif
-#ifdef HAVE_PGSQL
-#include <hooks/dhcp/pgsql_lb/pgsql_lease_mgr.h>
-#endif
 
 #include <boost/tokenizer.hpp>
 #include <boost/foreach.hpp>
@@ -4702,6 +4694,8 @@ Dhcpv6Srv::getVersion(bool extended) {
         tmp << "- " << Logger::getVersion() << endl;
         tmp << "- " << CryptoLink::getVersion() << endl;
         tmp << "backends:" << endl;
+        /*
+TODO - implement LeaseMgrFactory::getDBVersions
 #ifdef HAVE_MYSQL
         tmp << "- " << MySqlLeaseMgr::getDBVersion() << endl;
 #endif
@@ -4711,6 +4705,7 @@ Dhcpv6Srv::getVersion(bool extended) {
         tmp << "- " << Memfile_LeaseMgr::getDBVersion(Memfile_LeaseMgr::V6);
 
         // @todo: more details about database runtime
+*/
     }
 
     return (tmp.str());
index 5355420501f412124a64d369f3b7be96ab123aac..ea132a12ac74b51a201d30f4999f2facfcd2ae83 100644 (file)
 #include <util/encode/encode.h>
 #include <util/multi_threading_mgr.h>
 #include <util/triplet.h>
-
-#ifdef HAVE_MYSQL
-#include <hooks/dhcp/mysql_lb/mysql_lease_mgr.h>
-#include <hooks/dhcp/mysql_hb/mysql_host_data_source.h>
-#endif
-
-#ifdef HAVE_PGSQL
-#include <hooks/dhcp/pgsql_lb/pgsql_lease_mgr.h>
-#include <hooks/dhcp/pgsql_hb/pgsql_host_data_source.h>
-#endif
-
 #include <boost/algorithm/string.hpp>
 #include <boost/lexical_cast.hpp>
 #include <boost/scoped_ptr.hpp>
@@ -91,20 +80,6 @@ using namespace std;
 //
 namespace {
 
-// Code will be moved to appropriate hook library.
-#ifdef HAVE_MYSQL
-// Database backend will be registered at object initialization
-MySqlLeaseMgrInit mysql_init_lease;
-MySqlHostDataSourceInit mysql_init_host;
-#endif
-
-// Code will be moved to appropriate hook library.
-#ifdef HAVE_PGSQL
-// Database backend will be registered at object initialization
-PgSqlLeaseMgrInit pgsql_init_lease;
-PgSqlHostDataSourceInit pgsql_init_host;
-#endif
-
 /// @brief Checks if specified directory exists.
 ///
 /// @param dir_path Path to a directory.
index a63a88fcfac33f30895527f4fff28913ceb8970b..38dae6c83a10b2a1d232fecd338153680cfad1b5 100644 (file)
@@ -27,6 +27,13 @@ AM_CPPFLAGS += -DSYNTAX_FILE=\"$(abs_srcdir)/../dhcp6_parser.yy\"
 AM_CPPFLAGS += -DKEA_LFC_EXECUTABLE=\"$(abs_top_builddir)/src/bin/lfc/kea-lfc\"
 AM_CPPFLAGS += -DTEST_CA_DIR=\"$(abs_top_srcdir)/src/lib/asiolink/testutils/ca\"
 
+if HAVE_MYSQL
+AM_CPPFLAGS += $(MYSQL_CPPFLAGS)
+endif
+if HAVE_PGSQL
+AM_CPPFLAGS += $(PGSQL_CPPFLAGS)
+endif
+
 AM_CXXFLAGS = $(KEA_CXXFLAGS)
 
 if USE_STATIC_LINK
@@ -114,6 +121,7 @@ dhcp6_unittests_SOURCES += vendor_opts_unittest.cc
 nodist_dhcp6_unittests_SOURCES  = marker_file.h test_libraries.h
 
 dhcp6_unittests_CPPFLAGS = $(AM_CPPFLAGS) $(GTEST_INCLUDES)
+
 dhcp6_unittests_LDFLAGS = $(AM_LDFLAGS) $(CRYPTO_LDFLAGS)
 if HAVE_MYSQL
 dhcp6_unittests_LDFLAGS += $(MYSQL_LIBS)
index e5c28ee0d3adb9bb95565886545ac70bf1b967a2..8eb8eb4601b58390e93abab7edae4577fd08af28 100644 (file)
@@ -7,15 +7,28 @@
 #include <config.h>
 #include <asiolink/io_address.h>
 #include <cc/data.h>
+#include <database/database_connection.h>
 #include <dhcp/testutils/iface_mgr_test_config.h>
 #include <dhcp6/json_config_parser.h>
 #include <dhcp6/tests/dhcp6_message_test.h>
 #include <dhcpsrv/lease.h>
+
+#ifdef HAVE_MYSQL
+#include <mysql/testutils/mysql_schema.h>
+#include <hooks/dhcp/mysql_lb/mysql_lease_mgr.h>
+#endif
+
+#ifdef HAVE_PGSQL
+#include <pgsql/testutils/pgsql_schema.h>
+#include <hooks/dhcp/pgsql_lb/pgsql_lease_mgr.h>
+#endif
+
 #include <stats/stats_mgr.h>
 
 using namespace isc;
 using namespace isc::asiolink;
 using namespace isc::data;
+using namespace isc::db;
 using namespace isc::dhcp;
 using namespace isc::dhcp::test;
 using namespace isc::stats;
@@ -254,6 +267,7 @@ TEST_F(DeclineTest, basicMemfile) {
 #ifdef HAVE_MYSQL
 // This test checks that the client can acquire and decline the lease.
 TEST_F(DeclineTest, basicMySQL) {
+    Initializer<MySqlLeaseMgrInit> init;
     Dhcp6Client client;
     acquireAndDecline(client, "01:02:03:04:05:06", 1234, "01:02:03:04:05:06",
                       1234, VALID_ADDR, SHOULD_PASS, 1);
@@ -262,6 +276,7 @@ TEST_F(DeclineTest, basicMySQL) {
 
 #ifdef HAVE_PGSQL
 TEST_F(DeclineTest, basicPgSQL) {
+    Initializer<PgSqlLeaseMgrInit> init;
     Dhcp6Client client;
     acquireAndDecline(client, "01:02:03:04:05:06", 1234, "01:02:03:04:05:06",
                       1234, VALID_ADDR, SHOULD_PASS, 2);
index 0c1482e82c841ca04dc9fc5dd710d726cb4d3259..47281a44568f43b545c7670ac441e85ee155321d 100644 (file)
@@ -8,6 +8,7 @@
 
 #include <asiolink/io_address.h>
 #include <cc/command_interpreter.h>
+#include <database/database_connection.h>
 #include <dhcp/dhcp6.h>
 #include <dhcp/duid.h>
 #include <dhcp/iface_mgr.h>
@@ -22,6 +23,7 @@
 
 #ifdef HAVE_MYSQL
 #include <mysql/testutils/mysql_schema.h>
+#include <hooks/dhcp/mysql_lb/mysql_lease_mgr.h>
 #endif
 
 #include <log/logger_support.h>
@@ -44,6 +46,7 @@ using namespace isc;
 using namespace isc::asiolink;
 using namespace isc::config;
 using namespace isc::data;
+using namespace isc::db;
 
 #ifdef HAVE_MYSQL
 using namespace isc::db::test;
@@ -986,6 +989,10 @@ public:
     /// reconfiguration.
     void testBackendReconfiguration(const std::string& backend_first,
                                     const std::string& backend_second);
+
+    /// @brief Initializer.
+    Initializer<MySqlLeaseMgrInit> init_;
+
 };
 
 std::string
index 7f3ae858bd6867c7dc05963df152cfb31c91673d..5f7e9687a113bbf4a380f807eaeeeeb8347d6606 100644 (file)
@@ -47,12 +47,6 @@ kea_lfc_LDADD += $(top_builddir)/src/lib/exceptions/libkea-exceptions.la
 kea_lfc_LDADD += $(LOG4CPLUS_LIBS) $(CRYPTO_LIBS) $(BOOST_LIBS)
 
 kea_lfc_LDFLAGS = $(AM_LDFLAGS) $(CRYPTO_LDFLAGS)
-if HAVE_MYSQL
-kea_lfc_LDFLAGS += $(MYSQL_LIBS)
-endif
-if HAVE_PGSQL
-kea_lfc_LDFLAGS += $(PGSQL_LIBS)
-endif
 
 kea_lfcdir = $(pkgdatadir)
 
index 6e0e0d8200303940553f2398d80bb098bc64434b..e463fa09a48b3c76ba7d5982e61193cd3e4ee54e 100644 (file)
@@ -26,12 +26,6 @@ lfc_unittests_SOURCES += lfc_controller_unittests.cc
 
 lfc_unittests_CPPFLAGS = $(AM_CPPFLAGS) $(GTEST_INCLUDES)
 lfc_unittests_LDFLAGS = $(AM_LDFLAGS) $(CRYPTO_LDFLAGS)
-if HAVE_MYSQL
-lfc_unittests_LDFLAGS += $(MYSQL_LIBS)
-endif
-if HAVE_PGSQL
-lfc_unittests_LDFLAGS += $(PGSQL_LIBS)
-endif
 lfc_unittests_LDFLAGS += $(GTEST_LDFLAGS)
 
 lfc_unittests_LDADD  = $(top_builddir)/src/bin/lfc/liblfc.la
@@ -44,15 +38,6 @@ lfc_unittests_LDADD += $(top_builddir)/src/lib/config/libkea-cfgclient.la
 lfc_unittests_LDADD += $(top_builddir)/src/lib/http/libkea-http.la
 lfc_unittests_LDADD += $(top_builddir)/src/lib/dhcp/libkea-dhcp++.la
 lfc_unittests_LDADD += $(top_builddir)/src/lib/hooks/libkea-hooks.la
-
-if HAVE_PGSQL
-lfc_unittests_LDADD += $(top_builddir)/src/lib/pgsql/libkea-pgsql.la
-endif
-
-if HAVE_MYSQL
-lfc_unittests_LDADD += $(top_builddir)/src/lib/mysql/libkea-mysql.la
-endif
-
 lfc_unittests_LDADD += $(top_builddir)/src/lib/database/libkea-database.la
 lfc_unittests_LDADD += $(top_builddir)/src/lib/cc/libkea-cc.la
 lfc_unittests_LDADD += $(top_builddir)/src/lib/asiolink/libkea-asiolink.la
index b9cd69d41de83c31878816e641d5de2c7af360e4..3740044a624419d40a6f6976344daeb9cf748122 100644 (file)
@@ -17,6 +17,7 @@
 #include <dhcpsrv/cfgmgr.h>
 #include <dhcpsrv/dhcpsrv_log.h>
 #include <dhcpsrv/host_mgr.h>
+#include <mysql_hb_log.h>
 #include <mysql_host_data_source.h>
 #include <dhcpsrv/timer_mgr.h>
 #include <util/buffer.h>
@@ -4209,5 +4210,12 @@ MySqlHostDataSource::isUnusable() {
     return (impl_->unusable_);
 }
 
+HostDataSourcePtr
+MySqlHostDataSource::factory(const isc::db::DatabaseConnection::ParameterMap& parameters) {
+    LOG_INFO(mysql_hb_logger, MYSQL_HB_DB)
+        .arg(isc::db::DatabaseConnection::redactedAccessString(parameters));
+    return (HostDataSourcePtr(new MySqlHostDataSource(parameters)));
+}
+
 }  // namespace dhcp
 }  // namespace isc
index e215c1f6c40a56bf3aad1cb98fe55a58244f93c1..28f92c4b24521db54fbf46e58ab7f06044f08b6d 100644 (file)
@@ -11,7 +11,6 @@
 #include <database/db_exceptions.h>
 #include <dhcpsrv/base_host_data_source.h>
 #include <dhcpsrv/host_data_source_factory.h>
-#include <mysql_hb_log.h>
 #include <mysql/mysql_connection.h>
 
 #include <stdint.h>
@@ -540,11 +539,7 @@ public:
     ///
     /// @return The MySQL Host Manager.
     static HostDataSourcePtr
-    factory(const isc::db::DatabaseConnection::ParameterMap& parameters) {
-        LOG_INFO(mysql_hb_logger, MYSQL_HB_DB)
-            .arg(isc::db::DatabaseConnection::redactedAccessString(parameters));
-        return (HostDataSourcePtr(new MySqlHostDataSource(parameters)));
-    }
+    factory(const isc::db::DatabaseConnection::ParameterMap& parameters);
 };
 
 struct MySqlHostDataSourceInit {
index f16b8865b1524b1baf318372abf33845bd060a12..a5ea390f2788627842f0e9eb14299ac015feabf5 100644 (file)
@@ -13,8 +13,9 @@
 #include <dhcpsrv/cfgmgr.h>
 #include <dhcpsrv/dhcpsrv_log.h>
 #include <dhcpsrv/lease_mgr_factory.h>
-#include <mysql_lease_mgr.h>
 #include <dhcpsrv/timer_mgr.h>
+#include <mysql_lb_log.h>
+#include <mysql_lease_mgr.h>
 #include <mysql/mysql_connection.h>
 #include <util/multi_threading_mgr.h>
 
@@ -4673,5 +4674,12 @@ MySqlLeaseMgr::byRemoteId6size() const {
     return (static_cast<size_t>(count));
 }
 
+TrackingLeaseMgrPtr
+MySqlLeaseMgr::factory(const isc::db::DatabaseConnection::ParameterMap& parameters) {
+    LOG_INFO(mysql_lb_logger, MYSQL_LB_DB)
+        .arg(isc::db::DatabaseConnection::redactedAccessString(parameters));
+    return (TrackingLeaseMgrPtr(new MySqlLeaseMgr(parameters)));
+}
+
 }  // namespace dhcp
 }  // namespace isc
index acb49565ac05bb44b1cd3f3e155289a19a2d07c7..1b44891ec6a3aa9d89b34a406104e7abba2a3b53 100644 (file)
@@ -13,7 +13,6 @@
 #include <dhcpsrv/dhcpsrv_exceptions.h>
 #include <dhcpsrv/lease_mgr_factory.h>
 #include <dhcpsrv/tracking_lease_mgr.h>
-#include <mysql_lb_log.h>
 #include <mysql/mysql_connection.h>
 
 #include <boost/scoped_ptr.hpp>
@@ -1307,11 +1306,7 @@ public:
     ///
     /// @return The MySQL Lease Manager.
     static TrackingLeaseMgrPtr
-    factory(const isc::db::DatabaseConnection::ParameterMap& parameters) {
-        LOG_INFO(mysql_lb_logger, MYSQL_LB_DB)
-            .arg(isc::db::DatabaseConnection::redactedAccessString(parameters));
-        return (TrackingLeaseMgrPtr(new MySqlLeaseMgr(parameters)));
-    }
+    factory(const isc::db::DatabaseConnection::ParameterMap& parameters);
 };
 
 struct MySqlLeaseMgrInit {
index d4e12273ea111405a97b4bd48e019ba3b4345a6c..4604d8f9ae09ff0ea9233c8c8a0f2a47adb9e5c0 100644 (file)
@@ -17,6 +17,7 @@
 #include <dhcpsrv/cfgmgr.h>
 #include <dhcpsrv/dhcpsrv_log.h>
 #include <dhcpsrv/host_mgr.h>
+#include <pgsql_hb_log.h>
 #include <pgsql_host_data_source.h>
 #include <dhcpsrv/timer_mgr.h>
 #include <util/buffer.h>
@@ -3374,5 +3375,12 @@ PgSqlHostDataSource::isUnusable() {
     return (impl_->unusable_);
 }
 
+HostDataSourcePtr
+PgSqlHostDataSource::factory(const isc::db::DatabaseConnection::ParameterMap& parameters) {
+    LOG_INFO(pgsql_hb_logger, PGSQL_HB_DB)
+        .arg(isc::db::DatabaseConnection::redactedAccessString(parameters));
+    return (HostDataSourcePtr(new PgSqlHostDataSource(parameters)));
+}
+
 }  // namespace dhcp
 }  // namespace isc
index e4d371a8f0a2afbc6e5b33649121af0ebc4e95f5..a17306c6caea16b1e1763b6027ad9e23acae96a7 100644 (file)
@@ -10,7 +10,6 @@
 #include <database/database_connection.h>
 #include <dhcpsrv/base_host_data_source.h>
 #include <dhcpsrv/host_data_source_factory.h>
-#include <pgsql_hb_log.h>
 #include <pgsql/pgsql_connection.h>
 #include <pgsql/pgsql_exchange.h>
 
@@ -592,11 +591,7 @@ public:
     ///
     /// @return The PostgreSQL Host Manager.
     static HostDataSourcePtr
-    factory(const isc::db::DatabaseConnection::ParameterMap& parameters) {
-        LOG_INFO(pgsql_hb_logger, PGSQL_HB_DB)
-            .arg(isc::db::DatabaseConnection::redactedAccessString(parameters));
-        return (HostDataSourcePtr(new PgSqlHostDataSource(parameters)));
-    }
+    factory(const isc::db::DatabaseConnection::ParameterMap& parameters);
 };
 
 struct PgSqlHostDataSourceInit {
index 806e2d4d0dca2ba73756f065006ffdb006dd1eac..38d851ecc7f8c1c2b4f067b9e4f58cba191bbe00 100644 (file)
@@ -14,6 +14,7 @@
 #include <dhcpsrv/dhcpsrv_log.h>
 #include <dhcpsrv/dhcpsrv_exceptions.h>
 #include <dhcpsrv/lease_mgr_factory.h>
+#include <pgsql_lb_log.h>
 #include <pgsql_lease_mgr.h>
 #include <dhcpsrv/timer_mgr.h>
 #include <util/multi_threading_mgr.h>
@@ -3683,5 +3684,12 @@ PgSqlLeaseMgr::byRemoteId6size() const {
     return (static_cast<size_t>(count));
 }
 
+TrackingLeaseMgrPtr
+PgSqlLeaseMgr::factory(const isc::db::DatabaseConnection::ParameterMap& parameters) {
+    LOG_INFO(pgsql_lb_logger, PGSQL_LB_DB)
+        .arg(isc::db::DatabaseConnection::redactedAccessString(parameters));
+    return (TrackingLeaseMgrPtr(new PgSqlLeaseMgr(parameters)));
+}
+
 }  // namespace dhcp
 }  // namespace isc
index 12588f23a3c46a98747732a7e5e1e9a06e207a89..adb8fe6bf7befac828da00f77a544074b48bb20e 100644 (file)
@@ -13,7 +13,6 @@
 #include <dhcpsrv/dhcpsrv_exceptions.h>
 #include <dhcpsrv/lease_mgr_factory.h>
 #include <dhcpsrv/tracking_lease_mgr.h>
-#include <pgsql_lb_log.h>
 #include <pgsql/pgsql_connection.h>
 #include <pgsql/pgsql_exchange.h>
 
@@ -1266,11 +1265,7 @@ public:
     ///
     /// @return The PostgreSQL Lease Manager.
     static TrackingLeaseMgrPtr
-    factory(const isc::db::DatabaseConnection::ParameterMap& parameters) {
-        LOG_INFO(pgsql_lb_logger, PGSQL_LB_DB)
-            .arg(isc::db::DatabaseConnection::redactedAccessString(parameters));
-        return (TrackingLeaseMgrPtr(new PgSqlLeaseMgr(parameters)));
-    }
+    factory(const isc::db::DatabaseConnection::ParameterMap& parameters);
 };
 
 struct PgSqlLeaseMgrInit {
index c4747ab82c3fc5fba7c78fb3e95ca920552c882a..0bb8f45433022d3caaa490ce7fa26f2de7525443 100644 (file)
@@ -6,13 +6,6 @@ AM_CPPFLAGS += $(BOOST_INCLUDES)
 AM_CPPFLAGS += -DSTAT_CMDS_LIB_SO=\"$(abs_top_builddir)/src/hooks/dhcp/stat_cmds/.libs/libdhcp_stat_cmds.so\"
 AM_CPPFLAGS += -DINSTALL_PROG=\"$(abs_top_srcdir)/install-sh\"
 
-if HAVE_MYSQL
-AM_CPPFLAGS += $(MYSQL_CPPFLAGS)
-endif
-if HAVE_PGSQL
-AM_CPPFLAGS += $(PGSQL_CPPFLAGS)
-endif
-
 AM_CXXFLAGS = $(KEA_CXXFLAGS)
 
 if USE_STATIC_LINK
@@ -64,12 +57,5 @@ stat_cmds_unittests_LDADD += $(CRYPTO_LIBS)
 stat_cmds_unittests_LDADD += $(BOOST_LIBS)
 stat_cmds_unittests_LDADD += $(GTEST_LDADD)
 
-if HAVE_MYSQL
-stat_cmds_unittests_LDFLAGS += $(MYSQL_LIBS)
-endif
-if HAVE_PGSQL
-stat_cmds_unittests_LDFLAGS += $(PGSQL_LIBS)
-endif
-
 endif
 noinst_PROGRAMS = $(TESTS)
index fda9a6d586b9cc85f5694b7e6c2252ace4412461..7d42abeb2a17f1ee5d59fc496733801abb0da436 100644 (file)
@@ -13,12 +13,6 @@ AM_CPPFLAGS += -DTOP_BUILDDIR="\"$(top_builddir)\""
 # Set location of the kea-lfc binary.
 AM_CPPFLAGS += -DKEA_LFC_EXECUTABLE="\"$(kea_lfc_location)\""
 AM_CPPFLAGS += $(BOOST_INCLUDES)
-if HAVE_MYSQL
-AM_CPPFLAGS += $(MYSQL_CPPFLAGS)
-endif
-if HAVE_PGSQL
-AM_CPPFLAGS += $(PGSQL_CPPFLAGS)
-endif
 
 AM_CXXFLAGS = $(KEA_CXXFLAGS)
 
index ca021a1105c7a8929ffc9e2976a06ad294f9cb8b..857534ba79d98d594dd03f35dc82fd82243c4509 100644 (file)
@@ -132,22 +132,10 @@ libdhcpsrv_unittests_SOURCES += network_state_unittest.cc
 libdhcpsrv_unittests_SOURCES += network_unittest.cc
 
 libdhcpsrv_unittests_CPPFLAGS = $(AM_CPPFLAGS) $(GTEST_INCLUDES)
-if HAVE_MYSQL
-libdhcpsrv_unittests_CPPFLAGS += $(MYSQL_CPPFLAGS)
-endif
-if HAVE_PGSQL
-libdhcpsrv_unittests_CPPFLAGS += $(PGSQL_CPPFLAGS)
-endif
 
 libdhcpsrv_unittests_CXXFLAGS = $(AM_CXXFLAGS)
 
 libdhcpsrv_unittests_LDFLAGS  = $(AM_LDFLAGS) $(CRYPTO_LDFLAGS) $(GTEST_LDFLAGS)
-if HAVE_MYSQL
-libdhcpsrv_unittests_LDFLAGS  += $(MYSQL_LIBS)
-endif
-if HAVE_PGSQL
-libdhcpsrv_unittests_LDFLAGS  += $(PGSQL_LIBS)
-endif
 
 libdhcpsrv_unittests_LDADD  = $(top_builddir)/src/lib/dhcpsrv/testutils/libdhcpsrvtest.la
 libdhcpsrv_unittests_LDADD += $(top_builddir)/src/lib/dhcpsrv/libkea-dhcpsrv.la
@@ -161,16 +149,6 @@ libdhcpsrv_unittests_LDADD += $(top_builddir)/src/lib/dhcp/testutils/libdhcptest
 libdhcpsrv_unittests_LDADD += $(top_builddir)/src/lib/dhcp/libkea-dhcp++.la
 libdhcpsrv_unittests_LDADD += $(top_builddir)/src/lib/hooks/libkea-hooks.la
 
-if HAVE_PGSQL
-libdhcpsrv_unittests_LDADD += $(top_builddir)/src/lib/pgsql/testutils/libpgsqltest.la
-libdhcpsrv_unittests_LDADD += $(top_builddir)/src/lib/pgsql/libkea-pgsql.la
-endif
-
-if HAVE_MYSQL
-libdhcpsrv_unittests_LDADD += $(top_builddir)/src/lib/mysql/testutils/libmysqltest.la
-libdhcpsrv_unittests_LDADD += $(top_builddir)/src/lib/mysql/libkea-mysql.la
-endif
-
 libdhcpsrv_unittests_LDADD += $(top_builddir)/src/lib/database/testutils/libdatabasetest.la
 libdhcpsrv_unittests_LDADD += $(top_builddir)/src/lib/database/libkea-database.la
 libdhcpsrv_unittests_LDADD += $(top_builddir)/src/lib/testutils/libkea-testutils.la
index a9ec22fb8b3ca4dab1ff61536b61c39c2d5894fc..74e7cfba0128bc1e7b47e145de6a21bdb8a63d97 100644 (file)
 #include <stats/stats_mgr.h>
 #include <testutils/gtest_utils.h>
 #include <util/str.h>
-
-#if defined HAVE_MYSQL
-#include <mysql/testutils/mysql_schema.h>
-#endif
-
-#if defined HAVE_PGSQL
-#include <pgsql/testutils/pgsql_schema.h>
-#endif
-
 #include <boost/pointer_cast.hpp>
 
 using namespace std;
index a465f41bc33004143850f29458708fc0a7a31dcb..3df4905295673ea7a9eb9da1c85a84533a711afe 100644 (file)
 #include <testutils/test_to_element.h>
 #include <gtest/gtest.h>
 
-#if defined HAVE_MYSQL
-#include <mysql/testutils/mysql_schema.h>
-#endif
-
-#if defined HAVE_PGSQL
-#include <pgsql/testutils/pgsql_schema.h>
-#endif
-
 using namespace isc;
 using namespace isc::dhcp;
 using namespace isc::test;
index 81d350175f8b1555ba24bd417de0328a23ad1337..3c8048921c55d0ec60b954e2fef9f8a381298e61 100644 (file)
@@ -32,35 +32,13 @@ libdhcpsrvtest_la_SOURCES += test_config_backend_dhcp4.cc test_config_backend_dh
 libdhcpsrvtest_la_SOURCES += test_config_backend_dhcp6.cc test_config_backend_dhcp6.h
 libdhcpsrvtest_la_SOURCES += generic_lease_extended_info_unittest.h
 
-if HAVE_MYSQL
-libdhcpsrvtest_la_SOURCES += mysql_generic_backend_unittest.cc mysql_generic_backend_unittest.h
-endif
-if HAVE_PGSQL
-libdhcpsrvtest_la_SOURCES += pgsql_generic_backend_unittest.cc pgsql_generic_backend_unittest.h
-endif
 
 libdhcpsrvtest_la_CXXFLAGS = $(AM_CXXFLAGS)
 libdhcpsrvtest_la_CPPFLAGS = $(AM_CPPFLAGS) $(GTEST_INCLUDES)
 
-libdhcpsrvtest_la_LIBADD =
-
-if HAVE_PGSQL
-libdhcpsrvtest_la_CPPFLAGS += $(PGSQL_CPPFLAGS)
-libdhcpsrvtest_la_LIBADD  += $(top_builddir)/src/lib/pgsql/libkea-pgsql.la
-endif
-if HAVE_MYSQL
-libdhcpsrvtest_la_CPPFLAGS += $(MYSQL_CPPFLAGS)
-libdhcpsrvtest_la_LIBADD  += $(top_builddir)/src/lib/mysql/libkea-mysql.la
-endif
-
 libdhcpsrvtest_la_LDFLAGS  = $(AM_LDFLAGS)
-if HAVE_MYSQL
-libdhcpsrvtest_la_LDFLAGS  += $(MYSQL_LIBS)
-endif
-if HAVE_PGSQL
-libdhcpsrvtest_la_LDFLAGS  += $(PGSQL_LIBS)
-endif
 
+libdhcpsrvtest_la_LIBADD   =
 libdhcpsrvtest_la_LIBADD  += $(top_builddir)/src/lib/database/libkea-database.la
 libdhcpsrvtest_la_LIBADD  += $(top_builddir)/src/lib/cc/libkea-cc.la
 libdhcpsrvtest_la_LIBADD  += $(top_builddir)/src/lib/log/libkea-log.la