2
0
mirror of https://gitlab.isc.org/isc-projects/kea synced 2025-08-30 21:45:37 +00:00

[#2279] fixed unittests

This commit is contained in:
Razvan Becheriu
2022-01-21 20:46:42 +02:00
parent 70cf8d8f46
commit c83760ce68
3 changed files with 23 additions and 2 deletions

View File

@@ -184,6 +184,17 @@ public:
ConstElementPtr config; ConstElementPtr config;
ASSERT_NO_THROW(config = parseDHCP4(config_txt)); ASSERT_NO_THROW(config = parseDHCP4(config_txt));
// Parse the logger configuration explicitly into the staging config.
// Note this does not alter the current loggers, they remain in
// effect until we apply the logging config below. If no logging
// is supplied logging will revert to default logging.
server_->configureLogger(config, CfgMgr::instance().getStagingCfg());
// Let's apply the new logging. We do it early, so we'll be able to print
// out what exactly is wrong with the new config in case of problems.
CfgMgr::instance().getStagingCfg()->applyLoggingCfg();
ConstElementPtr answer = server_->processConfig(config); ConstElementPtr answer = server_->processConfig(config);
// Commit the configuration so any subsequent reconfigurations // Commit the configuration so any subsequent reconfigurations

View File

@@ -211,6 +211,17 @@ public:
ConstElementPtr config; ConstElementPtr config;
ASSERT_NO_THROW(config = parseDHCP6(config_txt)); ASSERT_NO_THROW(config = parseDHCP6(config_txt));
// Parse the logger configuration explicitly into the staging config.
// Note this does not alter the current loggers, they remain in
// effect until we apply the logging config below. If no logging
// is supplied logging will revert to default logging.
server_->configureLogger(config, CfgMgr::instance().getStagingCfg());
// Let's apply the new logging. We do it early, so we'll be able to print
// out what exactly is wrong with the new config in case of problems.
CfgMgr::instance().getStagingCfg()->applyLoggingCfg();
ConstElementPtr answer = server_->processConfig(config); ConstElementPtr answer = server_->processConfig(config);
// Commit the configuration so any subsequent reconfigurations // Commit the configuration so any subsequent reconfigurations

View File

@@ -132,8 +132,7 @@ SrvConfig::copy(SrvConfig& new_config) const {
// Replace configured hooks libraries. // Replace configured hooks libraries.
new_config.hooks_config_.clear(); new_config.hooks_config_.clear();
using namespace isc::hooks; using namespace isc::hooks;
for (HookLibsCollection::const_iterator it = for (HookLibsCollection::const_iterator it = hooks_config_.get().begin();
hooks_config_.get().begin();
it != hooks_config_.get().end(); ++it) { it != hooks_config_.get().end(); ++it) {
new_config.hooks_config_.add(it->first, it->second); new_config.hooks_config_.add(it->first, it->second);
} }