]> git.ipfire.org Git - thirdparty/samba.git/commitdiff
smbtorture: Allow debugging output to be configured using smb.conf parameters
authorPavel Filipenský <pfilipensky@samba.org>
Sun, 13 Oct 2024 19:57:27 +0000 (21:57 +0200)
committerVolker Lendecke <vl@samba.org>
Mon, 14 Oct 2024 07:32:50 +0000 (07:32 +0000)
It might be useful to see timestamps for some smbtorture tests.

Timestamps can be printed via 'debug syslog format=always'.
It can be specified either in smb.conf or directly via smbtorture option
-T 'OPTION=VALUE'     smb.conf option line

However, smbtorture is not evaluating the option. It needs to call
reopen_logs()->debug_set_settings() to copy
'Globals.debug_syslog_format' to 'state->settings.debug_syslog_format'

$ bin/smbtorture3 //foo/bar -U% LOCAL-G-LOCK4 -d10 -T 'debug syslog format=always'

Before:

dbwrap_lock_order_unlock: release lock order 3 for /home/pfilipen/ws/projects/samba/smbtorture/st/client/lockdir/g_lock.tdb
waited
child 2473726 exited with 0
g_lock_lock_retry: watch_recv returned NT_STATUS_OK

After (see 1 sec delay):

2024-10-13T21:26:56.476859+00:00 addc.addom.samba.example.com smbtorture[2473806]: dbwrap_lock_order_unlock: release lock order 3 for /home/pfilipen/ws/projects/samba/smbtorture/st/client/lockdir/g_lock.tdb
waited
child 2473807 exited with 0
2024-10-13T21:26:57.487363+00:00 addc.addom.samba.example.com smbtorture[2473806]: g_lock_lock_retry: watch_recv returned NT_STATUS_OK

Signed-off-by: Pavel Filipenský <pfilipensky@samba.org>
Reviewed-by: Volker Lendecke <vl@samba.org>
source3/torture/torture.c

index 67f1b19b169f7263ef528934d3899630184ea25e..36f0d99d911176954649bc5114d050e2471d27a3 100644 (file)
@@ -16550,6 +16550,8 @@ static void usage(void)
                }
        }
 
+       reopen_logs();
+
        printf("host=%s share=%s user=%s myname=%s\n",
               host, share, username, myname);