From: Francis Dupont Date: Sun, 23 Mar 2025 18:26:40 +0000 (+0100) Subject: [#3785] Fixed spurious log4cplus error messages X-Git-Tag: botan2+3~2 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=cb0a64d87cba97f373e61068a657a3d548092e55;p=thirdparty%2Fkea.git [#3785] Fixed spurious log4cplus error messages --- diff --git a/src/bin/dhcp4/tests/get_config_unittest.cc.skel b/src/bin/dhcp4/tests/get_config_unittest.cc.skel index 6ef5349dcd..5bcfae32fc 100644 --- a/src/bin/dhcp4/tests/get_config_unittest.cc.skel +++ b/src/bin/dhcp4/tests/get_config_unittest.cc.skel @@ -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 diff --git a/src/bin/dhcp4/tests/make-rebuild.sh.in b/src/bin/dhcp4/tests/make-rebuild.sh.in index 5b9522ef8b..bcd1761a0f 100755 --- a/src/bin/dhcp4/tests/make-rebuild.sh.in +++ b/src/bin/dhcp4/tests/make-rebuild.sh.in @@ -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" diff --git a/src/bin/dhcp6/tests/get_config_unittest.cc b/src/bin/dhcp6/tests/get_config_unittest.cc index 56b04207fa..1824def566 100644 --- a/src/bin/dhcp6/tests/get_config_unittest.cc +++ b/src/bin/dhcp6/tests/get_config_unittest.cc @@ -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" diff --git a/src/bin/dhcp6/tests/get_config_unittest.cc.skel b/src/bin/dhcp6/tests/get_config_unittest.cc.skel index 1a619eaa91..a05a157eb1 100644 --- a/src/bin/dhcp6/tests/get_config_unittest.cc.skel +++ b/src/bin/dhcp6/tests/get_config_unittest.cc.skel @@ -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 diff --git a/src/bin/dhcp6/tests/make-rebuild.sh.in b/src/bin/dhcp6/tests/make-rebuild.sh.in index 73bf8ab0cf..9c0387b266 100755 --- a/src/bin/dhcp6/tests/make-rebuild.sh.in +++ b/src/bin/dhcp6/tests/make-rebuild.sh.in @@ -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" diff --git a/src/lib/log/logger_manager_impl.cc b/src/lib/log/logger_manager_impl.cc index 42a1a1771d..729f3b16df 100644 --- a/src/lib/log/logger_manager_impl.cc +++ b/src/lib/log/logger_manager_impl.cc @@ -182,6 +182,7 @@ LoggerManagerImpl::createFileAppender(log4cplus::Logger& logger, lexical_cast(opt.maxver)); properties.setProperty("ImmediateFlush", opt.flush ? "true" : "false"); properties.setProperty("UseLockFile", "true"); + properties.setProperty("ReopenDelay", "0"); fileapp = log4cplus::SharedAppenderPtr( new log4cplus::RollingFileAppender(properties)); } diff --git a/src/lib/testutils/log_utils.cc b/src/lib/testutils/log_utils.cc index 7cc53b9b5d..e1607f58e9 100644 --- a/src/lib/testutils/log_utils.cc +++ b/src/lib/testutils/log_utils.cc @@ -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);