s4:torture/rpc/handles: try to make the assoc_group test less flakey
authorStefan Metzmacher <metze@samba.org>
Wed, 14 Nov 2012 07:45:10 +0000 (08:45 +0100)
committerMichael Adam <obnox@samba.org>
Tue, 20 Nov 2012 16:37:19 +0000 (17:37 +0100)
Just incrementing the assoc_group_id makes it too likely to hit
a number that is already in use.

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
source4/torture/rpc/handles.c

index 9dfa1c0238dc4074fde456eca21b88b25e6153ea..3fdce5672e28e0f4ba82aff3669895146ada8af0 100644 (file)
@@ -508,7 +508,11 @@ static bool test_handles_random_assoc(struct torture_context *torture)
                        p1->assoc_group_id);
 
        transport       = p1->conn->transport.transport;
-       assoc_group_id  = p1->assoc_group_id;
+       /*
+        * We use ~p1->assoc_group_id instead of p1->assoc_group_id, because
+        * this way we are less likely to use an id which is already in use.
+        */
+       assoc_group_id  = ~p1->assoc_group_id;
 
        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,