summaryrefslogtreecommitdiff
path: root/source4
diff options
context:
space:
mode:
authorStefan Metzmacher <metze@samba.org>2005-06-06 13:21:49 +0000
committerGerald (Jerry) Carter <jerry@samba.org>2007-10-10 13:17:43 -0500
commit87bbda10bf8b66842ed9249691477baf63660766 (patch)
treee71b7d86717981b6521c28208b8938f5fe0fb187 /source4
parentb8e8e5ed4e8436c4ad00eac8d72dd1157b770ab6 (diff)
downloadsamba-87bbda10bf8b66842ed9249691477baf63660766.tar.gz
samba-87bbda10bf8b66842ed9249691477baf63660766.tar.bz2
samba-87bbda10bf8b66842ed9249691477baf63660766.zip
r7333: Pause and resume each printer
metze (This used to be commit 191375f41708503e62e14132f691a9b6ec149a1b)
Diffstat (limited to 'source4')
-rw-r--r--source4/torture/rpc/spoolss.c72
1 files changed, 72 insertions, 0 deletions
diff --git a/source4/torture/rpc/spoolss.c b/source4/torture/rpc/spoolss.c
index 19c7e3bd82..a1580b478d 100644
--- a/source4/torture/rpc/spoolss.c
+++ b/source4/torture/rpc/spoolss.c
@@ -1123,6 +1123,70 @@ static BOOL test_EnumJobs(struct dcerpc_pipe *p, TALLOC_CTX *mem_ctx,
return True;
}
+static BOOL test_PausePrinter(struct dcerpc_pipe *p, TALLOC_CTX *mem_ctx,
+ struct policy_handle *handle)
+{
+ NTSTATUS status;
+ struct spoolss_SetPrinter r;
+
+ r.in.handle = handle;
+ r.in.level = 0;
+ r.in.info.info1 = NULL;
+ r.in.devmode_ctr.size = 0;
+ r.in.devmode_ctr.devmode= NULL;
+ r.in.secdesc_ctr.size = 0;
+ r.in.secdesc_ctr.sd = NULL;
+ r.in.command = SPOOLSS_PRINTER_CONTROL_PAUSE;
+
+ printf("Testing SetPrinter: SPOOLSS_PRINTER_CONTROL_PAUSE\n");
+
+ status = dcerpc_spoolss_SetPrinter(p, mem_ctx, &r);
+
+ if (!NT_STATUS_IS_OK(status)) {
+ printf("SetPrinter failed - %s\n", nt_errstr(status));
+ return False;
+ }
+
+ if (!W_ERROR_IS_OK(r.out.result)) {
+ printf("SetPrinter failed - %s\n", win_errstr(r.out.result));
+ return False;
+ }
+
+ return True;
+}
+
+static BOOL test_ResumePrinter(struct dcerpc_pipe *p, TALLOC_CTX *mem_ctx,
+ struct policy_handle *handle)
+{
+ NTSTATUS status;
+ struct spoolss_SetPrinter r;
+
+ r.in.handle = handle;
+ r.in.level = 0;
+ r.in.info.info1 = NULL;
+ r.in.devmode_ctr.size = 0;
+ r.in.devmode_ctr.devmode= NULL;
+ r.in.secdesc_ctr.size = 0;
+ r.in.secdesc_ctr.sd = NULL;
+ r.in.command = SPOOLSS_PRINTER_CONTROL_RESUME;
+
+ printf("Testing SetPrinter: SPOOLSS_PRINTER_CONTROL_RESUME\n");
+
+ status = dcerpc_spoolss_SetPrinter(p, mem_ctx, &r);
+
+ if (!NT_STATUS_IS_OK(status)) {
+ printf("SetPrinter failed - %s\n", nt_errstr(status));
+ return False;
+ }
+
+ if (!W_ERROR_IS_OK(r.out.result)) {
+ printf("SetPrinter failed - %s\n", win_errstr(r.out.result));
+ return False;
+ }
+
+ return True;
+}
+
static BOOL test_GetPrinterData(struct dcerpc_pipe *p, TALLOC_CTX *mem_ctx,
struct policy_handle *handle,
const char *value_name)
@@ -1602,10 +1666,18 @@ static BOOL test_OpenPrinterEx(struct dcerpc_pipe *p, TALLOC_CTX *mem_ctx,
ret = False;
}
+ if (!test_PausePrinter(p, mem_ctx, &handle)) {
+ ret = False;
+ }
+
if (!test_EnumJobs(p, mem_ctx, &handle)) {
ret = False;
}
+ if (!test_ResumePrinter(p, mem_ctx, &handle)) {
+ ret = False;
+ }
+
if (!test_SetPrinterData(p, mem_ctx, &handle)) {
ret = False;
}