]> git.ipfire.org Git - thirdparty/kea.git/commitdiff
[#3785] Fixed spurious log4cplus error messages
authorFrancis Dupont <fdupont@isc.org>
Sun, 23 Mar 2025 18:26:40 +0000 (19:26 +0100)
committerFrancis Dupont <fdupont@isc.org>
Mon, 24 Mar 2025 14:54:17 +0000 (15:54 +0100)
src/bin/dhcp4/tests/get_config_unittest.cc.skel
src/bin/dhcp4/tests/make-rebuild.sh.in
src/bin/dhcp6/tests/get_config_unittest.cc
src/bin/dhcp6/tests/get_config_unittest.cc.skel
src/bin/dhcp6/tests/make-rebuild.sh.in
src/lib/log/logger_manager_impl.cc
src/lib/testutils/log_utils.cc

index 6ef5349dcd953fc4b687ae98fbf0d1e545d565f8..5bcfae32fc55c50b9d951ca5abf8397763755ca1 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2017-2024 Internet Systems Consortium, Inc. ("ISC")
+// Copyright (C) 2017-2025 Internet Systems Consortium, Inc. ("ISC")
 //
 // This Source Code Form is subject to the terms of the Mozilla Public
 // License, v. 2.0. If a copy of the MPL was not distributed with this
@@ -288,7 +288,7 @@ TEST_P(Dhcp4GetConfigTest, run) {
 
     // emit unparsed header if wanted
     if ((config_counter == 0) && generate_action) {
-        std::cerr << "///put this after const char* UNPARSED_CONFIGS[] = {\n";
+        std::cerr << "/// put this after const char* UNPARSED_CONFIGS[] = {\n";
     }
 
     // get the extracted configuration
index 5b9522ef8be96a27a5a1be93f3f0521197223009..bcd1761a0fb10b0ba43478741fe81b32ac4c52e3 100755 (executable)
@@ -1,8 +1,5 @@
 #!/bin/sh
 
-# shellcheck disable=SC2162
-# shellcheck disable=SC3045
-
 set -eu
 
 pwd=$(pwd -P)
@@ -11,8 +8,8 @@ npwd=$(pwd -P)
 
 if test "$pwd" != "$npwd"; then
     echo "This script should be run from the build directory (@builddir@)"
-
-    read -p "Press ENTER to continue anyway"
+    printf "Press ENTER to continue anyway"
+    read -r _
 fi
 
 # Initialize.
@@ -20,18 +17,21 @@ rm -f x u get_config_unittest_rebuild.cc
 cp -f "@skeleton@" get_config_unittest_rebuild.cc
 rm -f kea-dhcp4-tests-extract
 echo "Please recompile kea-dhcp4-tests-extract"
-read -p "Press ENTER when ready"
+printf "Press ENTER when ready"
+read -r _
 
 # Extract step.
 ./kea-dhcp4-tests-extract --gtest_filter="Dhcp4Parser*" > /dev/null 2> x
 rm -f kea-dhcp4-tests-generate
 echo "Please copy content of x file into EXTRACTED_CONFIGS in get_config_unittest_rebuild.cc and recompile kea-dhcp4-tests-generate"
-read -p "Press ENTER when ready"
+printf "Press ENTER when ready"
+read -r _
 
 # Generate step
 ./kea-dhcp4-tests-generate --gtest_filter="Dhcp4GetConfig*" > /dev/null 2> u
 echo "Please copy content of u file into UNPARSED_CONFIGS in get_config_unittest_rebuild.cc"
-read -p "Press ENTER when ready"
+printf "Press ENTER when ready"
+read -r _
 mv get_config_unittest_rebuild.cc get_config_unittest.cc
 cp -f get_config_unittest.cc "@source@"
 echo "Please recompile the kea_dhcp4_tests target"
index 56b04207fa303a1bcb59089d0b4fc8dbbd3ef8cb..1824def5667163c2e0154308a8ac43a0a5da6c67 100644 (file)
@@ -2774,7 +2774,7 @@ const char* EXTRACTED_CONFIGS[] = {
 
 /// @brief unparsed configurations
 const char* UNPARSED_CONFIGS[] = {
-///put this after const char* UNPARSED_CONFIGS[] = {
+/// put this after const char* UNPARSED_CONFIGS[] = {
     // CONFIGURATION 0
 "{\n"
 "        \"allocator\": \"iterative\",\n"
index 1a619eaa9168a0a8035a836b6f4f047e20fb3a81..a05a157eb151445d1c3d839245758edbc0a7aec6 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2017-2024 Internet Systems Consortium, Inc. ("ISC")
+// Copyright (C) 2017-2025 Internet Systems Consortium, Inc. ("ISC")
 //
 // This Source Code Form is subject to the terms of the Mozilla Public
 // License, v. 2.0. If a copy of the MPL was not distributed with this
@@ -291,7 +291,7 @@ TEST_P(Dhcp6GetConfigTest, run) {
 
     // emit unparsed header if wanted
     if ((config_counter == 0) && generate_action) {
-        std::cerr << "///put this after const char* UNPARSED_CONFIGS[] = {\n";
+        std::cerr << "/// put this after const char* UNPARSED_CONFIGS[] = {\n";
     }
 
     // get the extracted configuration
index 73bf8ab0cf8ca278bc13cca9240a2606d58f3016..9c0387b266e1416a8a1e91e1197feafd434b5432 100755 (executable)
@@ -1,8 +1,5 @@
 #!/bin/sh
 
-# shellcheck disable=SC2162
-# shellcheck disable=SC3045
-
 set -eu
 
 pwd=$(pwd -P)
@@ -11,7 +8,8 @@ npwd=$(pwd -P)
 
 if test "$pwd" != "$npwd"; then
     echo "This script should be run from the build directory (@builddir@)"
-    read -p "Press ENTER to continue anyway"
+    printf "Press ENTER to continue anyway"
+    read -r _
 fi
 
 # Initialize.
@@ -19,18 +17,21 @@ rm -f x u get_config_unittest_rebuild.cc
 cp -f "@skeleton@" get_config_unittest_rebuild.cc
 rm -f kea-dhcp6-tests-extract
 echo "Please recompile kea-dhcp6-tests-extract"
-read -p "Press ENTER when ready"
+printf "Press ENTER when ready"
+read -r _
 
 # Extract step.
 ./kea-dhcp6-tests-extract --gtest_filter="Dhcp6Parser*" > /dev/null 2> x
 rm -f kea-dhcp6-tests-generate
 echo "Please copy content of x file into EXTRACTED_CONFIGS in get_config_unittest_rebuild.cc and recompile kea-dhcp6-tests-generate"
-read -p "Press ENTER when ready"
+printf "Press ENTER when ready"
+read -r _
 
 # Generate step
 ./kea-dhcp6-tests-generate --gtest_filter="Dhcp6GetConfig*" > /dev/null 2> u
 echo "Please copy content of u file into UNPARSED_CONFIGS in get_config_unittest_rebuild.cc"
-read -p "Press ENTER when ready"
+printf "Press ENTER when ready"
+read -r _
 mv get_config_unittest_rebuild.cc get_config_unittest.cc
 cp -f get_config_unittest.cc "@source@"
 echo "Please recompile the kea_dhcp6_tests target"
index 42a1a1771de9473889437e3742fd92eaa6647c8d..729f3b16df0b994eb87e5f2289679d23b16dc204 100644 (file)
@@ -182,6 +182,7 @@ LoggerManagerImpl::createFileAppender(log4cplus::Logger& logger,
                                lexical_cast<string>(opt.maxver));
         properties.setProperty("ImmediateFlush", opt.flush ? "true" : "false");
         properties.setProperty("UseLockFile", "true");
+        properties.setProperty("ReopenDelay", "0");
         fileapp = log4cplus::SharedAppenderPtr(
             new log4cplus::RollingFileAppender(properties));
     }
index 7cc53b9b5dceeaceec5a89205e1335683dca1836..e1607f58e91fd02abe924badb4894340ac42c616 100644 (file)
@@ -30,6 +30,7 @@ LogContentTest::LogContentTest()
     OutputOption option;
     option.destination = OutputOption::DEST_FILE;
     option.filename = string(LogContentTest::LOG_FILE);
+    option.maxsize = 2000000000UL;
     spec.addOutputOption(option);
     LoggerManager manager;
     manager.process(spec);