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
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.
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\":
{
# 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.
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() << "'");
}
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
#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
/// @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)));
}
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() << ")");
}
return (log_path_checker_->validatePath(logpath, enforce_path));
}
-
void LogConfigParser::parseOutputOptions(std::vector<LoggingDestination>& destination,
isc::data::ConstElementPtr output_options) {
if (!output_options) {
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() << ")");
}
}
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
///
/// @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
std::string name_;
/// @brief Value of the env variable at the time the wrapper
- /// was constructed.
+ /// was constructed.
std::string original_value_;
};
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()) {