summaryrefslogtreecommitdiff
path: root/source4
diff options
context:
space:
mode:
authorGünther Deschner <gd@samba.org>2009-11-26 01:25:56 +0100
committerKarolin Seeger <kseeger@samba.org>2009-12-08 09:14:56 +0100
commit856b759efce0847d1f5a52db577a8d38ba26f397 (patch)
tree97b8222aee32c52b0c4a284e901cfadeff486c28 /source4
parent52a2e9d3356f3f14597be65f4cc354cca1f52bbe (diff)
downloadsamba-856b759efce0847d1f5a52db577a8d38ba26f397.tar.gz
s4-smbtorture: refactor RPC-SAMR-LARGE-DC test a little more.
Guenther (cherry picked from commit 60419a0eb72c2e07c4b882727b2ccb01b73c52e6) (cherry picked from commit a1a49c704b2496006abc8c759023f889dd7986fe)
Diffstat (limited to 'source4')
-rw-r--r--source4/torture/rpc/samr.c52
1 files changed, 27 insertions, 25 deletions
diff --git a/source4/torture/rpc/samr.c b/source4/torture/rpc/samr.c
index 113a4456a60..0f2ca03b017 100644
--- a/source4/torture/rpc/samr.c
+++ b/source4/torture/rpc/samr.c
@@ -6937,22 +6937,22 @@ struct torture_suite *torture_rpc_samr_user_privileges(TALLOC_CTX *mem_ctx)
static bool torture_rpc_samr_many_accounts(struct torture_context *torture,
struct dcerpc_pipe *p2,
- struct cli_credentials *machine_credentials)
+ void *data)
{
NTSTATUS status;
struct dcerpc_pipe *p;
bool ret = true;
- struct torture_samr_context *ctx;
+ struct torture_samr_context *ctx =
+ talloc_get_type_abort(data, struct torture_samr_context);
status = torture_rpc_connection(torture, &p, &ndr_table_samr);
if (!NT_STATUS_IS_OK(status)) {
return false;
}
- ctx = talloc_zero(torture, struct torture_samr_context);
-
ctx->choice = TORTURE_SAMR_MANY_ACCOUNTS;
- ctx->num_objects_large_dc = 1500;
+ ctx->num_objects_large_dc = torture_setting_int(torture, "large_dc",
+ ctx->num_objects_large_dc);
ret &= test_Connect(p, torture, &ctx->handle);
@@ -6965,22 +6965,22 @@ static bool torture_rpc_samr_many_accounts(struct torture_context *torture,
static bool torture_rpc_samr_many_groups(struct torture_context *torture,
struct dcerpc_pipe *p2,
- struct cli_credentials *machine_credentials)
+ void *data)
{
NTSTATUS status;
struct dcerpc_pipe *p;
bool ret = true;
- struct torture_samr_context *ctx;
+ struct torture_samr_context *ctx =
+ talloc_get_type_abort(data, struct torture_samr_context);
status = torture_rpc_connection(torture, &p, &ndr_table_samr);
if (!NT_STATUS_IS_OK(status)) {
return false;
}
- ctx = talloc_zero(torture, struct torture_samr_context);
-
ctx->choice = TORTURE_SAMR_MANY_GROUPS;
- ctx->num_objects_large_dc = 1500;
+ ctx->num_objects_large_dc = torture_setting_int(torture, "large_dc",
+ ctx->num_objects_large_dc);
ret &= test_Connect(p, torture, &ctx->handle);
@@ -6993,22 +6993,22 @@ static bool torture_rpc_samr_many_groups(struct torture_context *torture,
static bool torture_rpc_samr_many_aliases(struct torture_context *torture,
struct dcerpc_pipe *p2,
- struct cli_credentials *machine_credentials)
+ void *data)
{
NTSTATUS status;
struct dcerpc_pipe *p;
bool ret = true;
- struct torture_samr_context *ctx;
+ struct torture_samr_context *ctx =
+ talloc_get_type_abort(data, struct torture_samr_context);
status = torture_rpc_connection(torture, &p, &ndr_table_samr);
if (!NT_STATUS_IS_OK(status)) {
return false;
}
- ctx = talloc_zero(torture, struct torture_samr_context);
-
ctx->choice = TORTURE_SAMR_MANY_ALIASES;
- ctx->num_objects_large_dc = 1500;
+ ctx->num_objects_large_dc = torture_setting_int(torture, "large_dc",
+ ctx->num_objects_large_dc);
ret &= test_Connect(p, torture, &ctx->handle);
@@ -7023,17 +7023,19 @@ struct torture_suite *torture_rpc_samr_large_dc(TALLOC_CTX *mem_ctx)
{
struct torture_suite *suite = torture_suite_create(mem_ctx, "SAMR-LARGE-DC");
struct torture_rpc_tcase *tcase;
+ struct torture_samr_context *ctx;
- tcase = torture_suite_add_machine_bdc_rpc_iface_tcase(suite, "samr",
- &ndr_table_samr,
- TEST_ACCOUNT_NAME);
-
- torture_rpc_tcase_add_test_creds(tcase, "many_aliases",
- torture_rpc_samr_many_aliases);
- torture_rpc_tcase_add_test_creds(tcase, "many_groups",
- torture_rpc_samr_many_groups);
- torture_rpc_tcase_add_test_creds(tcase, "many_accounts",
- torture_rpc_samr_many_accounts);
+ tcase = torture_suite_add_rpc_iface_tcase(suite, "samr", &ndr_table_samr);
+
+ ctx = talloc_zero(suite, struct torture_samr_context);
+ ctx->num_objects_large_dc = 150;
+
+ torture_rpc_tcase_add_test_ex(tcase, "many_aliases",
+ torture_rpc_samr_many_aliases, ctx);
+ torture_rpc_tcase_add_test_ex(tcase, "many_groups",
+ torture_rpc_samr_many_groups, ctx);
+ torture_rpc_tcase_add_test_ex(tcase, "many_accounts",
+ torture_rpc_samr_many_accounts, ctx);
return suite;
}