From: Pavel Filipenský Date: Sat, 30 Nov 2024 19:49:05 +0000 (+0100) Subject: s3:tests: Make winbind_call_depth_trace to use global_inject.conf X-Git-Tag: tdb-1.4.13~417 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=26cb20fb7e553beabf91f81b9133766c277e123e;p=thirdparty%2Fsamba.git s3:tests: Make winbind_call_depth_trace to use global_inject.conf To get the expected traces we need: debug syslog format = no log level = 10 Signed-off-by: Pavel Filipenský Reviewed-by: Andreas Schneider --- diff --git a/source3/script/tests/test_winbind_call_depth_trace.sh b/source3/script/tests/test_winbind_call_depth_trace.sh index 6d978beca8f..e3cd441f0a7 100755 --- a/source3/script/tests/test_winbind_call_depth_trace.sh +++ b/source3/script/tests/test_winbind_call_depth_trace.sh @@ -34,43 +34,22 @@ EOF exit 0 fi -saved_level=1 - -get_winbind_loglevel() -{ - s1=$(${SMBCONTROL} "${CONFIGURATION}" winbind debuglevel) - # We need to get the all level from output like this: - # "PID 664474: all:1 tdb:1 printdrivers:1 lanman:1 smb:1 rpc_parse:1 rpc_srv:1 rpc_cli:1 passdb:1 sam:1..." - # 1. remove PID 664474: - s2=${s1#PID*: } - # "all:1 tdb:1 printdrivers:1 lanman:1 smb:1 rpc_parse:1 rpc_srv:1 rpc_cli:1 passdb" - # 2. remove " tdb:1 printdrivers:1 ..." - s3=${s2%% *} - # "all:1" - # 3. remove "all:" - saved_level=${s3#all:} -} - # Example of trace line # [2023/01/25 00:20:33.307038, 5, pid=535581, effective(0, 0), real(0, 0), class=winbind, traceid=78, depth=4] ../../source3/winbindd/wb_group_members.c:310(wb_group_members_send) test_winbind_call_depth_trace() { - get_winbind_loglevel - - # If loglevel < 10, set it to 10. - if [ "$saved_level" -lt 10 ]; then - ${SMBCONTROL} "${CONFIGURATION}" winbind debug 10 - fi + global_inject_conf=$(dirname $SMB_CONF_PATH)/global_inject.conf + echo "debug syslog format = no" >$global_inject_conf + echo "log level = 10" >>$global_inject_conf + ${SMBCONTROL} "${CONFIGURATION}" winbind reload-config COUNT1=$(grep -c wb_group_members_send "$LOGFILE") id ADDOMAIN/alice ret=$? - # Restore loglevel, if it was changed. - if [ "$saved_level" -lt 10 ]; then - ${SMBCONTROL} "${CONFIGURATION}" winbind debug "$saved_level" - fi + echo "" >$global_inject_conf + ${SMBCONTROL} "${CONFIGURATION}" winbind reload-config if [ $ret != 0 ]; then echo "Command 'id ADDOMAIN/alice' failed!"