summaryrefslogtreecommitdiff
path: root/source4/torture/ldap
diff options
context:
space:
mode:
authorJelmer Vernooij <jelmer@samba.org>2007-12-03 00:28:22 +0100
committerStefan Metzmacher <metze@samba.org>2007-12-21 05:47:20 +0100
commitbbdfbf8d9d486aee51117976b8f825759a4c4a37 (patch)
treec0f97e145aae09c3e7e5387471fb3fb0ab839596 /source4/torture/ldap
parent291ddf433685ee5c25e172885045a4b60d7bb1ee (diff)
downloadsamba-bbdfbf8d9d486aee51117976b8f825759a4c4a37.tar.gz
samba-bbdfbf8d9d486aee51117976b8f825759a4c4a37.tar.bz2
samba-bbdfbf8d9d486aee51117976b8f825759a4c4a37.zip
r26238: Add a loadparm context parameter to torture_context, remove more uses of global_loadparm.
(This used to be commit a33a5530545086b81a3b205aa109dff11c546926)
Diffstat (limited to 'source4/torture/ldap')
-rw-r--r--source4/torture/ldap/cldap.c27
-rw-r--r--source4/torture/ldap/schema.c2
-rw-r--r--source4/torture/ldap/uptodatevector.c2
3 files changed, 13 insertions, 18 deletions
diff --git a/source4/torture/ldap/cldap.c b/source4/torture/ldap/cldap.c
index a254a0ec09..ddb966683f 100644
--- a/source4/torture/ldap/cldap.c
+++ b/source4/torture/ldap/cldap.c
@@ -204,9 +204,9 @@ static void cldap_dump_results(struct cldap_search *search)
/*
test generic cldap operations
*/
-static bool test_cldap_generic(TALLOC_CTX *mem_ctx, const char *dest)
+static bool test_cldap_generic(struct torture_context *tctx, const char *dest)
{
- struct cldap_socket *cldap = cldap_socket_init(mem_ctx, NULL);
+ struct cldap_socket *cldap = cldap_socket_init(tctx, NULL);
NTSTATUS status;
struct cldap_search search;
bool ret = true;
@@ -216,18 +216,18 @@ static bool test_cldap_generic(TALLOC_CTX *mem_ctx, const char *dest)
ZERO_STRUCT(search);
search.in.dest_address = dest;
- search.in.dest_port = lp_cldap_port(global_loadparm);
+ search.in.dest_port = lp_cldap_port(tctx->lp_ctx);
search.in.timeout = 10;
search.in.retries = 3;
- status = cldap_search(cldap, mem_ctx, &search);
+ status = cldap_search(cldap, tctx, &search);
CHECK_STATUS(status, NT_STATUS_OK);
printf("fetching whole rootDSE\n");
search.in.filter = "(objectclass=*)";
search.in.attributes = NULL;
- status = cldap_search(cldap, mem_ctx, &search);
+ status = cldap_search(cldap, tctx, &search);
CHECK_STATUS(status, NT_STATUS_OK);
if (DEBUGLVL(3)) cldap_dump_results(&search);
@@ -236,7 +236,7 @@ static bool test_cldap_generic(TALLOC_CTX *mem_ctx, const char *dest)
search.in.filter = "(objectclass=*)";
search.in.attributes = attrs1;
- status = cldap_search(cldap, mem_ctx, &search);
+ status = cldap_search(cldap, tctx, &search);
CHECK_STATUS(status, NT_STATUS_OK);
if (DEBUGLVL(3)) cldap_dump_results(&search);
@@ -245,7 +245,7 @@ static bool test_cldap_generic(TALLOC_CTX *mem_ctx, const char *dest)
search.in.filter = "(objectclass=*)";
search.in.attributes = attrs2;
- status = cldap_search(cldap, mem_ctx, &search);
+ status = cldap_search(cldap, tctx, &search);
CHECK_STATUS(status, NT_STATUS_OK);
if (DEBUGLVL(3)) cldap_dump_results(&search);
@@ -254,7 +254,7 @@ static bool test_cldap_generic(TALLOC_CTX *mem_ctx, const char *dest)
search.in.filter = "(objectclass2=*)";
search.in.attributes = attrs3;
- status = cldap_search(cldap, mem_ctx, &search);
+ status = cldap_search(cldap, tctx, &search);
CHECK_STATUS(status, NT_STATUS_OK);
if (DEBUGLVL(3)) cldap_dump_results(&search);
@@ -263,7 +263,7 @@ static bool test_cldap_generic(TALLOC_CTX *mem_ctx, const char *dest)
search.in.filter = "(&(objectclass=*)(highestCommittedUSN=2))";
search.in.attributes = attrs1;
- status = cldap_search(cldap, mem_ctx, &search);
+ status = cldap_search(cldap, tctx, &search);
CHECK_STATUS(status, NT_STATUS_OK);
if (DEBUGLVL(3)) cldap_dump_results(&search);
@@ -274,16 +274,11 @@ done:
bool torture_cldap(struct torture_context *torture)
{
- TALLOC_CTX *mem_ctx;
bool ret = true;
const char *host = torture_setting_string(torture, "host", NULL);
- mem_ctx = talloc_init("torture_cldap");
-
- ret &= test_cldap_netlogon(mem_ctx, host);
- ret &= test_cldap_generic(mem_ctx, host);
-
- talloc_free(mem_ctx);
+ ret &= test_cldap_netlogon(torture, host);
+ ret &= test_cldap_generic(torture, host);
return ret;
}
diff --git a/source4/torture/ldap/schema.c b/source4/torture/ldap/schema.c
index 9d9195bb9d..4cfce11eb5 100644
--- a/source4/torture/ldap/schema.c
+++ b/source4/torture/ldap/schema.c
@@ -376,7 +376,7 @@ bool torture_ldap_schema(struct torture_context *torture)
url = talloc_asprintf(torture, "ldap://%s/", host);
- ldb = ldb_wrap_connect(torture, global_loadparm, url,
+ ldb = ldb_wrap_connect(torture, torture->lp_ctx, url,
NULL,
cmdline_credentials,
0, NULL);
diff --git a/source4/torture/ldap/uptodatevector.c b/source4/torture/ldap/uptodatevector.c
index aa473ff5cf..7bac04caf3 100644
--- a/source4/torture/ldap/uptodatevector.c
+++ b/source4/torture/ldap/uptodatevector.c
@@ -160,7 +160,7 @@ bool torture_ldap_uptodatevector(struct torture_context *torture)
url = talloc_asprintf(torture, "ldap://%s/", host);
if (!url) goto failed;
- ldb = ldb_wrap_connect(torture, global_loadparm, url,
+ ldb = ldb_wrap_connect(torture, torture->lp_ctx, url,
NULL,
cmdline_credentials,
0, NULL);