1
0
mirror of https://github.com/samba-team/samba.git synced 2024-12-23 17:34:34 +03:00
samba-mirror/ctdb/tests/UNIT/cunit/config_test_002.sh
Martin Schwenke 51d0445a7d ctdb-logging: Really make NOTICE the default debug level
NOTICE level debug messages in common/run_event.c are not logged by
default.

Currently eventd ends up using ERROR, since this is specified as
LOGGING_LOG_LEVEL_DEFAULT.  It doesn't inherit the debug level from
ctdbd and only uses NOTICE level when interactive.

Change the real logging default to NOTICE and use it everywhere.

Followups might be:

* Remove the default_log_level argument to logging_conf_init()
* Kick eventd to update debug level when "ctdb setdebug" is used

Signed-off-by: Martin Schwenke <mschwenke@ddn.com>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
2023-07-10 14:21:30 +00:00

66 lines
1016 B
Bash
Executable File

#!/bin/sh
. "${TEST_SCRIPTS_DIR}/unit.sh"
PATH="$PATH:$CTDB_SCRIPTS_TOOLS_HELPER_DIR"
setup_ctdb_base "${CTDB_TEST_TMP_DIR}" "ctdb-etc"
conffile="${CTDB_BASE}/ctdb.conf"
remove_files ()
{
rm -f "$conffile"
}
test_cleanup remove_files
cat > "$conffile" <<EOF
EOF
ok <<EOF
NOTICE
EOF
unit_test ctdb-config get "logging" "log level"
cat > "$conffile" <<EOF
[logging]
location = syslog:magic
EOF
required_result 22 <<EOF
conf: validation for option "location" failed
Failed to load config file $conffile
EOF
unit_test ctdb-config validate
cat > "$conffile" <<EOF
[logging]
log level = high
EOF
required_result 22 <<EOF
conf: validation for option "log level" failed
Failed to load config file $conffile
EOF
unit_test ctdb-config validate
cat > "$conffile" <<EOF
[logging]
location = syslog
log level = notice
EOF
ok_null
unit_test ctdb-config validate
ok <<EOF
syslog
EOF
unit_test ctdb-config get "logging" "location"
ok <<EOF
notice
EOF
unit_test ctdb-config get "logging" "log level"