summaryrefslogtreecommitdiff
path: root/source4/torture/rpc/echo.c
diff options
context:
space:
mode:
authorAndrew Tridgell <tridge@samba.org>2003-11-13 09:26:53 +0000
committerAndrew Tridgell <tridge@samba.org>2003-11-13 09:26:53 +0000
commit3031937d56363cc6322062a66c991182664f40bc (patch)
tree4d2ef00a8f2e269fdefeccc04f6ae2db9dd45d63 /source4/torture/rpc/echo.c
parentff02537261e53b4ec60e5dcad32bf4207065b028 (diff)
downloadsamba-3031937d56363cc6322062a66c991182664f40bc.tar.gz
samba-3031937d56363cc6322062a66c991182664f40bc.tar.bz2
samba-3031937d56363cc6322062a66c991182664f40bc.zip
* fixed conformant arrays in structures
* expanded the rpcecho test * started adding the NETDFS pipe (This used to be commit 095ab42cbdd5c1c5ab753e2eb275742ba822c8b9)
Diffstat (limited to 'source4/torture/rpc/echo.c')
-rw-r--r--source4/torture/rpc/echo.c43
1 files changed, 38 insertions, 5 deletions
diff --git a/source4/torture/rpc/echo.c b/source4/torture/rpc/echo.c
index ebf82c692e..b8c2437e4b 100644
--- a/source4/torture/rpc/echo.c
+++ b/source4/torture/rpc/echo.c
@@ -68,8 +68,7 @@ static BOOL test_echodata(struct dcerpc_pipe *p, TALLOC_CTX *mem_ctx)
}
r.in.len = len;
- r.in.data = data_in;
- r.out.data = data_out;
+ r.in.in_data = data_in;
status = dcerpc_echo_EchoData(p, mem_ctx, &r);
if (!NT_STATUS_IS_OK(status)) {
@@ -77,9 +76,18 @@ static BOOL test_echodata(struct dcerpc_pipe *p, TALLOC_CTX *mem_ctx)
return False;
}
- if (memcmp(data_in, data_out, len) != 0) {
- printf("Bad data returned for len %d!\n", len);
- return False;
+ data_out = r.out.out_data;
+
+ for (i=0;i<len;i++) {
+ if (data_in[i] != data_out[i]) {
+ printf("Bad data returned for len %d at offset %d\n",
+ len, i);
+ printf("in:\n");
+ dump_data(0, data_in, MIN(len, 16));
+ printf("out:\n");
+ dump_data(0, data_out, MIN(len, 16));
+ return False;
+ }
}
@@ -154,6 +162,27 @@ static BOOL test_sinkdata(struct dcerpc_pipe *p, TALLOC_CTX *mem_ctx)
return True;
}
+
+/*
+ test the testcall interface
+*/
+static BOOL test_testcall(struct dcerpc_pipe *p, TALLOC_CTX *mem_ctx)
+{
+ NTSTATUS status;
+ struct TestCall r;
+
+ printf("\nTesting TestCall\n");
+ status = dcerpc_TestCall(p, mem_ctx, &r);
+ if (!NT_STATUS_IS_OK(status)) {
+ printf("TestCall failed - %s\n", nt_errstr(status));
+ return False;
+ }
+
+ NDR_PRINT_DEBUG(Struct1, r.out.s1);
+
+ return True;
+}
+
BOOL torture_rpc_echo(int dummy)
{
NTSTATUS status;
@@ -184,6 +213,10 @@ BOOL torture_rpc_echo(int dummy)
ret = False;
}
+ if (!test_testcall(p, mem_ctx)) {
+ ret = False;
+ }
+
printf("\n");
torture_rpc_close(p);