From 50c5059ab048a5a1b9b03ca78029b333197178ba Mon Sep 17 00:00:00 2001 From: Jelmer Vernooij Date: Sun, 31 Oct 2004 01:21:14 +0000 Subject: r3397: Fix IDL for ComplexPing and SimplePing, including tests (This used to be commit cf976a6feb980b1e5116d24371fa6109092c9314) --- source4/torture/rpc/oxidresolve.c | 41 ++++++++++++++++++++++++++++++++++----- 1 file changed, 36 insertions(+), 5 deletions(-) (limited to 'source4/torture/rpc') diff --git a/source4/torture/rpc/oxidresolve.c b/source4/torture/rpc/oxidresolve.c index 4acaaeecc0..a4ad897baa 100644 --- a/source4/torture/rpc/oxidresolve.c +++ b/source4/torture/rpc/oxidresolve.c @@ -21,13 +21,12 @@ #include "includes.h" -static int test_SimplePing(struct dcerpc_pipe *p, TALLOC_CTX *mem_ctx) +static int test_SimplePing(struct dcerpc_pipe *p, TALLOC_CTX *mem_ctx, HYPER_T setid) { struct SimplePing r; NTSTATUS status; - HYPER_T h = 10; - r.in.SetId = &h; + r.in.SetId = &setid; status = dcerpc_SimplePing(p, mem_ctx, &r); if(NT_STATUS_IS_ERR(status)) { @@ -43,6 +42,34 @@ static int test_SimplePing(struct dcerpc_pipe *p, TALLOC_CTX *mem_ctx) return 1; } +static int test_ComplexPing(struct dcerpc_pipe *p, TALLOC_CTX *mem_ctx, HYPER_T *setid) +{ + struct ComplexPing r; + NTSTATUS status; + + *setid = 0; + ZERO_STRUCT(r.in); + + r.in.SequenceNum = 0; + r.in.SetId = setid; + r.out.SetId = setid; + + status = dcerpc_ComplexPing(p, mem_ctx, &r); + if(NT_STATUS_IS_ERR(status)) { + fprintf(stderr, "ComplexPing: %s\n", nt_errstr(status)); + return 0; + } + + if(!W_ERROR_IS_OK(r.out.result)) { + fprintf(stderr, "ComplexPing: %s\n", win_errstr(r.out.result)); + return 0; + } + + + + return 1; +} + static int test_ServerAlive(struct dcerpc_pipe *p, TALLOC_CTX *mem_ctx) { struct ServerAlive r; @@ -88,6 +115,7 @@ BOOL torture_rpc_oxidresolve(void) struct dcerpc_pipe *p; TALLOC_CTX *mem_ctx; BOOL ret = True; + HYPER_T setid; mem_ctx = talloc_init("torture_rpc_oxidresolve"); @@ -100,10 +128,13 @@ BOOL torture_rpc_oxidresolve(void) return False; } - if(!test_SimplePing(p, mem_ctx)) + if(!test_ServerAlive(p, mem_ctx)) ret = False; - if(!test_ServerAlive(p, mem_ctx)) + if(!test_ComplexPing(p, mem_ctx, &setid)) + ret = False; + + if(!test_SimplePing(p, mem_ctx, setid)) ret = False; if(!test_ServerAlive2(p, mem_ctx)) -- cgit