]> git.ipfire.org Git - thirdparty/kea.git/commitdiff
[#2279] fixed unittests
authorRazvan Becheriu <razvan@isc.org>
Fri, 21 Jan 2022 18:46:42 +0000 (20:46 +0200)
committerRazvan Becheriu <razvan@isc.org>
Fri, 21 Jan 2022 18:59:09 +0000 (18:59 +0000)
src/bin/dhcp4/tests/ctrl_dhcp4_srv_unittest.cc
src/bin/dhcp6/tests/ctrl_dhcp6_srv_unittest.cc
src/lib/dhcpsrv/srv_config.cc

index 84ef848acf6a3f66886b99228bc335787eee41fc..eefe39dea143618b2e0beced2d99ed5e4dcc2c62 100644 (file)
@@ -184,6 +184,17 @@ public:
 
         ConstElementPtr config;
         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);
 
         // Commit the configuration so any subsequent reconfigurations
index 9352387b04cec1aaac72476211e8be0e9285cd52..67fb8cc4a2eacc0786fc27a8844edcde231345ce 100644 (file)
@@ -211,6 +211,17 @@ public:
 
         ConstElementPtr config;
         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);
 
         // Commit the configuration so any subsequent reconfigurations
index 0e233581c8de564db1b2ea56c703de927ad48a16..ca496e6869adaf5dd5c7e76b98847af62c97d8ab 100644 (file)
@@ -132,8 +132,7 @@ SrvConfig::copy(SrvConfig& new_config) const {
     // Replace configured hooks libraries.
     new_config.hooks_config_.clear();
     using namespace isc::hooks;
-    for (HookLibsCollection::const_iterator it =
-           hooks_config_.get().begin();
+    for (HookLibsCollection::const_iterator it = hooks_config_.get().begin();
          it != hooks_config_.get().end(); ++it) {
         new_config.hooks_config_.add(it->first, it->second);
     }