Add multichannel tests to smbtorture

Jeremy Allison jra at samba.org
Wed Apr 17 17:33:10 UTC 2019


On Tue, Apr 16, 2019 at 04:54:50PM +0200, Günther Deschner wrote:
> On 27/03/2019 19:31, Jeremy Allison via samba-technical wrote:
> > Guenther, are you able to be second Team reviewer here ?
> 
> Yes, of course :) Sorry, forgot to mention that all of these patches
> were reviewed by me earlier, so Sachin, please upload the same series
> with my RB+ added :)

Only two comments:

[PATCH 03/19] s4-torture: move oplock break handler out of the replay testsuite.

Add include guards around new source4/torture/smb2/oplock_break_handler.h file.

PATCH 09/19] s4-torture: add torture_block/torture_unblock smb2 transport functions

Change: samba_chain_name(..., bool) -> samba_chain_name(..., const char *prefix)

where prefix is passed as "SAMBA_INPUT" or "SAMBA_OUTPUT" instead
of 'true'/'false'. bool args make it impossible to see what this
is doing without looking inside the function, using the strings
directly make it obvious.

Unfortunately when I compile to test I'm getting errors using:

--enable-developer --picky-developer

Errors are below. Can you fix these up and resubmit please ?

Most of them are just things like adding "const" to the last
argument of _test_block_channel() etc. and removing unused
variables.

The only one you might need to look at carefully is the

../../source4/torture/smb2/multichannel.c: In function ‘test_ioctl_network_interface_info’:
../../source4/torture/smb2/multichannel.c:135:15: error: ‘struct <anonymous>’ has no member named ‘max_response_size’
  ioctl.smb2.in.max_response_size = 0x10000;

one, as I'm not 100% sure what you're doing here.

This does look like a great enhancement to our test
code, thanks !

Cheers,

	Jeremy.

-----------------------------------------------------------------------------------------------------------------------
[3189/4213] Compiling source4/torture/smb2/multichannel.c
../../source4/torture/smb2/multichannel.c: In function ‘test_ioctl_network_interface_info’:
../../source4/torture/smb2/multichannel.c:135:15: error: ‘struct <anonymous>’ has no member named ‘max_response_size’
  ioctl.smb2.in.max_response_size = 0x10000;
               ^
../../source4/torture/smb2/multichannel.c: In function ‘test_multichannel_create_channel’:
../../source4/torture/smb2/multichannel.c:178:7: error: variable ‘ret’ set but not used [-Werror=unused-but-set-variable]
  bool ret = true;
       ^~~
../../source4/torture/smb2/multichannel.c: In function ‘test_multichannel_oplock_break_test2’:
../../source4/torture/smb2/multichannel.c:761:48: error: passing argument 3 of ‘_test_block_channel’ discards ‘const’ qualifier from pointer target type [-Werror=discarded-qualifiers]
  block_ok = test_block_channel(tctx, transport2);
                                                ^
../../source4/torture/smb2/multichannel.c:402:71: note: in definition of macro ‘test_block_channel’
 #define test_block_channel(_tctx, _t) _test_block_channel(_tctx, _t, #_t)
                                                                       ^~
../../source4/torture/smb2/multichannel.c:403:13: note: expected ‘char *’ but argument is of type ‘const char *’
 static bool _test_block_channel(struct torture_context *tctx,
             ^~~~~~~~~~~~~~~~~~~
../../source4/torture/smb2/multichannel.c:845:40: error: passing argument 3 of ‘_test_unblock_channel’ discards ‘const’ qualifier from pointer target type [-Werror=discarded-qualifiers]
   test_unblock_channel(tctx, transport2);
                                        ^
../../source4/torture/smb2/multichannel.c:417:75: note: in definition of macro ‘test_unblock_channel’
 #define test_unblock_channel(_tctx, _t) _test_unblock_channel(_tctx, _t, #_t)
                                                                           ^~
../../source4/torture/smb2/multichannel.c:418:13: note: expected ‘char *’ but argument is of type ‘const char *’
 static bool _test_unblock_channel(struct torture_context *tctx,
             ^~~~~~~~~~~~~~~~~~~~~
../../source4/torture/smb2/multichannel.c: In function ‘test_multichannel_lease_break_test1’:
../../source4/torture/smb2/multichannel.c:922:25: error: variable ‘transport2C’ set but not used [-Werror=unused-but-set-variable]
  struct smb2_transport *transport2C = NULL;
                         ^~~~~~~~~~~
../../source4/torture/smb2/multichannel.c:921:25: error: variable ‘transport2B’ set but not used [-Werror=unused-but-set-variable]
  struct smb2_transport *transport2B = NULL;
                         ^~~~~~~~~~~
../../source4/torture/smb2/multichannel.c:920:25: error: variable ‘transport2A’ set but not used [-Werror=unused-but-set-variable]
  struct smb2_transport *transport2A = NULL;
                         ^~~~~~~~~~~
../../source4/torture/smb2/multichannel.c: In function ‘test_multichannel_lease_break_test2’:
../../source4/torture/smb2/multichannel.c:1221:49: error: passing argument 3 of ‘_test_block_channel’ discards ‘const’ qualifier from pointer target type [-Werror=discarded-qualifiers]
  block_ok = test_block_channel(tctx, transport2A);
                                                 ^
../../source4/torture/smb2/multichannel.c:402:71: note: in definition of macro ‘test_block_channel’
 #define test_block_channel(_tctx, _t) _test_block_channel(_tctx, _t, #_t)
                                                                       ^~
../../source4/torture/smb2/multichannel.c:403:13: note: expected ‘char *’ but argument is of type ‘const char *’
 static bool _test_block_channel(struct torture_context *tctx,
             ^~~~~~~~~~~~~~~~~~~
../../source4/torture/smb2/multichannel.c:1275:53: error: passing argument 3 of ‘_test_unblock_channel’ discards ‘const’ qualifier from pointer target type [-Werror=discarded-qualifiers]
  unblock_ok = test_unblock_channel(tctx, transport2A);
                                                     ^
../../source4/torture/smb2/multichannel.c:417:75: note: in definition of macro ‘test_unblock_channel’
 #define test_unblock_channel(_tctx, _t) _test_unblock_channel(_tctx, _t, #_t)
                                                                           ^~
../../source4/torture/smb2/multichannel.c:418:13: note: expected ‘char *’ but argument is of type ‘const char *’
 static bool _test_unblock_channel(struct torture_context *tctx,
             ^~~~~~~~~~~~~~~~~~~~~
../../source4/torture/smb2/multichannel.c:1369:41: error: passing argument 3 of ‘_test_unblock_channel’ discards ‘const’ qualifier from pointer target type [-Werror=discarded-qualifiers]
   test_unblock_channel(tctx, transport2A);
                                         ^
../../source4/torture/smb2/multichannel.c:417:75: note: in definition of macro ‘test_unblock_channel’
 #define test_unblock_channel(_tctx, _t) _test_unblock_channel(_tctx, _t, #_t)
                                                                           ^~
../../source4/torture/smb2/multichannel.c:418:13: note: expected ‘char *’ but argument is of type ‘const char *’
 static bool _test_unblock_channel(struct torture_context *tctx,
             ^~~~~~~~~~~~~~~~~~~~~
../../source4/torture/smb2/multichannel.c: In function ‘test_multichannel_lease_break_test3’:
../../source4/torture/smb2/multichannel.c:1431:23: error: unused variable ‘session1’ [-Werror=unused-variable]
  struct smb2_session *session1 = tree1->session;
                       ^~~~~~~~
../../source4/torture/smb2/multichannel.c: In function ‘test4_lease_break_handler’:
../../source4/torture/smb2/multichannel.c:1548:14: error: unused variable ‘mem_ctx’ [-Werror=unused-variable]
  TALLOC_CTX *mem_ctx = test4_tree2->session->transport->ev;
              ^~~~~~~
../../source4/torture/smb2/multichannel.c:1546:14: error: unused variable ‘fname’ [-Werror=unused-variable]
  const char *fname = BASEDIR "\\lease_break_test1.dat";
              ^~~~~
../../source4/torture/smb2/multichannel.c: In function ‘test_multichannel_lease_break_test4’:
../../source4/torture/smb2/multichannel.c:1603:21: error: unused variable ‘h_client2_file3’ [-Werror=unused-variable]
  struct smb2_handle h_client2_file3 = { 0 };
                     ^~~~~~~~~~~~~~~
../../source4/torture/smb2/multichannel.c:1602:21: error: unused variable ‘h_client2_file2’ [-Werror=unused-variable]
  struct smb2_handle h_client2_file2 = { 0 };
                     ^~~~~~~~~~~~~~~
../../source4/torture/smb2/multichannel.c:1600:21: error: unused variable ‘h_client1_file3’ [-Werror=unused-variable]
  struct smb2_handle h_client1_file3 = { 0 };
                     ^~~~~~~~~~~~~~~
../../source4/torture/smb2/multichannel.c:1599:21: error: unused variable ‘h_client1_file2’ [-Werror=unused-variable]
  struct smb2_handle h_client1_file2 = { 0 };
                     ^~~~~~~~~~~~~~~
cc1: all warnings being treated as errors

Waf: Leaving directory `/space/jra/src/samba/git/reviews/bin/default'
Build failed
 -> task in 'TORTURE_SMB2' failed with exit status 1 (run with -v to display more information)
Makefile:7: recipe for target 'all' failed
make: *** [all] Error 1



More information about the samba-technical mailing list