summaryrefslogtreecommitdiff
path: root/source4/torture
diff options
context:
space:
mode:
authorAndrew Tridgell <tridge@samba.org>2003-11-17 09:34:19 +0000
committerAndrew Tridgell <tridge@samba.org>2003-11-17 09:34:19 +0000
commite62c5c9a8dd1258b776d40918026a1be4b71fb72 (patch)
tree877a0934d7082d96093d420627e3d3797b67483e /source4/torture
parentc562794e7477e56251baea4f954794ec189f2847 (diff)
downloadsamba-e62c5c9a8dd1258b776d40918026a1be4b71fb72.tar.gz
samba-e62c5c9a8dd1258b776d40918026a1be4b71fb72.tar.bz2
samba-e62c5c9a8dd1258b776d40918026a1be4b71fb72.zip
use [subcontext] to make GetPrinter a bit easier in smbtorture
(This used to be commit a5140985d8f57695b4165c72af217092da6fae5f)
Diffstat (limited to 'source4/torture')
-rw-r--r--source4/torture/rpc/echo.c5
-rw-r--r--source4/torture/rpc/spoolss.c20
2 files changed, 8 insertions, 17 deletions
diff --git a/source4/torture/rpc/echo.c b/source4/torture/rpc/echo.c
index 1e6328f3b4..3ae0c76a74 100644
--- a/source4/torture/rpc/echo.c
+++ b/source4/torture/rpc/echo.c
@@ -170,6 +170,9 @@ static BOOL test_testcall(struct dcerpc_pipe *p, TALLOC_CTX *mem_ctx)
{
NTSTATUS status;
struct TestCall r;
+ char *s = "foo!";
+
+ r.in.s = s;
printf("\nTesting TestCall\n");
status = dcerpc_TestCall(p, mem_ctx, &r);
@@ -178,8 +181,6 @@ static BOOL test_testcall(struct dcerpc_pipe *p, TALLOC_CTX *mem_ctx)
return False;
}
- NDR_PRINT_DEBUG(Struct1, r.out.s1);
-
return True;
}
diff --git a/source4/torture/rpc/spoolss.c b/source4/torture/rpc/spoolss.c
index c44c2a1db8..895677eba3 100644
--- a/source4/torture/rpc/spoolss.c
+++ b/source4/torture/rpc/spoolss.c
@@ -26,14 +26,12 @@ BOOL test_GetPrinter(struct dcerpc_pipe *p, TALLOC_CTX *mem_ctx,
{
NTSTATUS status;
struct spoolss_GetPrinter r;
- uint32 buf_size = 0;
- DATA_BLOB blob;
- union spoolss_PrinterInfo info;
uint16 levels[] = {1, 2, 3, 4, 5, 6, 7};
int i;
BOOL ret = True;
for (i=0;i<ARRAY_SIZE(levels);i++) {
+ uint32 buf_size = 0;
r.in.handle = handle;
r.in.level = levels[i];
r.in.buffer = NULL;
@@ -50,7 +48,7 @@ BOOL test_GetPrinter(struct dcerpc_pipe *p, TALLOC_CTX *mem_ctx,
}
if (W_ERROR_EQUAL(r.out.result, WERR_INSUFFICIENT_BUFFER)) {
- blob = data_blob_talloc(mem_ctx, NULL, buf_size);
+ DATA_BLOB blob = data_blob_talloc(mem_ctx, NULL, buf_size);
data_blob_clear(&blob);
r.in.buffer = &blob;
status = dcerpc_spoolss_GetPrinter(p, mem_ctx, &r);
@@ -63,16 +61,8 @@ BOOL test_GetPrinter(struct dcerpc_pipe *p, TALLOC_CTX *mem_ctx,
ret = False;
continue;
}
-
- status = ndr_pull_union_blob(r.out.buffer, mem_ctx, r.in.level, &info,
- (ndr_pull_union_fn_t)ndr_pull_spoolss_PrinterInfo);
- if (!NT_STATUS_IS_OK(status)) {
- printf("PrinterInfo parse failed - %s\n", nt_errstr(status));
- ret = False;
- continue;
- }
-
- NDR_PRINT_UNION_DEBUG(spoolss_PrinterInfo, r.in.level, &info);
+
+ NDR_PRINT_UNION_DEBUG(spoolss_PrinterInfo, r.in.level, r.out.info);
}
return ret;
@@ -194,7 +184,7 @@ static BOOL test_EnumPrinters(struct dcerpc_pipe *p, TALLOC_CTX *mem_ctx)
{
struct spoolss_EnumPrinters r;
NTSTATUS status;
- uint16 levels[] = {1, 2, 3, 4, 5, 6, 7};
+ uint16 levels[] = {1, 2, 4, 5};
int i;
BOOL ret = True;