torture-drsuapi: Make the name of the dc variable
authorMatthieu Patou <mat@debian>
Wed, 31 Jul 2013 04:45:59 +0000 (21:45 -0700)
committerMatthieu Patou <mat@matws.net>
Wed, 7 Aug 2013 04:21:09 +0000 (21:21 -0700)
In case some tests fails or if the removal takes sometime to replicate
to all the DCs

Reviewed-By: Andrew Bartlett <abarlett@samba.org>
source4/torture/rpc/drsuapi.c

index 86b0d3276853a0259cf5055a2ce23dc398c4c797..46f9505ef2cbd5f291e670f435479eb926630447 100644 (file)
@@ -774,7 +774,9 @@ bool torture_rpc_drsuapi_get_dcinfo(struct torture_context *torture,
  */
 bool torture_drsuapi_tcase_setup_common(struct torture_context *tctx, struct DsPrivate *priv)
 {
-        NTSTATUS status;
+       NTSTATUS status;
+       int rnd = rand() % 1000;
+       char *name = talloc_asprintf(tctx, "%s%d", TEST_MACHINE_NAME, rnd);
        struct cli_credentials *machine_credentials;
 
        torture_assert(tctx, priv, "Invalid argument");
@@ -785,8 +787,8 @@ bool torture_drsuapi_tcase_setup_common(struct torture_context *tctx, struct DsP
                                        &ndr_table_drsuapi);
        torture_assert(tctx, NT_STATUS_IS_OK(status), "Unable to connect to DRSUAPI pipe");
 
-       torture_comment(tctx, "About to join domain\n");
-       priv->join = torture_join_domain(tctx, TEST_MACHINE_NAME, ACB_SVRTRUST,
+       torture_comment(tctx, "About to join domain with name %s\n", name);
+       priv->join = torture_join_domain(tctx, name, ACB_SVRTRUST,
                                         &machine_credentials);
        torture_assert(tctx, priv->join, "Failed to join as BDC");