Want to add some extra info to smbtorture tests

Andrew Bartlett abartlet at samba.org
Tue Feb 19 14:23:15 MST 2013


On Tue, 2013-02-19 at 12:13 -0800, Richard Sharpe wrote:
> 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
> log:
> 
> 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.

This seems reasonable to me, but please use the torture_comment() macro
for anything you need to print out during a test.  

Andrew Bartlett

-- 
Andrew Bartlett                                http://samba.org/~abartlet/
Authentication Developer, Samba Team           http://samba.org




More information about the samba-technical mailing list