summaryrefslogtreecommitdiff
path: root/source4/torture
diff options
context:
space:
mode:
authorJelmer Vernooij <jelmer@samba.org>2008-04-13 22:49:08 +0200
committerJelmer Vernooij <jelmer@samba.org>2008-04-13 22:49:08 +0200
commit60a6682c855cbe5094433881649e7ed4945a06e7 (patch)
treed66516ad8b6695335b6ded31bb664b5eaf86d59f /source4/torture
parent148d3b170ae00d4001fa011450c7238052d32ae2 (diff)
parent6b013c90fda01974ac0c27ac035ce78958276aad (diff)
downloadsamba-60a6682c855cbe5094433881649e7ed4945a06e7.tar.gz
samba-60a6682c855cbe5094433881649e7ed4945a06e7.tar.bz2
samba-60a6682c855cbe5094433881649e7ed4945a06e7.zip
Merge branch 'v4-0-test' of ssh://git.samba.org/data/git/samba into cprovision
(This used to be commit 9b8448c1e4567be26fa4890c647e0d4d46efbe20)
Diffstat (limited to 'source4/torture')
-rw-r--r--source4/torture/libnet/libnet_BecomeDC.c39
-rw-r--r--source4/torture/local/torture.c5
2 files changed, 4 insertions, 40 deletions
diff --git a/source4/torture/libnet/libnet_BecomeDC.c b/source4/torture/libnet/libnet_BecomeDC.c
index a9a7773649..4d57a84582 100644
--- a/source4/torture/libnet/libnet_BecomeDC.c
+++ b/source4/torture/libnet/libnet_BecomeDC.c
@@ -69,15 +69,7 @@ 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.dns_name = p->dest_dsa->dns_name;
settings.site_name = p->dest_dsa->site_name;
settings.root_dn_str = p->forest->root_dn_str;
settings.domain_dn_str = p->domain->dn_str;
@@ -92,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;
diff --git a/source4/torture/local/torture.c b/source4/torture/local/torture.c
index 17d83456d5..7935f6cc35 100644
--- a/source4/torture/local/torture.c
+++ b/source4/torture/local/torture.c
@@ -43,7 +43,7 @@ static bool test_tempdir(struct torture_context *tctx)
static bool test_provision(struct torture_context *tctx)
{
NTSTATUS status;
- struct provision_settings *settings = talloc(tctx, struct provision_settings);
+ struct provision_settings *settings = talloc_zero(tctx, struct provision_settings);
struct provision_result result;
char *targetdir = NULL;
@@ -51,7 +51,6 @@ static bool test_provision(struct torture_context *tctx)
"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";
@@ -61,7 +60,7 @@ static bool test_provision(struct torture_context *tctx)
settings->netbios_name = "FOO";
settings->realm = "EXAMPLE.COM";
settings->domain = "EXAMPLE";
- settings->ntds_guid = NULL;
+ settings->netbios_name = "torture";
settings->ntds_dn_str = NULL;
settings->machine_password = "geheim";