summaryrefslogtreecommitdiff
path: root/source4
diff options
context:
space:
mode:
authorStefan Metzmacher <metze@samba.org>2004-08-04 09:33:41 +0000
committerGerald (Jerry) Carter <jerry@samba.org>2007-10-10 12:57:47 -0500
commita0cb701b6fac6e75da691e239cd0407b9269533a (patch)
tree7ab041626a575c2d461ed1fd89f36701bc0ebbd1 /source4
parent3a296195b3f5cdf61e9abce3676786166a1a9cfd (diff)
downloadsamba-a0cb701b6fac6e75da691e239cd0407b9269533a.tar.gz
samba-a0cb701b6fac6e75da691e239cd0407b9269533a.tar.bz2
samba-a0cb701b6fac6e75da691e239cd0407b9269533a.zip
r1649: do a join as dc and run this test as the machine account
metze (This used to be commit 59de2b1f528fb82fbfcf9c3783dd733a36d3fb6c)
Diffstat (limited to 'source4')
-rw-r--r--source4/torture/rpc/drsuapi.c39
1 files changed, 33 insertions, 6 deletions
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;
}