]> git.ipfire.org Git - thirdparty/samba.git/commitdiff
s4:torture: make rpc.handles.random-assoc test even more robust
authorStefan Metzmacher <metze@samba.org>
Mon, 27 Jan 2020 15:45:44 +0000 (16:45 +0100)
committerStefan Metzmacher <metze@samba.org>
Thu, 6 Feb 2020 14:57:41 +0000 (14:57 +0000)
This improves commit bebee47e6386476e9948089484f89d213fcc2660 a bit
further.

I just got this:

  connect samr pipe1
  use assoc_group_id[0x00000001] for new connections
  connect lsa pipe2
  got assoc_group_id[0x00000001] for p2
  samr_Connect to open a policy handle on samr p1
  use policy handle on lsa p2 - should fail
  closing policy handle on samr p1
  connect samr pipe3 - should fail
  Failed to bind to uuid 12345778-1234-abcd-ef00-0123456789ac for ncacn_np:localdc[\pipe\samr,validate,assoc_group_id=0x00000001,abstract_syntax=12345778-1234-abcd-ef00-0123456789ac/0x00000001] NT_STATUS_UNSUCCESSFUL
  connect lsa pipe4 - should fail
  Failed to bind to uuid 12345778-1234-abcd-ef00-0123456789ab for ncacn_np:localdc[\pipe\lsarpc,validate,assoc_group_id=0x00000001,abstract_syntax=12345778-1234-abcd-ef00-0123456789ab/0x00000000] NT_STATUS_UNSUCCESSFUL
  connect samr pipe5 with assoc_group_id[0xFFFFFFFF]- should fail
  Failed to bind to uuid 12345778-1234-abcd-ef00-0123456789ac for ncacn_np:localdc[\pipe\samr,validate,assoc_group_id=0xffffffff,abstract_syntax=12345778-1234-abcd-ef00-0123456789ac/0x00000001] NT_STATUS_UNSUCCESSFUL
  connect lsa pipe6 with assoc_group_id[0x00000000]- should fail
  UNEXPECTED(failure): samba4.rpc.handles on ncacn_np with validate.mixed-shared(ad_dc_ntvfs)
  REASON: Exception: Exception: ../../source4/torture/rpc/handles.c:500: status was NT_STATUS_OK, expected NT_STATUS_UNSUCCESSFUL: opening lsa pipe6
  FAILED (1 failures, 0 errors and 0 unexpected successes in 0 testsuites)
  A summary with detailed information can be found in:

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
source4/torture/rpc/handles.c

index ae6a55eb965ba7af18ba81a259a9632b8692203e..7c108e56e1ae39900938f90dcbf54978facca626 100644 (file)
@@ -529,7 +529,7 @@ static bool test_handles_random_assoc(struct torture_context *torture)
         * And make sure it doesn't wrap.
         */
        assoc_group_id = dcerpc_binding_get_assoc_group_id(p1->binding);
-       assoc_group_id = MIN(~assoc_group_id, UINT32_MAX - 3);
+       assoc_group_id = ~MIN(assoc_group_id, UINT32_MAX - 3);
 
        torture_comment(torture, "connect samr pipe2 with assoc_group_id[0x%08X]- should fail\n", ++assoc_group_id);
        status = torture_rpc_connection_transport(torture, &p2, &ndr_table_samr,