Pass discovered server DN down to provision.
authorAndrew Bartlett <abartlet@samba.org>
Fri, 4 Apr 2008 01:55:45 +0000 (12:55 +1100)
committerAndrew Bartlett <abartlet@samba.org>
Fri, 4 Apr 2008 01:55:45 +0000 (12:55 +1100)
This uses the new 'serverdn' argument added to provision in the
previous commit.

Andrew Bartlett

source/torture/libnet/libnet_BecomeDC.c
source/torture/rpc/testjoin.c
source/torture/util.h
source/torture/util_provision.c

index 3f8edd40e845d65215052b64893c7ea155ac4a81..f8699fe06abaccd4bfcef313e85443b7128322dc 100644 (file)
@@ -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;
 
index 02f04946d6e2adc2f6f56fee4246258a2eef5335..892886c08c53ceceda7501ac594267bf5cf1394d 100644 (file)
@@ -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 {
index 477a828120173cb97715d11a90f7bf107c443450..72f97e4766a7297f79ed88119b03203f2969f5eb 100644 (file)
@@ -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;
index cce8e18fdcc7772ee1dc5acf607d3aca8935decd..3167a37cdf7b616cb19d2339c14577991e0f55e8 100644 (file)
@@ -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));