From 22ae7886667242e78281bab5a1b1fa140149b035 Mon Sep 17 00:00:00 2001 From: Stefan Metzmacher Date: Mon, 6 Jun 2005 16:08:29 +0000 Subject: r7346: use StartPagePrinter(), WritePrinter() and EndPagePrinter() to print a few test pages on each printer (we don't actually print because we have paused the printer before...) metze (This used to be commit 6bccf55ab9dcdd8590684ab46c5b101e2969e7f7) --- source4/torture/rpc/spoolss.c | 49 +++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 49 insertions(+) (limited to 'source4/torture/rpc/spoolss.c') diff --git a/source4/torture/rpc/spoolss.c b/source4/torture/rpc/spoolss.c index 20b55f80bf..0ea74c7e56 100644 --- a/source4/torture/rpc/spoolss.c +++ b/source4/torture/rpc/spoolss.c @@ -1134,7 +1134,11 @@ static BOOL test_DoPrintTest(struct dcerpc_pipe *p, TALLOC_CTX *mem_ctx, NTSTATUS status; struct spoolss_StartDocPrinter s; struct spoolss_DocumentInfo1 info1; + struct spoolss_StartPagePrinter sp; + struct spoolss_WritePrinter w; + struct spoolss_EndPagePrinter ep; struct spoolss_EndDocPrinter e; + int i; uint32_t job_id; printf("Testing StartDocPrinter\n"); @@ -1158,6 +1162,51 @@ static BOOL test_DoPrintTest(struct dcerpc_pipe *p, TALLOC_CTX *mem_ctx, job_id = s.out.job_id; + for (i=1; i < 4; i++) { + printf("Testing StartPagePrinter: Page[%d]\n", i); + + sp.in.handle = handle; + + status = dcerpc_spoolss_StartPagePrinter(p, mem_ctx, &sp); + if (!NT_STATUS_IS_OK(status)) { + printf("dcerpc_spoolss_StartPagePrinter failed - %s\n", nt_errstr(status)); + return False; + } + if (!W_ERROR_IS_OK(sp.out.result)) { + printf("StartPagePrinter failed - %s\n", win_errstr(sp.out.result)); + return False; + } + + printf("Testing WritePrinter: Page[%d]\n", i); + + w.in.handle = handle; + w.in.data = data_blob_string_const(talloc_asprintf(mem_ctx,"TortureTestPage: %d\nData\n",i)); + + status = dcerpc_spoolss_WritePrinter(p, mem_ctx, &w); + if (!NT_STATUS_IS_OK(status)) { + printf("dcerpc_spoolss_WritePrinter failed - %s\n", nt_errstr(status)); + return False; + } + if (!W_ERROR_IS_OK(w.out.result)) { + printf("WritePrinter failed - %s\n", win_errstr(w.out.result)); + return False; + } + + printf("Testing EndPagePrinter: Page[%d]\n", i); + + ep.in.handle = handle; + + status = dcerpc_spoolss_EndPagePrinter(p, mem_ctx, &ep); + if (!NT_STATUS_IS_OK(status)) { + printf("dcerpc_spoolss_EndPagePrinter failed - %s\n", nt_errstr(status)); + return False; + } + if (!W_ERROR_IS_OK(ep.out.result)) { + printf("EndPagePrinter failed - %s\n", win_errstr(ep.out.result)); + return False; + } + } + printf("Testing EndDocPrinter\n"); e.in.handle = handle; -- cgit