diff options
author | Günther Deschner <gd@samba.org> | 2009-06-26 16:51:53 +0200 |
---|---|---|
committer | Günther Deschner <gd@samba.org> | 2009-06-29 12:43:32 +0200 |
commit | ec5c83c0dba28516d5c92f57dd7c88c99b17d4ab (patch) | |
tree | 0dfed1f69fcdb13417e720f587ad95996064a451 /source4/torture/rpc/rpc.c | |
parent | 595d07d0ab494e3749c71caf86887ad1cebda229 (diff) | |
download | samba-ec5c83c0dba28516d5c92f57dd7c88c99b17d4ab.tar.gz samba-ec5c83c0dba28516d5c92f57dd7c88c99b17d4ab.tar.xz samba-ec5c83c0dba28516d5c92f57dd7c88c99b17d4ab.zip |
s4-smbtorture: add torture_suite_add_machine_workstation_rpc_iface_tcase.
Unlike torture_suite_add_machine_bdc_rpc_iface_tcase() which joins as a BDC
(ACB_SRVTRUST) this joins as a member workstation (ACB_WSTRUST).
Guenther
Diffstat (limited to 'source4/torture/rpc/rpc.c')
-rw-r--r-- | source4/torture/rpc/rpc.c | 58 |
1 files changed, 54 insertions, 4 deletions
diff --git a/source4/torture/rpc/rpc.c b/source4/torture/rpc/rpc.c index 19b223beba2..d7aafefda14 100644 --- a/source4/torture/rpc/rpc.c +++ b/source4/torture/rpc/rpc.c @@ -124,8 +124,40 @@ NTSTATUS torture_rpc_connection_transport(struct torture_context *tctx, return status; } -static bool torture_rpc_setup_machine(struct torture_context *tctx, - void **data) +static bool torture_rpc_setup_machine_workstation(struct torture_context *tctx, + void **data) +{ + NTSTATUS status; + struct dcerpc_binding *binding; + struct torture_rpc_tcase *tcase = talloc_get_type(tctx->active_tcase, + struct torture_rpc_tcase); + struct torture_rpc_tcase_data *tcase_data; + + status = torture_rpc_binding(tctx, &binding); + if (NT_STATUS_IS_ERR(status)) + return false; + + *data = tcase_data = talloc_zero(tctx, struct torture_rpc_tcase_data); + tcase_data->credentials = cmdline_credentials; + tcase_data->join_ctx = torture_join_domain(tctx, tcase->machine_name, + ACB_WSTRUST, + &tcase_data->credentials); + if (tcase_data->join_ctx == NULL) + torture_fail(tctx, "Failed to join as WORKSTATION"); + + status = dcerpc_pipe_connect_b(tctx, + &(tcase_data->pipe), + binding, + tcase->table, + tcase_data->credentials, tctx->ev, tctx->lp_ctx); + + torture_assert_ntstatus_ok(tctx, status, "Error connecting to server"); + + return true; +} + +static bool torture_rpc_setup_machine_bdc(struct torture_context *tctx, + void **data) { NTSTATUS status; struct dcerpc_binding *binding; @@ -156,7 +188,25 @@ static bool torture_rpc_setup_machine(struct torture_context *tctx, return true; } -_PUBLIC_ struct torture_rpc_tcase *torture_suite_add_machine_rpc_iface_tcase( +_PUBLIC_ struct torture_rpc_tcase *torture_suite_add_machine_workstation_rpc_iface_tcase( + struct torture_suite *suite, + const char *name, + const struct ndr_interface_table *table, + const char *machine_name) +{ + struct torture_rpc_tcase *tcase = talloc(suite, + struct torture_rpc_tcase); + + torture_suite_init_rpc_tcase(suite, tcase, name, table); + + tcase->machine_name = talloc_strdup(tcase, machine_name); + tcase->tcase.setup = torture_rpc_setup_machine_workstation; + tcase->tcase.teardown = torture_rpc_teardown; + + return tcase; +} + +_PUBLIC_ struct torture_rpc_tcase *torture_suite_add_machine_bdc_rpc_iface_tcase( struct torture_suite *suite, const char *name, const struct ndr_interface_table *table, @@ -168,7 +218,7 @@ _PUBLIC_ struct torture_rpc_tcase *torture_suite_add_machine_rpc_iface_tcase( torture_suite_init_rpc_tcase(suite, tcase, name, table); tcase->machine_name = talloc_strdup(tcase, machine_name); - tcase->tcase.setup = torture_rpc_setup_machine; + tcase->tcase.setup = torture_rpc_setup_machine_bdc; tcase->tcase.teardown = torture_rpc_teardown; return tcase; |