From 3f2e403a8672323517e9a5efc4026d58f22fe75b Mon Sep 17 00:00:00 2001 From: Andrew Bartlett Date: Tue, 8 Apr 2008 17:26:55 +1000 Subject: Rework talloc hirarchy for C provision setup. This seems to fix (or sweep under the covers) a crash in this code. Andrew Bartlett (This used to be commit 2fcddfe583f9833cea80d02e08ac12dd1f91742c) --- source4/torture/local/torture.c | 37 +++++++++++++++++++------------------ 1 file changed, 19 insertions(+), 18 deletions(-) (limited to 'source4/torture/local') 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"); -- cgit From 82c7872639d48a2791e409f8cd014978c4aa352f Mon Sep 17 00:00:00 2001 From: Jelmer Vernooij Date: Wed, 9 Apr 2008 03:23:13 +0200 Subject: Move provision C bindings to param/. (This used to be commit 7d45ed0c3ebc57f7131603f768f8e022d7139530) --- source4/torture/local/torture.c | 1 + 1 file changed, 1 insertion(+) (limited to 'source4/torture/local') diff --git a/source4/torture/local/torture.c b/source4/torture/local/torture.c index 9bd60d9620..718bd38aad 100644 --- a/source4/torture/local/torture.c +++ b/source4/torture/local/torture.c @@ -25,6 +25,7 @@ #include "lib/events/events.h" #include "libcli/raw/libcliraw.h" #include "torture/util.h" +#include "param/provision.h" static bool test_tempdir(struct torture_context *tctx) { -- cgit From ad8e3e41923e20d401294eccd4da028e0f40c904 Mon Sep 17 00:00:00 2001 From: Jelmer Vernooij Date: Thu, 10 Apr 2008 05:23:17 +0200 Subject: Add infrastructure for returning ProvisionResult in C provision code. (This used to be commit 98c3d34eb233be284e8c8994cca337be25c72968) --- source4/torture/local/torture.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'source4/torture/local') diff --git a/source4/torture/local/torture.c b/source4/torture/local/torture.c index 718bd38aad..17d83456d5 100644 --- a/source4/torture/local/torture.c +++ b/source4/torture/local/torture.c @@ -44,6 +44,7 @@ static bool test_provision(struct torture_context *tctx) { NTSTATUS status; struct provision_settings *settings = talloc(tctx, struct provision_settings); + struct provision_result result; char *targetdir = NULL; torture_assert_ntstatus_ok(tctx, torture_temp_dir(tctx, "torture_provision", &targetdir), @@ -64,10 +65,13 @@ static bool test_provision(struct torture_context *tctx) settings->ntds_dn_str = NULL; settings->machine_password = "geheim"; - status = provision_bare(settings, tctx->lp_ctx, settings); + status = provision_bare(settings, tctx->lp_ctx, settings, &result); torture_assert_ntstatus_ok(tctx, status, "provision"); + torture_assert_str_equal(tctx, result.domaindn, "DC=EXAMPLE,DC=COM", + "domaindn incorrect"); + return true; } -- cgit From 9198a519bea19a4d9f863fde5fb3aa23f60b5c88 Mon Sep 17 00:00:00 2001 From: Andrew Bartlett Date: Fri, 11 Apr 2008 11:09:34 +1000 Subject: Set a netbios name into provision, and zero the rest. Remove dns_name initialisation. Andrew Bartlett (This used to be commit e77ab2fbd1836bc2f9c7b2a819b06ddccf1fa78f) --- source4/torture/local/torture.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'source4/torture/local') diff --git a/source4/torture/local/torture.c b/source4/torture/local/torture.c index 718bd38aad..83c531124d 100644 --- a/source4/torture/local/torture.c +++ b/source4/torture/local/torture.c @@ -43,14 +43,13 @@ 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); 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"; @@ -60,6 +59,7 @@ static bool test_provision(struct torture_context *tctx) settings->netbios_name = "FOO"; settings->realm = "EXAMPLE.COM"; settings->domain = "EXAMPLE"; + settings->netbios_name = "torture"; settings->ntds_guid = NULL; settings->ntds_dn_str = NULL; settings->machine_password = "geheim"; -- cgit From c82e9c9f6dce7968d807a2b58527a86134026168 Mon Sep 17 00:00:00 2001 From: Andrew Bartlett Date: Fri, 11 Apr 2008 19:35:15 +1000 Subject: Don't specify the ntds_guid to the C -> python provision interface This paramter was not used anyway. Andrew Bartlett (This used to be commit 6875e6823f7a1fe9066bff4dffcab658a17d3b8c) --- source4/torture/local/torture.c | 1 - 1 file changed, 1 deletion(-) (limited to 'source4/torture/local') diff --git a/source4/torture/local/torture.c b/source4/torture/local/torture.c index b48b191be6..7935f6cc35 100644 --- a/source4/torture/local/torture.c +++ b/source4/torture/local/torture.c @@ -61,7 +61,6 @@ static bool test_provision(struct torture_context *tctx) settings->realm = "EXAMPLE.COM"; settings->domain = "EXAMPLE"; settings->netbios_name = "torture"; - settings->ntds_guid = NULL; settings->ntds_dn_str = NULL; settings->machine_password = "geheim"; -- cgit From e9017ba418202b4b191c5a9ad4a96857558ce606 Mon Sep 17 00:00:00 2001 From: Jelmer Vernooij Date: Mon, 14 Apr 2008 17:22:58 +0200 Subject: Use _OBJ_FILES variables in a couple more places. (This used to be commit 92856d5054106894b65cd1a1b5119c0facfc4cff) --- source4/torture/local/config.mk | 60 +++++++++++++++++++++-------------------- 1 file changed, 31 insertions(+), 29 deletions(-) (limited to 'source4/torture/local') diff --git a/source4/torture/local/config.mk b/source4/torture/local/config.mk index 4143d415cf..efdea7f66a 100644 --- a/source4/torture/local/config.mk +++ b/source4/torture/local/config.mk @@ -5,35 +5,6 @@ SUBSYSTEM = torture INIT_FUNCTION = torture_local_init PRIVATE_PROTO_HEADER = \ proto.h -OBJ_FILES = \ - ../../lib/charset/tests/iconv.o \ - ../../lib/talloc/testsuite.o \ - ../../lib/replace/test/getifaddrs.o \ - ../../lib/replace/test/os2_delete.o \ - ../../lib/replace/test/strptime.o \ - ../../lib/replace/test/testsuite.o \ - ../../lib/messaging/tests/messaging.o \ - ../../lib/messaging/tests/irpc.o \ - ../../librpc/tests/binding_string.o \ - ../../lib/util/tests/idtree.o \ - ../../lib/socket/testsuite.o \ - ../../lib/socket_wrapper/testsuite.o \ - ../../libcli/resolve/testsuite.o \ - ../../lib/util/tests/strlist.o \ - ../../lib/util/tests/str.o \ - ../../lib/util/tests/file.o \ - ../../lib/util/tests/genrand.o \ - ../../lib/compression/testsuite.o \ - ../../lib/charset/tests/charset.o \ - ../../libcli/security/tests/sddl.o \ - ../../lib/tdr/testsuite.o \ - ../../lib/events/testsuite.o \ - ../../param/tests/share.o \ - ../../param/tests/loadparm.o \ - ../../auth/credentials/tests/simple.o \ - local.o \ - dbspeed.o \ - torture.o PRIVATE_DEPENDENCIES = \ RPC_NDR_ECHO \ TDR \ @@ -48,3 +19,34 @@ PRIVATE_DEPENDENCIES = \ torture_registry # End SUBSYSTEM TORTURE_LOCAL ################################# + +TORTURE_LOCAL_OBJ_FILES = \ + lib/charset/tests/iconv.o \ + lib/talloc/testsuite.o \ + lib/replace/test/getifaddrs.o \ + lib/replace/test/os2_delete.o \ + lib/replace/test/strptime.o \ + lib/replace/test/testsuite.o \ + lib/messaging/tests/messaging.o \ + lib/messaging/tests/irpc.o \ + librpc/tests/binding_string.o \ + lib/util/tests/idtree.o \ + lib/socket/testsuite.o \ + lib/socket_wrapper/testsuite.o \ + libcli/resolve/testsuite.o \ + lib/util/tests/strlist.o \ + lib/util/tests/str.o \ + lib/util/tests/file.o \ + lib/util/tests/genrand.o \ + lib/compression/testsuite.o \ + lib/charset/tests/charset.o \ + libcli/security/tests/sddl.o \ + lib/tdr/testsuite.o \ + lib/events/testsuite.o \ + param/tests/share.o \ + param/tests/loadparm.o \ + auth/credentials/tests/simple.o \ + torture/local/local.o \ + torture/local/dbspeed.o \ + torture/local/torture.o + -- cgit From 21fc7673780aa1d7c0caab7b17ff9171238913ba Mon Sep 17 00:00:00 2001 From: Jelmer Vernooij Date: Thu, 17 Apr 2008 12:23:44 +0200 Subject: Specify event_context to ldb_wrap_connect explicitly. (This used to be commit b4e1ae07a284c044704322446c94351c2decff91) --- source4/torture/local/dbspeed.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'source4/torture/local') diff --git a/source4/torture/local/dbspeed.c b/source4/torture/local/dbspeed.c index 34083cd204..bf88c00e35 100644 --- a/source4/torture/local/dbspeed.c +++ b/source4/torture/local/dbspeed.c @@ -176,7 +176,7 @@ static bool test_ldb_speed(struct torture_context *torture, const void *_data) torture_comment(torture, "Testing ldb speed for sidmap\n"); - ldb = ldb_wrap_connect(tmp_ctx, torture->lp_ctx, "tdb://test.ldb", + ldb = ldb_wrap_connect(tmp_ctx, torture->ev, torture->lp_ctx, "tdb://test.ldb", NULL, NULL, LDB_FLG_NOSYNC, NULL); if (!ldb) { unlink("./test.ldb"); -- cgit