summaryrefslogtreecommitdiff
path: root/source4/torture/libnet/domain.c
diff options
context:
space:
mode:
authorRafal Szczesniak <mimir@samba.org>2006-05-15 21:50:53 +0000
committerGerald (Jerry) Carter <jerry@samba.org>2007-10-10 14:07:24 -0500
commite7b1b2e79d01a213238222786d59c5259cfe17aa (patch)
tree386b6ed1e499f82ba3b1670cbed6b491408c0a8f /source4/torture/libnet/domain.c
parent16b5eac38df91b2377cbffe3009cc956fcb8a78a (diff)
downloadsamba-e7b1b2e79d01a213238222786d59c5259cfe17aa.tar.gz
samba-e7b1b2e79d01a213238222786d59c5259cfe17aa.tar.bz2
samba-e7b1b2e79d01a213238222786d59c5259cfe17aa.zip
r15626: Modify the tests to fit them in current changes in libnet
functions. rafal (This used to be commit 849e3eee9476100d629be318610369662a114dd0)
Diffstat (limited to 'source4/torture/libnet/domain.c')
-rw-r--r--source4/torture/libnet/domain.c19
1 files changed, 12 insertions, 7 deletions
diff --git a/source4/torture/libnet/domain.c b/source4/torture/libnet/domain.c
index 79902d1e7c..c3e965f137 100644
--- a/source4/torture/libnet/domain.c
+++ b/source4/torture/libnet/domain.c
@@ -21,22 +21,23 @@
#include "includes.h"
#include "torture/rpc/rpc.h"
+#include "lib/events/events.h"
#include "libnet/libnet.h"
#include "librpc/gen_ndr/ndr_samr_c.h"
-static BOOL test_domainopen(struct dcerpc_pipe *p, TALLOC_CTX *mem_ctx,
+static BOOL test_domainopen(struct libnet_context *net_ctx, TALLOC_CTX *mem_ctx,
struct lsa_String *domname,
struct policy_handle *domain_handle)
{
NTSTATUS status;
- struct libnet_rpc_domain_open io;
+ struct libnet_DomainOpen io;
printf("opening domain\n");
io.in.domain_name = talloc_strdup(mem_ctx, domname->string);
io.in.access_mask = SEC_FLAG_MAXIMUM_ALLOWED;
- status = libnet_rpc_domain_open(p, mem_ctx, &io);
+ status = libnet_DomainOpen(net_ctx, mem_ctx, &io);
if (!NT_STATUS_IS_OK(status)) {
printf("Composite domain open failed - %s\n", nt_errstr(status));
return False;
@@ -73,7 +74,8 @@ BOOL torture_domainopen(struct torture_context *torture)
{
NTSTATUS status;
const char *binding;
- struct dcerpc_pipe *p;
+ struct libnet_context *net_ctx;
+ struct event_context *evt_ctx;
TALLOC_CTX *mem_ctx;
BOOL ret = True;
struct policy_handle h;
@@ -82,8 +84,11 @@ BOOL torture_domainopen(struct torture_context *torture)
mem_ctx = talloc_init("test_domain_open");
binding = lp_parm_string(-1, "torture", "binding");
+ evt_ctx = event_context_find(torture);
+ net_ctx = libnet_context_init(evt_ctx);
+
status = torture_rpc_connection(mem_ctx,
- &p,
+ &net_ctx->samr_pipe,
&dcerpc_table_samr);
if (!NT_STATUS_IS_OK(status)) {
@@ -95,12 +100,12 @@ BOOL torture_domainopen(struct torture_context *torture)
/*
* Testing synchronous version
*/
- if (!test_domainopen(p, mem_ctx, &name, &h)) {
+ if (!test_domainopen(net_ctx, mem_ctx, &name, &h)) {
ret = False;
goto done;
}
- if (!test_cleanup(p, mem_ctx, &h)) {
+ if (!test_cleanup(net_ctx->samr_pipe, mem_ctx, &h)) {
ret = False;
goto done;
}