smbtorture: Allow debugging output to be configured using smb.conf parameters
commita4dea49411fc179ce74afc02ab34df4d8cff9bec
authorPavel Filipenský <pfilipensky@samba.org>
Sun, 13 Oct 2024 19:57:27 +0000 (13 21:57 +0200)
committerVolker Lendecke <vl@samba.org>
Mon, 14 Oct 2024 07:32:50 +0000 (14 07:32 +0000)
tree94536af534f6b4fa74465e7f2837182f2d22f231
parent9263ce5752063235836d5f77220b0151df6c9408
smbtorture: Allow debugging output to be configured using smb.conf parameters

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