]> git.ipfire.org Git - thirdparty/kea.git/commitdiff
[#3025] address review comments
authorAndrei Pavel <andrei@isc.org>
Tue, 20 Feb 2024 22:25:22 +0000 (00:25 +0200)
committerAndrei Pavel <andrei@isc.org>
Thu, 22 Feb 2024 08:06:32 +0000 (10:06 +0200)
18 files changed:
doc/sphinx/arm/ddns.rst
src/bin/admin/kea-admin.in
src/lib/asiolink/tests/process_spawn_unittest.cc
src/lib/database/testutils/Makefile.am
src/lib/dhcpsrv/dhcpsrv_messages.mes
src/lib/hooks/hooks_user.dox
src/lib/mysql/mysql_connection.h
src/lib/mysql/tests/Makefile.am
src/lib/mysql/tests/mysql_connection_unittest.cc
src/lib/pgsql/pgsql_connection.cc
src/lib/pgsql/pgsql_connection.h
src/lib/pgsql/tests/pgsql_connection_unittest.cc
src/lib/process/process_messages.mes
src/lib/util/file_utilities.cc
src/lib/util/tests/Makefile.am
src/lib/util/tests/file_utilities_unittest.cc
src/lib/yang/translator.h
tools/Makefile.am

index 2d94d45c316077ee22fc2a0c50f990427630fd56..9b3464e827187f6a7edbc87f9e6b3823a073c1b5 100644 (file)
@@ -952,7 +952,7 @@ Currently Kea's statistics management has the following limitations:
 
 .. note::
 
-    Hook libraries, such as the the ISC subscriber-only GSS-TSIG library,
+    Hook libraries, such as the ISC subscriber-only GSS-TSIG library,
     make new statistics available in Kea.
 
 More information about Kea statistics can be found at :ref:`stats`.
index 3e90acd98c519754aca4758ca1737c94a3d1bf98..12bcd5a39ab5d872927983935e7312d72dddc721 100644 (file)
@@ -42,13 +42,13 @@ dump_file=""
 dump_qry=""
 
 # Detect if this is installed or in sources. Check for sources first, so that
-# the the unexpected situations with weird paths fall on the default case of
+# the unexpected situations with weird paths fall on the default case of
 # installed.
 script_path=$(cd "$(dirname "${0}")" && pwd)
 if test "${script_path}" = "@abs_top_builddir@/src/bin/admin"; then
     admin_utils="@abs_top_builddir@/src/bin/admin/admin-utils.sh"
     KEA_LFC="@abs_top_builddir@/src/bin/lfc/kea-lfc"
-    SCRIPTS_DIR="@abs_top_builddir@/src/share/database/scripts"
+    SCRIPTS_DIR="@abs_top_srcdir@/src/share/database/scripts"
 else
     admin_utils="@datarootdir@/@PACKAGE_NAME@/scripts/admin-utils.sh"
     KEA_LFC="@sbindir@/kea-lfc"
index cad7e7b0dca1473b5abea7eefcb7fe07d923a7c0..73144475826b67d08de5b574a66d581d3fa4c4db 100644 (file)
@@ -302,11 +302,6 @@ TEST_F(ProcessSpawnTest, invalidExecutable) {
 // This test verifies that the full command line for the process is
 // returned.
 TEST_F(ProcessSpawnTest, getCommandLine) {
-    // Note that cases below are enclosed in separate scopes to make
-    // sure that the ProcessSpawn object is destroyed before a new
-    // object is created. Current implementation doesn't allow for
-    // having two ProcessSpawn objects simultaneously as they will
-    // both try to allocate a signal handler for SIGCHLD.
     {
         // Case 1: arguments present.
         ProcessArgs args;
index 3cf82e04e114e97b9b45e2d669fb43b10268e4f3..4faf645570ef8deb7b140b26397f187720ef4d8c 100644 (file)
@@ -1,7 +1,7 @@
 SUBDIRS = .
 
 AM_CPPFLAGS = -I$(top_builddir)/src/lib -I$(top_srcdir)/src/lib
-TEST_CA_DIR = $(abs_srcdir)/../../asiolink/testutils/ca
+TEST_CA_DIR = $(realpath $(abs_srcdir)/../../asiolink/testutils/ca)
 AM_CPPFLAGS += -DTEST_CA_DIR=\"$(TEST_CA_DIR)\"
 
 AM_CXXFLAGS = $(KEA_CXXFLAGS)
index 75b36bae1a68c2bb466d9af69d91774b89ab5686..b7eba47f3825acb7e14322fd21250efbcb89c065 100644 (file)
@@ -391,7 +391,7 @@ no lease6 should be assigned. The server will not put that lease in its
 database and the client will get a NoAddrsAvail for that IA_NA option.
 
 % DHCPSRV_HOST_MGR_DB_OPEN_CONNECTION_WITH_RETRY_FAILED Failed to connect to database: %1 with error: %2
-This is an informational message issued when the the server failed to connect to
+This is an informational message issued when the server failed to connect to
 the host database. The operation started a retry to connect procedure.
 The database access string with password redacted is logged, along with the
 error and details for the reconnect procedure.
@@ -438,7 +438,7 @@ This log message variant contains no error text because it is triggered
 by an unknown exception.
 
 % DHCPSRV_LEASE_MGR_DB_OPEN_CONNECTION_WITH_RETRY_FAILED Failed to connect to database: %1 with error: %2
-This is an informational message issued when the the server failed to connect to
+This is an informational message issued when the server failed to connect to
 the lease database. The operation started a retry to connect procedure.
 The database access string with password redacted is logged, along with the
 error and details for the reconnect procedure.
index 2a51b93675420c5e5ae2d32d0e517a15d5e34c06..f2751f3e74369f971ac993d7f8e48de5e450fa17 100644 (file)
@@ -875,7 +875,7 @@ configuration derived from the root logger.
 @subsection hooksdgBuild Building the Library
 
 Building the code requires building a sharable library.  This requires
-the the code be compiled as position-independent code (using the
+the code be compiled as position-independent code (using the
 compiler's "-fpic" switch) and linked as a shared library (with the
 linker's "-shared" switch).  The build command also needs to point to
 the Kea include directory and link in the appropriate libraries.
index 5a2f81a089b2b9a9d6835dbc3ab5a7aa000c6fe4..3d17235a110652826e3c9ef4ee774587877da54f 100644 (file)
@@ -827,6 +827,8 @@ public:
     /// @brief TLS flag (true when TLS was required, false otherwise).
     bool tls_;
 
+    /// @brief Holds location to kea-admin. By default, it points to kea-admin
+    /// from installation. In tests, it points to kea-admin from sources.
     static std::string KEA_ADMIN_;
 };
 
index bf6ed1bd83f88299d8ef4e5c6a3a8452aece6182..e560be9c7c0f16baed41c7e0d0cbf8400fae3ee4 100644 (file)
@@ -1,7 +1,7 @@
 SUBDIRS = .
 
 AM_CPPFLAGS  =
-AM_CPPFLAGS += -DABS_TOP_BUILDDIR="\"$(abs_top_builddir)\""
+AM_CPPFLAGS += -DABS_SRCDIR="\"$(abs_top_builddir)\""
 AM_CPPFLAGS += -DKEA_ADMIN=\"${abs_top_builddir}/src/bin/admin/kea-admin\"
 AM_CPPFLAGS += -I$(top_builddir)/src/lib -I$(top_srcdir)/src/lib
 AM_CPPFLAGS += $(BOOST_INCLUDES) $(MYSQL_CPPFLAGS)
index 69a325a89f961083b78b59464fe78d173cb46868..51376f971a2d41bbd8f0943e258131fe79b940dd 100644 (file)
@@ -1000,18 +1000,16 @@ TEST_F(MySqlConnectionTest, toKeaAdminParameters) {
     parameters = DatabaseConnection::parse(full_mysql_connection_string);
     kea_admin_parameters = MySqlConnection::toKeaAdminParameters(parameters);
     EXPECT_EQ(kea_admin_parameters,
-              vector<string>(
-                  {"mysql", "--extra",
-                   "--ssl-cert " ABS_TOP_BUILDDIR "/src/lib/database/testutils/../../asiolink/"
-                   "testutils/ca/kea-client.crt",
-                   "--extra", "--ssl-cipher AES", "--extra", "--connect_timeout 10", "--host",
-                   "127.0.0.1", "--extra",
-                   "--ssl-key " ABS_TOP_BUILDDIR "/src/lib/database/testutils/../../asiolink/"
-                   "testutils/ca/kea-client.key",
-                   "--name", "keatest", "--password", "keatest", "--extra",
-                   "--ssl-ca " ABS_TOP_BUILDDIR "/src/lib/database/testutils/../../asiolink/"
-                   "testutils/ca/kea-ca.crt",
-                   "--user", "keatest_secure"}));
+              vector<string>({"mysql", "--extra",
+                              "--ssl-cert " ABS_SRCDIR "/src/lib/asiolink/testutils/ca/"
+                              "kea-client.crt",
+                              "--extra", "--ssl-cipher AES", "--extra", "--connect_timeout 10",
+                              "--host", "127.0.0.1", "--extra",
+                              "--ssl-key " ABS_SRCDIR "/src/lib/asiolink/testutils/ca/"
+                                                      "kea-client.key",
+                              "--name", "keatest", "--password", "keatest", "--extra",
+                              "--ssl-ca " ABS_SRCDIR "/src/lib/asiolink/testutils/ca/kea-ca.crt",
+                              "--user", "keatest_secure"}));
 }
 
 }  // namespace
index accef17ed5d7b2b384e422ca4a6d1e6b58c4a4cf..7315dd94e969a3efb6dc411237a00fb3a4bc168b 100644 (file)
@@ -184,9 +184,6 @@ PgSqlConnection::ensureSchemaVersion(const ParameterMap& parameters,
     IOServiceAccessorPtr ac(new IOServiceAccessor(&DatabaseConnection::getIOService));
     pair<uint32_t, uint32_t> schema_version;
     try {
-        // Attempt to get version without retrying or other sophistries. This
-        // provides the most accurate view of the status of the database and the
-        // most flexibility to reacting to errors.
         schema_version = getVersion(parameters, ac, cb, retry ? timer_name : string());
     } catch (DbOpenError const& exception) {
         throw;
index 961823c946710a3ce2c54168891de47eb02250d5..e11d388b246e5e38282bd55c5db0cb5f88eac1d4 100644 (file)
@@ -626,6 +626,8 @@ public:
     /// is already in progress.
     int transaction_ref_count_;
 
+    /// @brief Holds location to kea-admin. By default, it points to kea-admin
+    /// from installation. In tests, it points to kea-admin from sources.
     static std::string KEA_ADMIN_;
 };
 
index e1660e1e51134592825b96fc3a76713355e60c34..04007dd87db84196effb804b0e68e548bf6a03be 100644 (file)
@@ -197,7 +197,7 @@ public:
         TestRowSet fetched_rows;
 
         // Run the select.  The row consumption lambda should populate
-        // fetched_rows based on the the result set returned by the select.
+        // fetched_rows based on the result set returned by the select.
         conn_->selectQuery(tagged_statements[GET_BY_INT_RANGE], in_bindings,
                            [&](PgSqlResult& r, size_t row) {
             TestRow fetched_row;
@@ -236,7 +236,7 @@ public:
     /// In this test, the input data is a set of rows that describe
     /// which rows in the database to update and how. For each row
     /// in the set we find the record in the database with matching
-    /// int_col value and replace its text_col value with the the
+    /// int_col value and replace its text_col value with the
     /// text value from the input the row.
     ///
     /// @param update_rows Collection of rows of data to update.
index 31be9f853401404b83c3f27b85d7e123345d23a7..d0eb11e6d5553f18cd1fec200084952f65e9ee79 100644 (file)
@@ -76,7 +76,7 @@ A debug message indicating that the controller has received an
 updated configuration from the Kea configuration system.
 
 % DCTL_DB_OPEN_CONNECTION_WITH_RETRY_FAILED Failed to connect to database: %1 with error: %2
-This is an informational message issued when the the server failed to connect to
+This is an informational message issued when the server failed to connect to
 the configuration database. The operation started a retry to connect procedure.
 The database access string with password redacted is logged, along with the
 error and details for the reconnect procedure.
index e59e8f43cac773ce22cf5ef894e24ee106905c33..759c52c3dc56fc79f8c45bff21e18d3fbc0d9225 100644 (file)
@@ -73,7 +73,6 @@ isFile(const string& name) {
     return ((stats.st_mode & S_IFMT) == S_IFREG);
 }
 
-
 } // namespace file
 } // namespace log
 } // namespace isc
index 9a59b4c8caadd9a267c68f62be55bc73cd16b4b9..cea80c19a150e20fcbdd32cfd56b8e064ad33485 100644 (file)
@@ -2,6 +2,7 @@ SUBDIRS = .
 
 AM_CPPFLAGS = -I$(top_builddir)/src/lib -I$(top_srcdir)/src/lib
 AM_CPPFLAGS += $(BOOST_INCLUDES)
+AM_CPPFLAGS += -DABS_SRCDIR=\"$(abs_srcdir)\"
 AM_CPPFLAGS += -DTEST_DATA_BUILDDIR=\"$(abs_builddir)\"
 AM_CXXFLAGS = $(KEA_CXXFLAGS)
 
index 478d4764ecb2bb4786d888989044d9f8f05277b2..8ab4ee70e9ef5e66ec7c58fd0257368d24cebc35 100644 (file)
@@ -28,7 +28,7 @@ public:
 };
 
 FileUtilTest::~FileUtilTest() {
-    string test_file_name = string(TEST_DATA_BUILDDIR) + "/fu.test";
+    string test_file_name(TEST_DATA_BUILDDIR "/fu.test");
     static_cast<void>(remove(test_file_name.c_str()));
 }
 
@@ -65,7 +65,7 @@ TEST_F(FileUtilTest, notRegular) {
 
 /// @brief Check getContent works.
 TEST_F(FileUtilTest, basic) {
-    string file_name = string(TEST_DATA_BUILDDIR) + "/fu.test";
+    string file_name(TEST_DATA_BUILDDIR "/fu.test");
     ofstream fs(file_name.c_str(), ofstream::out | ofstream::trunc);
     ASSERT_TRUE(fs.is_open());
     fs << "abdc";
@@ -79,13 +79,13 @@ TEST_F(FileUtilTest, basic) {
 TEST_F(FileUtilTest, isDir) {
     EXPECT_TRUE(isDir("/dev"));
     EXPECT_FALSE(isDir("/dev/null"));
-    EXPECT_FALSE(isDir("/this/does/not/exists"));
+    EXPECT_FALSE(isDir("/this/does/not/exist"));
     EXPECT_FALSE(isDir("/etc/hosts"));
 }
 
 /// @brief Check isFile.
 TEST_F(FileUtilTest, isFile) {
-    EXPECT_TRUE(isFile("file_utilities_unittest.cc"));
+    EXPECT_TRUE(isFile(ABS_SRCDIR "/file_utilities_unittest.cc"));
     EXPECT_FALSE(isFile(TEST_DATA_BUILDDIR));
 }
 
index eb29d0febc905300b6ee51d7de5c43ba5d657508..bee75d2ee8d94f45b42c5a87ceb80be55e5c67d0 100644 (file)
@@ -205,7 +205,7 @@ public:
     /// in the sysrepo datastore by calling Session::getData(). It should be
     /// used sparingly in production code. It is primarily meant for unit tests.
     ///
-    /// @param xpath the xpath of the root node belonging to the the tree being traversed
+    /// @param xpath the xpath of the root node belonging to the tree being traversed
     /// @param f the function to be called on the node itself and each descendant
     template <typename functor_t>
     void forAll(std::string const& xpath, functor_t f) const {
index 5af77b9764162af177b8047553eba45e2670dd0e..6b9a9927359a6ce927918deccda82ffc4fbbe578 100644 (file)
@@ -8,7 +8,3 @@ endif
 
 CLEANFILES = *.gcno *.gcda
 DISTCLEANFILES = path_replacer.sh
-
-if GENERATE_DOCS
-
-endif