]> git.ipfire.org Git - thirdparty/kea.git/commitdiff
[#3831] Fixed UT build and minor nits
authorThomas Markwalder <tmark@isc.org>
Wed, 14 May 2025 18:56:56 +0000 (14:56 -0400)
committerAndrei Pavel <andrei@isc.org>
Fri, 16 May 2025 09:20:44 +0000 (12:20 +0300)
modified:   doc/sphinx/arm/dhcp6-srv.rst
modified:   doc/sphinx/arm/logging.rst
modified:   src/bin/d2/tests/d2_process_tests.sh.in
modified:   src/bin/dhcp4/tests/dhcp4_process_tests.sh.in
modified:   src/bin/dhcp6/json_config_parser.cc
modified:   src/bin/dhcp6/tests/dhcp6_process_tests.sh.in
modified:   src/hooks/dhcp/forensic_log/libloadtests/load_unload_unittests.cc
modified:   src/lib/dhcpsrv/tests/cfgmgr_unittest.cc
modified:   src/lib/hooks/hooks_parser.cc
modified:   src/lib/process/log_parser.cc
modified:   src/lib/process/log_parser.h
modified:   src/lib/testutils/env_var_wrapper.h
modified:   src/lib/util/filesystem.cc

13 files changed:
doc/sphinx/arm/dhcp6-srv.rst
doc/sphinx/arm/logging.rst
src/bin/d2/tests/d2_process_tests.sh.in
src/bin/dhcp4/tests/dhcp4_process_tests.sh.in
src/bin/dhcp6/json_config_parser.cc
src/bin/dhcp6/tests/dhcp6_process_tests.sh.in
src/hooks/dhcp/forensic_log/libloadtests/load_unload_unittests.cc
src/lib/dhcpsrv/tests/cfgmgr_unittest.cc
src/lib/hooks/hooks_parser.cc
src/lib/process/log_parser.cc
src/lib/process/log_parser.h
src/lib/testutils/env_var_wrapper.h
src/lib/util/filesystem.cc

index 55c7f112378abc2ab9df71fe2290e04b76641c68..b5a5aa8fe46322bd0b9cca97df1fa33e80a5556d 100644 (file)
@@ -333,7 +333,6 @@ that can be used to configure the memfile backend.
     or, if already running, log an unrecoverable error.  For ease of use in
     specifying a custom file name simply omit the path component from ``name``.
 
-
 -  ``lfc-interval``: specifies the interval, in seconds, at which the
    server will perform a lease file cleanup (LFC). This removes
    redundant (historical) information from the lease file and
index 38ccb3ba4583210214e49d0778480d4ca0e1ef83..974f1579c4f920590383086299e4d2ce3050bf41 100644 (file)
@@ -563,7 +563,7 @@ interpreted as a filename to which messages should be written.
     path may be overridden at startup by setting the environment variable
     ``KEA_LOG_FILE_DIR`` to the desired path.  If a path other than
     this value is used in ``output``, Kea will emit an error and refuse to start
-    or, if already running, log an unrecoverable error.  For ease of use simply 
+    or, if already running, log an unrecoverable error.  For ease of use simply
     omit the path component from ``output`` and specify only the file name.
 
 
index 71cd4b22d40576f850e7d57d36eab1b3cdce188a..614d1c3695ce0375fd46ceedc95514659e34814d 100755 (executable)
@@ -14,13 +14,14 @@ set -eu
 CFG_FILE="@abs_top_builddir@/src/bin/d2/tests/test_config.json"
 # Path to the D2 log file.
 LOG_FILE="@abs_top_builddir@/src/bin/d2/tests/test.log"
-# D2 configuration to be stored in the configuration file.
+
 # Set env KEA_HOOKS_PATH  to override DEFAULT_HOOKS_PATH
 export KEA_HOOKS_PATH="@abs_top_builddir@/src/bin/d2/tests/@dotlibs@"
 
 # Set env KEA_LOG_FILE_DIR to override default log path
 export KEA_LOG_FILE_DIR="@abs_top_builddir@/src/bin/d2/tests"
 
+# D2 configuration to be stored in the configuration file.
 CONFIG="{
     \"DhcpDdns\":
     {
index ada74d9d1d9de1269b8f05f897011382f88ce65f..2b3f76f15ba68d925c0b071b46efceeedeff4987 100755 (executable)
@@ -24,7 +24,7 @@ HOOK_FAIL_LOAD_PATH="@abs_top_builddir@/src/bin/dhcp4/tests/@dotlibs@libco3.so"
 # Path to test hooks library
 HOOK_FAIL_POLL_PATH="@abs_top_builddir@/src/bin/dhcp4/tests/@dotlibs@libco4.so"
 
-# Set env KEA_HOOKS_PATH  to override DEFAULT_HOOKS_PATH
+# Set env KEA_HOOKS_PATH to override DEFAULT_HOOKS_PATH
 export KEA_HOOKS_PATH="@abs_top_builddir@/src/bin/dhcp4/tests/@dotlibs@"
 
 # Set env KEA_LOG_FILE_DIR to override default log path.
index e37a9f0536fda4420b2735b50f8e86b4df58ed59..1f9aec6760714058966132c3e31328412d194100 100644 (file)
@@ -178,9 +178,9 @@ public:
         if (global->contains("data-directory")) {
             auto dd = getString(global, "data-directory");
             if (dd != CfgMgr::instance().getDataDir()) {
-                isc_throw(DhcpConfigError, 
+                isc_throw(DhcpConfigError,
                           "'data-directory' of '" << dd << "' is invalid,"
-                          << " supported path is '" 
+                          << " supported path is '"
                           << CfgMgr::instance().getDataDir() << "'");
             }
 
index b84afc8eb21155ce32e6c63f06dccdc1c27cc88c..0f170b85657566248208816335a89419c1dc3c01 100755 (executable)
@@ -23,7 +23,8 @@ export KEA_LFC_EXECUTABLE="@abs_top_builddir@/src/bin/lfc/kea-lfc"
 HOOK_FAIL_LOAD_PATH="@abs_top_builddir@/src/bin/dhcp6/tests/@dotlibs@libco3.so"
 # Path to test hooks library
 HOOK_FAIL_POLL_PATH="@abs_top_builddir@/src/bin/dhcp6/tests/@dotlibs@libco4.so"
-# Set env KEA_HOOKS_PATH  to override DEFAULT_HOOKS_PATH
+
+# Set env KEA_HOOKS_PATH to override DEFAULT_HOOKS_PATH
 export KEA_HOOKS_PATH="@abs_top_builddir@/src/bin/dhcp6/tests/@dotlibs@"
 
 # Set env KEA_LOG_FILE_DIR to override default log path
index 0844511bf33881f44d9d5dc1979e3072bd20ca43..123db2d4d277948cabd042312478cc2e31f9ef53 100644 (file)
@@ -17,6 +17,7 @@
 #include <dhcpsrv/testutils/lib_load_test_fixture.h>
 #include <exceptions/exceptions.h>
 #include <hooks/hooks_manager.h>
+#include <dhcpsrv/legal_log_mgr.h>
 #include <testutils/gtest_utils.h>
 
 #ifdef HAVE_MYSQL
index 9bac59f84c4ebaf15642bdad0244d43aa135a607..77e6dc7147fbaea2f49060bd973e6f666d5a20e2 100644 (file)
@@ -288,7 +288,7 @@ public:
     /// @brief Sets the DHCP data path for server data files.
     /// @param custom_path path to use.
     void setDataDir(const std::string explicit_path = "") {
-        CfgMgr::instance().getDataDir(true, 
+        CfgMgr::instance().getDataDir(true,
                                       (!explicit_path.empty() ?
                                       explicit_path : std::string(DHCP_DATA_DIR)));
     }
index 5e5d06e90f431184b71a32ea1e7687825105f97f..a79a255c18da8495453c0cabbfbf62a4799c4974 100644 (file)
@@ -98,7 +98,7 @@ HooksLibrariesParser::parse(HooksConfig& libraries, ConstElementPtr value) {
                     libname = validatePath((entry_item.second)->stringValue());
                 } catch  (const std::exception& ex) {
                     isc_throw(DhcpConfigError, "hooks library configuration"
-                        " error: " << ex.what() << " (" 
+                        " error: " << ex.what() << " ("
                         << entry_item.second->getPosition() << ")");
                 }
 
index 53a37bcd77216aea733d82f49d61c349ce5ccf41..c016e5eb9440c9773213b036c93cbd5f539205ff 100644 (file)
@@ -155,7 +155,6 @@ LogConfigParser::validatePath(const std::string logpath,
     return (log_path_checker_->validatePath(logpath, enforce_path));
 }
 
-
 void LogConfigParser::parseOutputOptions(std::vector<LoggingDestination>& destination,
                                          isc::data::ConstElementPtr output_options) {
     if (!output_options) {
@@ -181,8 +180,8 @@ void LogConfigParser::parseOutputOptions(std::vector<LoggingDestination>& destin
             try {
                 dest.output_ = validatePath(output_str);
             } catch (const std::exception& ex) {
-                isc_throw(BadValue, "invalid path in `output`: " << ex.what() 
-                          <<  " (" << output_option->getPosition() << ")");
+                isc_throw(BadValue, "invalid path in `output`: " << ex.what()
+                          << " (" << output_option->getPosition() << ")");
             }
         }
 
index bf9e913d84364d3a3ba7f7c2424c15b9ca329fb1..cf3a7f2c246bd76547b8174528d6cdbe27d5d123 100644 (file)
@@ -58,7 +58,7 @@ public:
     void parseConfiguration(const isc::data::ConstElementPtr& log_config,
                             bool verbose = false);
 
-    /// @brief Fetches the supported log file path. 
+    /// @brief Fetches the supported log file path.
     ///
     /// The first call to this function with no arguments will set the default
     /// hooks path to either the value of LOGFILE_DIR or the environment
@@ -80,7 +80,7 @@ public:
     ///
     /// @return validated path
     static std::string validatePath(const std::string logpath, bool enforce_path = true);
-   
+
 private:
 
     /// @brief Parses one JSON structure in Server/loggers" array
index d50ebc61ab698b7cdffe053c3a7fc306b3fe6516..e1d284f5df40e152b254a705d8560c920e98c450 100644 (file)
@@ -45,7 +45,7 @@ private:
     std::string name_;
 
     /// @brief Value of the env variable at the time the wrapper
-    /// was constructed. 
+    /// was constructed.
     std::string original_value_;
 };
 
index 5bec879b7ccdf9ed7d5d3a07938aebbb5cd26a3b..8a752ca57737fdd42518f54323b0a7eed1a9d224 100644 (file)
@@ -257,7 +257,7 @@ PathChecker::validatePath(const std::string input_path_str,
     auto filename = input_path.filename();
     if (filename.empty()) {
         isc_throw(BadValue, "path: '" << input_path.str() << "' has no filename");
-     }
+    }
 
     auto parent_path = input_path.parentPath();
     if (!parent_path.empty()) {