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 From 1e973565b6c0cb738b25a2d9439d5acb441701f4 Mon Sep 17 00:00:00 2001 From: Jelmer Vernooij Date: Sun, 27 Apr 2008 14:02:46 +0100 Subject: Move subunit infrastructure code into lib/torture. (This used to be commit 5b44d8121de7735d69e6238a1442aff034a8ebd3) --- source4/torture/local/dbspeed.c | 2 +- source4/torture/local/local.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) (limited to 'source4/torture/local') diff --git a/source4/torture/local/dbspeed.c b/source4/torture/local/dbspeed.c index bf88c00e35..017c8568f4 100644 --- a/source4/torture/local/dbspeed.c +++ b/source4/torture/local/dbspeed.c @@ -26,7 +26,7 @@ #include "lib/ldb/include/ldb_errors.h" #include "lib/ldb_wrap.h" #include "lib/tdb_wrap.h" -#include "torture/torture.h" +#include "torture/smbtorture.h" #include "param/param.h" float tdb_speed; diff --git a/source4/torture/local/local.c b/source4/torture/local/local.c index e4dfadd3d1..1c3274adcd 100644 --- a/source4/torture/local/local.c +++ b/source4/torture/local/local.c @@ -18,7 +18,7 @@ */ #include "includes.h" -#include "torture/torture.h" +#include "torture/smbtorture.h" #include "torture/local/proto.h" #include "torture/ndr/ndr.h" #include "torture/ndr/proto.h" -- cgit From 670122d724ff190d886a8eca86b6eeff64592708 Mon Sep 17 00:00:00 2001 From: Jelmer Vernooij Date: Sat, 10 May 2008 23:46:51 +0200 Subject: Fix torture module initializion. (This used to be commit d5bf4e9065303b54421a6f35b213a22f062d27d4) --- source4/torture/local/config.mk | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'source4/torture/local') diff --git a/source4/torture/local/config.mk b/source4/torture/local/config.mk index efdea7f66a..d7cac101df 100644 --- a/source4/torture/local/config.mk +++ b/source4/torture/local/config.mk @@ -1,7 +1,7 @@ ################################# # Start SUBSYSTEM TORTURE_LOCAL [MODULE::TORTURE_LOCAL] -SUBSYSTEM = torture +SUBSYSTEM = smbtorture INIT_FUNCTION = torture_local_init PRIVATE_PROTO_HEADER = \ proto.h -- cgit From 03643aec88244d976da394521adbd29a31339569 Mon Sep 17 00:00:00 2001 From: Jelmer Vernooij Date: Sun, 18 May 2008 19:54:27 +0200 Subject: Use variables for source directory in a couple more places. (This used to be commit c41bd3005f5f0b9cfd3709fc9217b4a401d265b4) --- source4/torture/local/config.mk | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'source4/torture/local') diff --git a/source4/torture/local/config.mk b/source4/torture/local/config.mk index d7cac101df..50951c61a8 100644 --- a/source4/torture/local/config.mk +++ b/source4/torture/local/config.mk @@ -46,7 +46,7 @@ TORTURE_LOCAL_OBJ_FILES = \ 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 + $(torturesrcdir)/local/local.o \ + $(torturesrcdir)/local/dbspeed.o \ + $(torturesrcdir)/local/torture.o -- cgit From 4c8756f147f8b9a2806fd76e4cb06bb99d391516 Mon Sep 17 00:00:00 2001 From: Jelmer Vernooij Date: Sun, 18 May 2008 22:30:08 +0200 Subject: Create prototype headers from Makefile directory, without smb_build in the middle. (This used to be commit f4a77b96f9c17d853348b70794026e5b9e384942) --- source4/torture/local/config.mk | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'source4/torture/local') diff --git a/source4/torture/local/config.mk b/source4/torture/local/config.mk index 50951c61a8..f97b97d781 100644 --- a/source4/torture/local/config.mk +++ b/source4/torture/local/config.mk @@ -3,8 +3,6 @@ [MODULE::TORTURE_LOCAL] SUBSYSTEM = smbtorture INIT_FUNCTION = torture_local_init -PRIVATE_PROTO_HEADER = \ - proto.h PRIVATE_DEPENDENCIES = \ RPC_NDR_ECHO \ TDR \ @@ -50,3 +48,5 @@ TORTURE_LOCAL_OBJ_FILES = \ $(torturesrcdir)/local/dbspeed.o \ $(torturesrcdir)/local/torture.o + +$(call proto_header_template,$(torturesrcdir)/local/proto.h,$(TORTURE_LOCAL_OBJ_FILES:.o=.c)) -- cgit From 4c70cda986c86fe536327321d04c29eca81b6409 Mon Sep 17 00:00:00 2001 From: Jelmer Vernooij Date: Sun, 18 May 2008 23:02:47 +0200 Subject: Fix a couple (well, little more than that..) of typos. (This used to be commit a6b52119940a900fb0de3864b8bca94e2965cc24) --- source4/torture/local/config.mk | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'source4/torture/local') diff --git a/source4/torture/local/config.mk b/source4/torture/local/config.mk index f97b97d781..3ec2ae5fae 100644 --- a/source4/torture/local/config.mk +++ b/source4/torture/local/config.mk @@ -49,4 +49,4 @@ TORTURE_LOCAL_OBJ_FILES = \ $(torturesrcdir)/local/torture.o -$(call proto_header_template,$(torturesrcdir)/local/proto.h,$(TORTURE_LOCAL_OBJ_FILES:.o=.c)) +$(eval $(call proto_header_template,$(torturesrcdir)/local/proto.h,$(TORTURE_LOCAL_OBJ_FILES:.o=.c))) -- cgit From 32dfdae009132ed2152f1c3ba242df630c0d9e22 Mon Sep 17 00:00:00 2001 From: Jelmer Vernooij Date: Mon, 19 May 2008 02:03:00 +0200 Subject: Move IDL build script to rpc directory, make various bits and pieces easier to use externally. (This used to be commit 8328ff76416df5a6e05461d3a19f510b76f2e902) --- source4/torture/local/config.mk | 50 ++++++++++++++++++++--------------------- 1 file changed, 25 insertions(+), 25 deletions(-) (limited to 'source4/torture/local') diff --git a/source4/torture/local/config.mk b/source4/torture/local/config.mk index 3ec2ae5fae..cd1c7b1422 100644 --- a/source4/torture/local/config.mk +++ b/source4/torture/local/config.mk @@ -19,31 +19,31 @@ PRIVATE_DEPENDENCIES = \ ################################# 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 \ + $(torturesrcdir)/../lib/charset/tests/iconv.o \ + $(torturesrcdir)/../lib/talloc/testsuite.o \ + $(torturesrcdir)/../lib/replace/test/getifaddrs.o \ + $(torturesrcdir)/../lib/replace/test/os2_delete.o \ + $(torturesrcdir)/../lib/replace/test/strptime.o \ + $(torturesrcdir)/../lib/replace/test/testsuite.o \ + $(torturesrcdir)/../lib/messaging/tests/messaging.o \ + $(torturesrcdir)/../lib/messaging/tests/irpc.o \ + $(torturesrcdir)/../librpc/tests/binding_string.o \ + $(torturesrcdir)/../lib/util/tests/idtree.o \ + $(torturesrcdir)/../lib/socket/testsuite.o \ + $(torturesrcdir)/../lib/socket_wrapper/testsuite.o \ + $(torturesrcdir)/../libcli/resolve/testsuite.o \ + $(torturesrcdir)/../lib/util/tests/strlist.o \ + $(torturesrcdir)/../lib/util/tests/str.o \ + $(torturesrcdir)/../lib/util/tests/file.o \ + $(torturesrcdir)/../lib/util/tests/genrand.o \ + $(torturesrcdir)/../lib/compression/testsuite.o \ + $(torturesrcdir)/../lib/charset/tests/charset.o \ + $(torturesrcdir)/../libcli/security/tests/sddl.o \ + $(torturesrcdir)/../lib/tdr/testsuite.o \ + $(torturesrcdir)/../lib/events/testsuite.o \ + $(torturesrcdir)/../param/tests/share.o \ + $(torturesrcdir)/../param/tests/loadparm.o \ + $(torturesrcdir)/../auth/credentials/tests/simple.o \ $(torturesrcdir)/local/local.o \ $(torturesrcdir)/local/dbspeed.o \ $(torturesrcdir)/local/torture.o -- cgit