diff options
Diffstat (limited to 'source4/torture')
-rw-r--r-- | source4/torture/libnet/libnet_BecomeDC.c | 1 | ||||
-rw-r--r-- | source4/torture/local/torture.c | 37 | ||||
-rw-r--r-- | source4/torture/rpc/testjoin.c | 8 | ||||
-rw-r--r-- | source4/torture/util.h | 1 | ||||
-rw-r--r-- | source4/torture/util_provision.c | 4 |
5 files changed, 33 insertions, 18 deletions
diff --git a/source4/torture/libnet/libnet_BecomeDC.c b/source4/torture/libnet/libnet_BecomeDC.c index 3f8edd40e8..f8699fe06a 100644 --- a/source4/torture/libnet/libnet_BecomeDC.c +++ b/source4/torture/libnet/libnet_BecomeDC.c @@ -84,6 +84,7 @@ static NTSTATUS test_become_dc_prepare_db(void *private_data, settings.netbios_name = p->dest_dsa->netbios_name; settings.realm = torture_join_dom_dns_name(s->tj); settings.domain = torture_join_dom_netbios_name(s->tj); + settings.server_dn_str = torture_join_server_dn_str(s->tj); settings.machine_password = cli_credentials_get_password(s->machine_account); settings.targetdir = s->targetdir; diff --git a/source4/torture/local/torture.c b/source4/torture/local/torture.c index bb6e21ed4f..9bd60d9620 100644 --- a/source4/torture/local/torture.c +++ b/source4/torture/local/torture.c @@ -42,27 +42,28 @@ static bool test_tempdir(struct torture_context *tctx) static bool test_provision(struct torture_context *tctx) { NTSTATUS status; - struct provision_settings settings; - char *location = NULL; - torture_assert_ntstatus_ok(tctx, torture_temp_dir(tctx, "torture_provision", &location), + struct provision_settings *settings = talloc(tctx, struct provision_settings); + char *targetdir = NULL; + + torture_assert_ntstatus_ok(tctx, torture_temp_dir(tctx, "torture_provision", &targetdir), "torture_temp_dir should return NT_STATUS_OK" ); + settings->targetdir = talloc_steal(settings, targetdir); - settings.dns_name = "example.com"; - settings.site_name = "SOME-SITE-NAME"; - settings.root_dn_str = "DC=EXAMPLE,DC=COM"; - settings.domain_dn_str = "DC=EXAMPLE,DC=COM"; - settings.config_dn_str = NULL; - settings.schema_dn_str = NULL; - settings.invocation_id = NULL; - settings.netbios_name = "FOO"; - settings.realm = "EXAMPLE.COM"; - settings.domain = "EXAMPLE"; - settings.ntds_guid = NULL; - settings.ntds_dn_str = NULL; - settings.machine_password = "geheim"; - settings.targetdir = location; + settings->dns_name = "example.com"; + settings->site_name = "SOME-SITE-NAME"; + settings->root_dn_str = "DC=EXAMPLE,DC=COM"; + settings->domain_dn_str = "DC=EXAMPLE,DC=COM"; + settings->config_dn_str = NULL; + settings->schema_dn_str = NULL; + settings->invocation_id = NULL; + settings->netbios_name = "FOO"; + settings->realm = "EXAMPLE.COM"; + settings->domain = "EXAMPLE"; + settings->ntds_guid = NULL; + settings->ntds_dn_str = NULL; + settings->machine_password = "geheim"; - status = provision_bare(tctx, tctx->lp_ctx, &settings); + status = provision_bare(settings, tctx->lp_ctx, settings); torture_assert_ntstatus_ok(tctx, status, "provision"); diff --git a/source4/torture/rpc/testjoin.c b/source4/torture/rpc/testjoin.c index 02f04946d6..892886c08c 100644 --- a/source4/torture/rpc/testjoin.c +++ b/source4/torture/rpc/testjoin.c @@ -553,6 +553,14 @@ const char *torture_join_dom_dns_name(struct test_join *join) return join->dom_dns_name; } +const char *torture_join_server_dn_str(struct test_join *join) +{ + if (join->libnet_r) { + return join->libnet_r->out.server_dn_str; + } + return NULL; +} + #if 0 /* Left as the documentation of the join process, but see new implementation in libnet_become_dc.c */ struct test_join_ads_dc { diff --git a/source4/torture/util.h b/source4/torture/util.h index 477a828120..72f97e4766 100644 --- a/source4/torture/util.h +++ b/source4/torture/util.h @@ -27,6 +27,7 @@ struct provision_settings { const char *domain_dn_str; const char *config_dn_str; const char *schema_dn_str; + const char *server_dn_str; const struct GUID *invocation_id; const char *netbios_name; const char *host_ip; diff --git a/source4/torture/util_provision.c b/source4/torture/util_provision.c index cce8e18fdc..3167a37cdf 100644 --- a/source4/torture/util_provision.c +++ b/source4/torture/util_provision.c @@ -105,6 +105,10 @@ NTSTATUS provision_bare(TALLOC_CTX *mem_ctx, struct loadparm_context *lp_ctx, PyDict_SetItemString(parameters, "configdn", PyString_FromString(settings->config_dn_str)); + if (settings->server_dn_str) + PyDict_SetItemString(parameters, "serverdn", + PyString_FromString(settings->server_dn_str)); + if (settings->site_name) PyDict_SetItemString(parameters, "sitename", PyString_FromString(settings->site_name)); |