Want to add some extra info to smbtorture tests

Richard Sharpe realrichardsharpe at gmail.com
Tue Feb 19 13:13:02 MST 2013

Hi folks,

QA departments use smbtorture, and when tests fail I have to go to no
end of trouble to figure out what version of smbtorture they are
running and what they were actually testing against.

Now, it turns out that that info is available in the SessionSetup
response, so I would like to add something like this to smbtorture:

diff --git a/source4/torture/util_smb.c b/source4/torture/util_smb.c
index 343c8a7..1ed6168 100644
--- a/source4/torture/util_smb.c
+++ b/source4/torture/util_smb.c
@@ -814,6 +814,9 @@ static bool wrap_simple_1smb_test(struct torture_context *to

        torture_assert_goto(torture_ctx, torture_open_connection(&cli1, torture_

+       printf("Remote OS: %s, Lan Manager: %s\n",
+               cli1->session->os, cli1->session->lanman);
        fn = test->fn;

        ret = fn(torture_ctx, cli1);

Now, this is not the correct place, because it only gets one test, but
it is the earliest that we have that info. We get the following in the

test: sumtab
time: 2013-02-19 12:08:32.612917
Remote OS: Unix, Lan Manager: Samba 3.6.12
time: 2013-02-19 12:08:32.826263
success: sumtab

Of course, I will have to extend the smb2 session setup code in
libcli/smb to capture this info as well, but it seems worth it. It
might also be worth listing the version of the protocol being used.

Any comments, objectionsm etc?

Richard Sharpe

More information about the samba-technical mailing list