summaryrefslogtreecommitdiff
path: root/source4/torture
diff options
context:
space:
mode:
authorStefan Metzmacher <metze@samba.org>2005-06-06 16:08:29 +0000
committerGerald (Jerry) Carter <jerry@samba.org>2007-10-10 13:17:45 -0500
commit22ae7886667242e78281bab5a1b1fa140149b035 (patch)
tree752dd92c07289811491cebb73d35b0aff45a0504 /source4/torture
parent3da5d18fe1cb0da959ba079dce5bab104c1615ca (diff)
downloadsamba-22ae7886667242e78281bab5a1b1fa140149b035.tar.gz
samba-22ae7886667242e78281bab5a1b1fa140149b035.tar.bz2
samba-22ae7886667242e78281bab5a1b1fa140149b035.zip
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)
Diffstat (limited to 'source4/torture')
-rw-r--r--source4/torture/rpc/spoolss.c49
1 files changed, 49 insertions, 0 deletions
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;