From a0cb701b6fac6e75da691e239cd0407b9269533a Mon Sep 17 00:00:00 2001 From: Stefan Metzmacher Date: Wed, 4 Aug 2004 09:33:41 +0000 Subject: r1649: do a join as dc and run this test as the machine account metze (This used to be commit 59de2b1f528fb82fbfcf9c3783dd733a36d3fb6c) --- source4/torture/rpc/drsuapi.c | 39 +++++++++++++++++++++++++++++++++------ 1 file changed, 33 insertions(+), 6 deletions(-) (limited to 'source4') diff --git a/source4/torture/rpc/drsuapi.c b/source4/torture/rpc/drsuapi.c index a2f3eb6104..2938a1a744 100644 --- a/source4/torture/rpc/drsuapi.c +++ b/source4/torture/rpc/drsuapi.c @@ -23,7 +23,11 @@ #include "includes.h" +static const char *machine_password; +#define TEST_MACHINE_NAME "torturetest" + +#if 0 static void reopen(struct dcerpc_pipe **p, const struct dcerpc_interface_table *iface) { NTSTATUS status; @@ -179,6 +183,7 @@ static BOOL test_scan(struct dcerpc_pipe *p, TALLOC_CTX *mem_ctx) test_scan_call(mem_ctx, &dcerpc_table_drsuapi, 0x0); return True; } +#endif static BOOL test_DRSBind(struct dcerpc_pipe *p, TALLOC_CTX *mem_ctx) { @@ -203,28 +208,50 @@ BOOL torture_rpc_drsuapi(int dummy) struct dcerpc_pipe *p; TALLOC_CTX *mem_ctx; BOOL ret = True; + void *join_ctx; + const char *binding = lp_parm_string(-1, "torture", "binding"); + + if (!binding) { + printf("You must specify a ncacn binding string\n"); + return False; + } - mem_ctx = talloc_init("torture_rpc_srvsvc"); + lp_set_cmdline("netbios name", TEST_MACHINE_NAME); + + join_ctx = torture_join_domain(TEST_MACHINE_NAME, lp_workgroup(), ACB_SVRTRUST, + &machine_password); + if (!join_ctx) { + printf("Failed to join as BDC\n"); + return False; + } + + status = dcerpc_pipe_connect(&p, binding, + DCERPC_DRSUAPI_UUID, + DCERPC_DRSUAPI_VERSION, + lp_workgroup(), + TEST_MACHINE_NAME"$", + machine_password); - status = torture_rpc_connection(&p, - DCERPC_DRSUAPI_NAME, - DCERPC_DRSUAPI_UUID, - DCERPC_DRSUAPI_VERSION); if (!NT_STATUS_IS_OK(status)) { return False; } + mem_ctx = talloc_init("torture_rpc_drsuapi"); + if (!test_DRSBind(p, mem_ctx)) { ret = False; } +#if 0 if (!test_scan(p, mem_ctx)) { ret = False; } - +#endif talloc_destroy(mem_ctx); torture_rpc_close(p); + torture_leave_domain(join_ctx); + return ret; } -- cgit