summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndrew Bartlett <abartlet@samba.org>2008-04-11 19:37:23 +1000
committerAndrew Bartlett <abartlet@samba.org>2008-04-11 19:37:23 +1000
commit6a7acf3952af5ecf2fe7d44a07a54d887ed7596c (patch)
treec6d1a0f143c844c2013d102a691c1b1238a50524
parentc82e9c9f6dce7968d807a2b58527a86134026168 (diff)
downloadsamba-6a7acf3952af5ecf2fe7d44a07a54d887ed7596c.tar.gz
samba-6a7acf3952af5ecf2fe7d44a07a54d887ed7596c.tar.bz2
samba-6a7acf3952af5ecf2fe7d44a07a54d887ed7596c.zip
Reuse the lp_ctx and samdb returned by the python provision.
Apply the same fix as in libnet_vampire in the old DRS test code. Andrew Bartlett (This used to be commit 34adb0e0bb1b3c340d7098e7a3d12f73f798d0e7)
-rw-r--r--source4/torture/libnet/libnet_BecomeDC.c38
1 files changed, 2 insertions, 36 deletions
diff --git a/source4/torture/libnet/libnet_BecomeDC.c b/source4/torture/libnet/libnet_BecomeDC.c
index 3305a814f5..4d57a84582 100644
--- a/source4/torture/libnet/libnet_BecomeDC.c
+++ b/source4/torture/libnet/libnet_BecomeDC.c
@@ -69,13 +69,6 @@ static NTSTATUS test_become_dc_prepare_db(void *private_data,
struct provision_settings settings;
struct provision_result result;
NTSTATUS status;
- bool ok;
- struct loadparm_context *lp_ctx = loadparm_init(s);
- char *smbconf;
-
- if (!lp_ctx) {
- return NT_STATUS_NO_MEMORY;
- }
settings.site_name = p->dest_dsa->site_name;
settings.root_dn_str = p->forest->root_dn_str;
@@ -91,35 +84,8 @@ static NTSTATUS test_become_dc_prepare_db(void *private_data,
status = provision_bare(s, s->lp_ctx, &settings, &result);
- smbconf = talloc_asprintf(lp_ctx, "%s/%s", s->targetdir, "/etc/smb.conf");
-
- ok = lp_load(lp_ctx, smbconf);
- if (!ok) {
- DEBUG(0,("Failed load freshly generated smb.conf '%s'\n", smbconf));
- return NT_STATUS_INVALID_PARAMETER;
- }
-
- s->ldb = ldb_wrap_connect(s, lp_ctx, lp_sam_url(lp_ctx),
- system_session(s, lp_ctx),
- NULL, 0, NULL);
- if (!s->ldb) {
- DEBUG(0,("Failed to open '%s'\n", lp_sam_url(lp_ctx)));
- return NT_STATUS_INTERNAL_DB_ERROR;
- }
-
- ok = samdb_set_ntds_invocation_id(s->ldb, &p->dest_dsa->invocation_id);
- if (!ok) {
- DEBUG(0,("Failed to set cached ntds invocationId\n"));
- return NT_STATUS_FOOBAR;
- }
- ok = samdb_set_ntds_objectGUID(s->ldb, &p->dest_dsa->ntds_guid);
- if (!ok) {
- DEBUG(0,("Failed to set cached ntds objectGUID\n"));
- return NT_STATUS_FOOBAR;
- }
-
- s->lp_ctx = lp_ctx;
-
+ s->ldb = result.samdb;
+ s->lp_ctx = result.lp_ctx;
return NT_STATUS_OK;