summaryrefslogtreecommitdiff
path: root/source4/torture/rpc/schannel.c
diff options
context:
space:
mode:
authorVolker Lendecke <vl@samba.org>2008-05-16 15:51:27 +0200
committerVolker Lendecke <vl@samba.org>2008-05-16 15:54:10 +0200
commit54e4fa66d4666d358e829461583443c79f06f3b3 (patch)
tree0b1fc7bbc296ffca4b6cb85edd3859314249792a /source4/torture/rpc/schannel.c
parent12df1406716b3fd95df509de0e40e77191176872 (diff)
downloadsamba-54e4fa66d4666d358e829461583443c79f06f3b3.tar.gz
samba-54e4fa66d4666d358e829461583443c79f06f3b3.tar.bz2
samba-54e4fa66d4666d358e829461583443c79f06f3b3.zip
Make rpc-bench-schannel1 use two wks accounts if --option=torture:multijoin=true
(This used to be commit fc3bc3c4a85b0e0ba853f3208a4e934a733cfdc4)
Diffstat (limited to 'source4/torture/rpc/schannel.c')
-rw-r--r--source4/torture/rpc/schannel.c31
1 files changed, 21 insertions, 10 deletions
diff --git a/source4/torture/rpc/schannel.c b/source4/torture/rpc/schannel.c
index c9c8c81b3c..f0279f0d04 100644
--- a/source4/torture/rpc/schannel.c
+++ b/source4/torture/rpc/schannel.c
@@ -507,8 +507,10 @@ struct torture_schannel_bench {
int nprocs;
int nconns;
struct torture_schannel_bench_conn *conns;
- struct test_join *join_ctx;
- struct cli_credentials *wks_creds;
+ struct test_join *join_ctx1;
+ struct cli_credentials *wks_creds1;
+ struct test_join *join_ctx2;
+ struct cli_credentials *wks_creds2;
struct cli_credentials *user1_creds;
struct cli_credentials *user2_creds;
struct dcerpc_binding *b;
@@ -673,19 +675,27 @@ bool torture_rpc_schannel_bench1(struct torture_context *torture)
cli_credentials_parse_string(s->user1_creds, tmp, CRED_SPECIFIED);
}
- s->join_ctx = torture_join_domain(s->tctx, talloc_asprintf(s, "%sb", TEST_MACHINE_NAME),
- ACB_WSTRUST, &s->wks_creds);
- torture_assert(torture, s->join_ctx != NULL,
+ s->join_ctx1 = torture_join_domain(s->tctx, talloc_asprintf(s, "%sb", TEST_MACHINE_NAME),
+ ACB_WSTRUST, &s->wks_creds1);
+ torture_assert(torture, s->join_ctx1 != NULL,
+ "Failed to join domain with acct_flags=ACB_WSTRUST");
+ s->join_ctx2 = torture_join_domain(s->tctx, talloc_asprintf(s, "%sc", TEST_MACHINE_NAME),
+ ACB_WSTRUST, &s->wks_creds2);
+ torture_assert(torture, s->join_ctx2 != NULL,
"Failed to join domain with acct_flags=ACB_WSTRUST");
- cli_credentials_set_kerberos_state(s->wks_creds, CRED_DONT_USE_KERBEROS);
+ cli_credentials_set_kerberos_state(s->wks_creds1, CRED_DONT_USE_KERBEROS);
+ cli_credentials_set_kerberos_state(s->wks_creds2, CRED_DONT_USE_KERBEROS);
for (i=0; i < s->nprocs; i++) {
s->conns[i].s = s;
s->conns[i].index = i;
- s->conns[i].wks_creds = (struct cli_credentials *)talloc_memdup(s->conns,
- s->wks_creds,
- sizeof(*s->wks_creds));
+ s->conns[i].wks_creds = (struct cli_credentials *)talloc_memdup(
+ s->conns, s->wks_creds1,sizeof(*s->wks_creds1));
+ if ((i % 2) && (torture_setting_bool(torture, "multijoin", false))) {
+ memcpy(s->conns[i].wks_creds, s->wks_creds2,
+ talloc_get_size(s->conns[i].wks_creds));
+ }
s->conns[i].wks_creds->netlogon_creds = NULL;
}
@@ -755,6 +765,7 @@ bool torture_rpc_schannel_bench1(struct torture_context *torture)
(unsigned long long)s->total,
(unsigned)s->total/s->timelimit);
- torture_leave_domain(s->join_ctx);
+ torture_leave_domain(s->join_ctx1);
+ torture_leave_domain(s->join_ctx2);
return true;
}