From cdb02782f950bf3a7585a8390a0c40ed81cd3971 Mon Sep 17 00:00:00 2001 From: Martin Schwenke Date: Sun, 29 Jun 2025 10:16:20 +1000 Subject: [PATCH] ctdb-common: Log a message if the tunables file does not exist Switch the unit test script to INFO debug level to ensure this output appears when expected. Signed-off-by: Martin Schwenke Reviewed-by: Amitay Isaacs --- ctdb/common/tunable.c | 2 +- ctdb/tests/UNIT/cunit/tunable_test_001.sh | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/ctdb/common/tunable.c b/ctdb/common/tunable.c index 73ebbe77d9c..ec5a119bc5a 100644 --- a/ctdb/common/tunable.c +++ b/ctdb/common/tunable.c @@ -365,7 +365,7 @@ bool ctdb_tunable_load_file(TALLOC_CTX *mem_ctx, fp = fopen(file, "r"); if (fp == NULL) { if (errno == ENOENT) { - /* Doesn't need to exist */ + D_INFO("Optional tunables file %s not found\n", file); return true; } diff --git a/ctdb/tests/UNIT/cunit/tunable_test_001.sh b/ctdb/tests/UNIT/cunit/tunable_test_001.sh index d180b8ea5ff..64eab8de2ab 100755 --- a/ctdb/tests/UNIT/cunit/tunable_test_001.sh +++ b/ctdb/tests/UNIT/cunit/tunable_test_001.sh @@ -93,6 +93,7 @@ ok_tunable_1() _file="$1" if [ ! -r "$_file" ]; then + tunable_log "INFO" "Optional tunables file ${_file} not found" return fi @@ -130,7 +131,7 @@ ok_tunable() ok "${log}$(echo "$_map" | awk -F: '{ print $2 }')" } -export CTDB_DEBUGLEVEL="NOTICE" +export CTDB_DEBUGLEVEL="INFO" test_case "Unreadable file" : >"$tfile" -- 2.47.2