]> git.ipfire.org Git - thirdparty/kea.git/commitdiff
[#3536] addressed review comments
authorRazvan Becheriu <razvan@isc.org>
Mon, 16 Sep 2024 09:33:27 +0000 (12:33 +0300)
committerRazvan Becheriu <razvan@isc.org>
Mon, 16 Sep 2024 13:31:01 +0000 (13:31 +0000)
15 files changed:
configure.ac
src/bin/dhcp4/tests/Makefile.am
src/bin/dhcp6/tests/Makefile.am
src/hooks/dhcp/Makefile.am
src/hooks/dhcp/mysql_hb/Makefile.am
src/hooks/dhcp/mysql_hb/tests/Makefile.am
src/hooks/dhcp/mysql_hb/tests/mysql_host_data_source_unittest.cc
src/hooks/dhcp/mysql_lb/Makefile.am
src/hooks/dhcp/mysql_lb/tests/Makefile.am
src/hooks/dhcp/pgsql_hb/Makefile.am
src/hooks/dhcp/pgsql_hb/tests/Makefile.am
src/hooks/dhcp/pgsql_hb/tests/pgsql_host_data_source_unittest.cc
src/hooks/dhcp/pgsql_lb/Makefile.am
src/hooks/dhcp/pgsql_lb/tests/Makefile.am
src/lib/database/database_connection.h

index 03b75814336e0a4e1cb81427bd3d65da96bbaf62..30d265f6ed676b2c8e0bebda80f413aa25538153 100644 (file)
@@ -1582,24 +1582,24 @@ AC_CONFIG_FILES([src/hooks/dhcp/high_availability/tests/Makefile])
 AC_CONFIG_FILES([src/hooks/dhcp/lease_cmds/Makefile])
 AC_CONFIG_FILES([src/hooks/dhcp/lease_cmds/libloadtests/Makefile])
 AC_CONFIG_FILES([src/hooks/dhcp/lease_cmds/tests/Makefile])
-AC_CONFIG_FILES([src/hooks/dhcp/mysql_lb/Makefile])
-AC_CONFIG_FILES([src/hooks/dhcp/mysql_lb/libloadtests/Makefile])
-AC_CONFIG_FILES([src/hooks/dhcp/mysql_lb/tests/Makefile])
-AC_CONFIG_FILES([src/hooks/dhcp/mysql_hb/Makefile])
-AC_CONFIG_FILES([src/hooks/dhcp/mysql_hb/libloadtests/Makefile])
-AC_CONFIG_FILES([src/hooks/dhcp/mysql_hb/tests/Makefile])
 AC_CONFIG_FILES([src/hooks/dhcp/mysql_cb/Makefile])
 AC_CONFIG_FILES([src/hooks/dhcp/mysql_cb/libloadtests/Makefile])
 AC_CONFIG_FILES([src/hooks/dhcp/mysql_cb/tests/Makefile])
-AC_CONFIG_FILES([src/hooks/dhcp/pgsql_lb/Makefile])
-AC_CONFIG_FILES([src/hooks/dhcp/pgsql_lb/libloadtests/Makefile])
-AC_CONFIG_FILES([src/hooks/dhcp/pgsql_lb/tests/Makefile])
-AC_CONFIG_FILES([src/hooks/dhcp/pgsql_hb/Makefile])
-AC_CONFIG_FILES([src/hooks/dhcp/pgsql_hb/libloadtests/Makefile])
-AC_CONFIG_FILES([src/hooks/dhcp/pgsql_hb/tests/Makefile])
+AC_CONFIG_FILES([src/hooks/dhcp/mysql_hb/Makefile])
+AC_CONFIG_FILES([src/hooks/dhcp/mysql_hb/libloadtests/Makefile])
+AC_CONFIG_FILES([src/hooks/dhcp/mysql_hb/tests/Makefile])
+AC_CONFIG_FILES([src/hooks/dhcp/mysql_lb/Makefile])
+AC_CONFIG_FILES([src/hooks/dhcp/mysql_lb/libloadtests/Makefile])
+AC_CONFIG_FILES([src/hooks/dhcp/mysql_lb/tests/Makefile])
 AC_CONFIG_FILES([src/hooks/dhcp/pgsql_cb/Makefile])
 AC_CONFIG_FILES([src/hooks/dhcp/pgsql_cb/libloadtests/Makefile])
 AC_CONFIG_FILES([src/hooks/dhcp/pgsql_cb/tests/Makefile])
+AC_CONFIG_FILES([src/hooks/dhcp/pgsql_hb/Makefile])
+AC_CONFIG_FILES([src/hooks/dhcp/pgsql_hb/libloadtests/Makefile])
+AC_CONFIG_FILES([src/hooks/dhcp/pgsql_hb/tests/Makefile])
+AC_CONFIG_FILES([src/hooks/dhcp/pgsql_lb/Makefile])
+AC_CONFIG_FILES([src/hooks/dhcp/pgsql_lb/libloadtests/Makefile])
+AC_CONFIG_FILES([src/hooks/dhcp/pgsql_lb/tests/Makefile])
 AC_CONFIG_FILES([src/hooks/dhcp/run_script/Makefile])
 AC_CONFIG_FILES([src/hooks/dhcp/run_script/libloadtests/Makefile])
 AC_CONFIG_FILES([src/hooks/dhcp/run_script/tests/Makefile])
index b0632fa5baf7a31d7fe747c6e397ffb4c65ca95b..20be6d02e4768c9c91355e3bacaf8c37937640af 100644 (file)
@@ -78,7 +78,8 @@ PROGRAM_TESTS = dhcp4_unittests
 
 # This list is ordered alphabetically. When adding new files, please maintain
 # this order.
-dhcp4_unittests_SOURCES  = classify_unittest.cc
+dhcp4_unittests_SOURCES  =
+dhcp4_unittests_SOURCES += classify_unittest.cc
 dhcp4_unittests_SOURCES += client_handler_unittest.cc
 dhcp4_unittests_SOURCES += config_parser_unittest.cc
 dhcp4_unittests_SOURCES += config_backend_unittest.cc
index 1c457a74efc884c30f881391d47e512c3d1d3e10..067539c8fbc8e380a1039b7907ebf68880ca9d30 100644 (file)
@@ -78,7 +78,8 @@ PROGRAM_TESTS = dhcp6_unittests
 
 # This list is ordered alphabetically. When adding new files, please maintain
 # this order.
-dhcp6_unittests_SOURCES  = classify_unittests.cc
+dhcp6_unittests_SOURCES  =
+dhcp6_unittests_SOURCES += classify_unittests.cc
 dhcp6_unittests_SOURCES += client_handler_unittest.cc
 dhcp6_unittests_SOURCES += config_parser_unittest.cc
 dhcp6_unittests_SOURCES += config_backend_unittest.cc
index feb1f5cde23e38130b37b4c3e5bfa5865c673385..6c7ef38503ee8e5dafae7ac07af88b7c35c7872b 100644 (file)
@@ -1,15 +1,11 @@
 SUBDIRS = bootp flex_option high_availability lease_cmds perfmon
 
 if HAVE_MYSQL
-SUBDIRS += mysql_lb
-SUBDIRS += mysql_hb
-SUBDIRS += mysql_cb
+SUBDIRS += mysql_lb mysql_hb mysql_cb
 endif
 
 if HAVE_PGSQL
-SUBDIRS += pgsql_lb
-SUBDIRS += pgsql_hb
-SUBDIRS += pgsql_cb
+SUBDIRS += pgsql_lb pgsql_hb pgsql_cb
 endif
 
 SUBDIRS += run_script stat_cmds user_chk
index 0e863cf588f504a4853e512fe52dcb0a22f8b6e1..24bc109fa0bb78ebf35cd1e2008689eb834d7101 100644 (file)
@@ -70,4 +70,5 @@ else
 messages mysql_hb_messages.h mysql_hb_messages.cc:
        @echo Messages generation disabled. Configure with --enable-generate-messages to enable it.
 
-endif
\ No newline at end of file
+endif
+
index 7cad00aee832d463676406ae5588302c6332352c..a16ce32a62ab9034dec035fda9381f00e30bc82a 100644 (file)
@@ -54,4 +54,5 @@ mysql_hb_unittests_LDADD += $(top_builddir)/src/lib/exceptions/libkea-exceptions
 mysql_hb_unittests_LDADD += $(LOG4CPLUS_LIBS) $(CRYPTO_LIBS) $(BOOST_LIBS) $(GTEST_LDADD)
 endif
 
-noinst_PROGRAMS = $(TESTS)
\ No newline at end of file
+noinst_PROGRAMS = $(TESTS)
+
index dbef932a09ed50244ea98d0aa7cd4193f499c53c..664e8fd4596e1a8c485b686a76b2e3d550e1791b 100644 (file)
@@ -1875,7 +1875,7 @@ public:
     Initializer<MySqlHostDataSourceInit> init_;
 };
 
-// Tests that MySQL lease manager and host data source can be created from a
+// Tests that memfile lease manager and MySQL host data source can be created from a
 // specified configuration.
 TEST_F(CfgMySqlDbAccessTest, createManagers) {
     CfgDbAccess cfg;
index 8ccf7fea9ccaafff5bf7887ab262b8a4ff1b68a4..1d4c50dd3032aeea721f9772ae90d2ae3ac77624 100644 (file)
@@ -70,4 +70,5 @@ else
 messages mysql_lb_messages.h mysql_lb_messages.cc:
        @echo Messages generation disabled. Configure with --enable-generate-messages to enable it.
 
-endif
\ No newline at end of file
+endif
+
index ec1d9ffe82f77bac29ffa19540d215382b013f81..aae7a203d456a442084e9f8e72b6cd72729f3923 100644 (file)
@@ -56,4 +56,5 @@ mysql_lb_unittests_LDADD += $(top_builddir)/src/lib/exceptions/libkea-exceptions
 mysql_lb_unittests_LDADD += $(LOG4CPLUS_LIBS) $(CRYPTO_LIBS) $(BOOST_LIBS) $(GTEST_LDADD)
 endif
 
-noinst_PROGRAMS = $(TESTS)
\ No newline at end of file
+noinst_PROGRAMS = $(TESTS)
+
index 370a4515dec0592834d2f7168369773468802b69..3a146b4673b2c09c9267185118442d13facd70ec 100644 (file)
@@ -70,4 +70,5 @@ else
 messages pgsql_hb_messages.h pgsql_hb_messages.cc:
        @echo Messages generation disabled. Configure with --enable-generate-messages to enable it.
 
-endif
\ No newline at end of file
+endif
+
index a798fff7f3bfd2ab308173b2f8d1ae7b53ea2ad6..9c4b9466e9da34755c6aef31e5f60dafd9f4bbc1 100644 (file)
@@ -54,4 +54,5 @@ pgsql_hb_unittests_LDADD += $(top_builddir)/src/lib/exceptions/libkea-exceptions
 pgsql_hb_unittests_LDADD += $(LOG4CPLUS_LIBS) $(CRYPTO_LIBS) $(BOOST_LIBS) $(GTEST_LDADD)
 endif
 
-noinst_PROGRAMS = $(TESTS)
\ No newline at end of file
+noinst_PROGRAMS = $(TESTS)
+
index 0c362dd9addfa77d13326a202e1a6aadcfd3f144..ee8e1dd56c4e8508407416b0f6c296c0ae394a50 100644 (file)
@@ -1843,7 +1843,7 @@ public:
     Initializer<PgSqlHostDataSourceInit> init_;
 };
 
-// Tests that PostgreSQL lease manager and host data source can be created from a
+// Tests that memfile lease manager and PostgreSQL host data source can be created from a
 // specified configuration.
 TEST_F(CfgPgSqlDbAccessTest, createManagers) {
     CfgDbAccess cfg;
index 6ef7c7c2bcee69e3af0bbbed462f851da9ac2281..b8f2b17405ade00b351321543c405eee58d1862b 100644 (file)
@@ -70,4 +70,5 @@ else
 messages pgsql_lb_messages.h pgsql_lb_messages.cc:
        @echo Messages generation disabled. Configure with --enable-generate-messages to enable it.
 
-endif
\ No newline at end of file
+endif
+
index 248f2b7398802f1a23ded4c213dda4d8f9f09e0c..615336534405f74d47282ec8cf020d6c9e93cbd3 100644 (file)
@@ -56,4 +56,5 @@ pgsql_lb_unittests_LDADD += $(top_builddir)/src/lib/exceptions/libkea-exceptions
 pgsql_lb_unittests_LDADD += $(LOG4CPLUS_LIBS) $(CRYPTO_LIBS) $(BOOST_LIBS) $(GTEST_LDADD)
 endif
 
-noinst_PROGRAMS = $(TESTS)
\ No newline at end of file
+noinst_PROGRAMS = $(TESTS)
+
index 0ea887e1d22971bf5e4abbc9b24cd34148ac2f38..c4ccf9c2331e268a8c166964d439cb6cb4c2e6ac 100644 (file)
@@ -56,7 +56,6 @@ public:
         isc::Exception(file, line, what) {}
 };
 
-
 /// @brief Invalid type exception
 ///
 /// Thrown when the factory doesn't recognize the type of the backend.
@@ -100,7 +99,6 @@ public:
         isc::Exception(file, line, what) {}
 };
 
-
 /// @brief Defines a callback prototype for propagating events upward
 typedef std::function<bool (util::ReconnectCtlPtr db_reconnect_ctl)> DbCallback;
 
@@ -329,7 +327,7 @@ private:
     /// @brief Reconnect settings.
     util::ReconnectCtlPtr reconnect_ctl_;
 
-    /// The IOService object, used for all ASIO operations.
+    /// @brief The IOService object, used for all ASIO operations.
     static isc::asiolink::IOServicePtr io_service_;
 };
 
@@ -351,16 +349,23 @@ public:
     }
 };
 
+/// @brief RAII class to register a database backend by dynamically
+/// constructing an initialization object.
+///
+/// Used mostly in unittests.
+///
+/// @tparam T The initialization class which registers the database backend
+/// on constructor and deregisters it on destructor.
 template <typename T>
 struct Initializer {
     /// @brief Constructor.
     Initializer() : init_(new T()) {
     }
 
-    /// @brief Destructo.
+    /// @brief Destructor.
     ~Initializer() = default;
 
-    /// @brief smart pointer to an instance of an initializer.
+    /// @brief Smart pointer to an instance of an initializer.
     std::unique_ptr<T> init_;
 };