From 1941b5cef04c39ddf89fb236d1d81167c0b25e6b Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Wed, 19 Nov 2003 12:03:11 +0000 Subject: started to expand the echo tests to include more interesting test cases. We fail one of the alignment tests. (This used to be commit 5bb21e57b844e98cc8f1dc264bc45097c08329e3) --- source4/torture/rpc/echo.c | 35 +++++++++++++++++++++++++++++++++-- 1 file changed, 33 insertions(+), 2 deletions(-) (limited to 'source4/torture/rpc') diff --git a/source4/torture/rpc/echo.c b/source4/torture/rpc/echo.c index fe044fbc6c..8d8a3d7c0c 100644 --- a/source4/torture/rpc/echo.c +++ b/source4/torture/rpc/echo.c @@ -170,9 +170,8 @@ static BOOL test_testcall(struct dcerpc_pipe *p, TALLOC_CTX *mem_ctx) { NTSTATUS status; struct TestCall r; - char *s = "foo!"; - r.in.s = s; + r.in.s1 = "input string"; printf("\nTesting TestCall\n"); status = dcerpc_TestCall(p, mem_ctx, &r); @@ -184,6 +183,30 @@ static BOOL test_testcall(struct dcerpc_pipe *p, TALLOC_CTX *mem_ctx) return True; } +/* + test the testcall interface +*/ +static BOOL test_testcall2(struct dcerpc_pipe *p, TALLOC_CTX *mem_ctx) +{ + NTSTATUS status; + struct TestCall2 r; + int i; + BOOL ret = True; + + for (i=1;i<=7;i++) { + r.in.level = i; + + printf("\nTesting TestCall2 level %d\n", i); + status = dcerpc_TestCall2(p, mem_ctx, &r); + if (!NT_STATUS_IS_OK(status)) { + printf("TestCall2 failed - %s\n", nt_errstr(status)); + ret = False; + } + } + + return ret; +} + BOOL torture_rpc_echo(int dummy) { NTSTATUS status; @@ -201,6 +224,7 @@ BOOL torture_rpc_echo(int dummy) return False; } +#if 1 if (!test_addone(p, mem_ctx)) { ret = False; } @@ -216,11 +240,18 @@ BOOL torture_rpc_echo(int dummy) if (!test_sinkdata(p, mem_ctx)) { ret = False; } +#endif + + p->flags |= DCERPC_DEBUG_PRINT_BOTH; if (!test_testcall(p, mem_ctx)) { ret = False; } + if (!test_testcall2(p, mem_ctx)) { + ret = False; + } + printf("\n"); torture_rpc_close(p); -- cgit