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)
committerStefan Metzmacher <metze@samba.org>
Sun, 18 Nov 2012 18:06:50 +0000 (19:06 +0100)
source4/torture/rpc/handles.c

index 6b51eb5ab48548d52571860176b3c490ae07101d..97f4d9f55a7739d52bd0a541efbdd5977504d4e1 100644 (file)
@@ -504,10 +504,15 @@ static bool test_handles_random_assoc(struct torture_context *torture)
        status = torture_rpc_connection(torture, &p1, &ndr_table_samr);
        torture_assert_ntstatus_ok(torture, status, "opening samr pipe1");
 
-       transport       = p1->conn->transport.transport;
-       assoc_group_id  = p1->assoc_group_id;
+       torture_comment(torture, "pipe1 uses assoc_group_id[0x%08X]\n",
+                       p1->assoc_group_id);
 
-       torture_comment(torture, "pipe1 uses assoc_group_id[0x%08X]\n", assoc_group_id);
+       transport       = p1->conn->transport.transport;
+       /*
+        * we use ~p1->assoc_group_id because it means we are less likely
+        * 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,