svn commit: samba r7342 - in branches/SAMBA_4_0/source/torture/rpc:
.
metze at samba.org
metze at samba.org
Mon Jun 6 15:03:16 GMT 2005
Author: metze
Date: 2005-06-06 15:03:16 +0000 (Mon, 06 Jun 2005)
New Revision: 7342
WebSVN: http://websvn.samba.org/cgi-bin/viewcvs.cgi?view=rev&root=samba&rev=7342
Log:
submit a test job for each printer and delete this job
metze
Modified:
branches/SAMBA_4_0/source/torture/rpc/spoolss.c
Changeset:
Modified: branches/SAMBA_4_0/source/torture/rpc/spoolss.c
===================================================================
--- branches/SAMBA_4_0/source/torture/rpc/spoolss.c 2005-06-06 15:00:55 UTC (rev 7341)
+++ branches/SAMBA_4_0/source/torture/rpc/spoolss.c 2005-06-06 15:03:16 UTC (rev 7342)
@@ -1059,7 +1059,6 @@
printf("Testing SetJob\n");
status = dcerpc_spoolss_SetJob(p, mem_ctx, &r);
-
if (!NT_STATUS_IS_OK(status)) {
printf("SetJob failed - %s\n", nt_errstr(status));
return False;
@@ -1116,7 +1115,8 @@
for (j = 0; j < r.out.count; j++) {
test_GetJob(p, mem_ctx, handle, info[j].info1.job_id);
- test_SetJob(p, mem_ctx, handle, info[j].info1.job_id, 1);
+ test_SetJob(p, mem_ctx, handle, info[j].info1.job_id, SPOOLSS_JOB_CONTROL_PAUSE);
+ test_SetJob(p, mem_ctx, handle, info[j].info1.job_id, SPOOLSS_JOB_CONTROL_RESUME);
}
} else if (!W_ERROR_IS_OK(r.out.result)) {
@@ -1127,6 +1127,58 @@
return True;
}
+static BOOL test_DoPrintTest(struct dcerpc_pipe *p, TALLOC_CTX *mem_ctx,
+ struct policy_handle *handle)
+{
+ BOOL ret = True;
+ NTSTATUS status;
+ struct spoolss_StartDocPrinter s;
+ struct spoolss_DocumentInfo1 info1;
+ struct spoolss_EndDocPrinter e;
+ uint32_t job_id;
+
+ printf("Testing StartDocPrinter\n");
+
+ s.in.handle = handle;
+ s.in.level = 1;
+ s.in.info.info1 = &info1;
+ info1.document_name = "TorturePrintJob";
+ info1.output_file = NULL;
+ info1.datatype = "RAW";
+
+ status = dcerpc_spoolss_StartDocPrinter(p, mem_ctx, &s);
+ if (!NT_STATUS_IS_OK(status)) {
+ printf("dcerpc_spoolss_StartDocPrinter failed - %s\n", nt_errstr(status));
+ return False;
+ }
+ if (!W_ERROR_IS_OK(s.out.result)) {
+ printf("StartDocPrinter failed - %s\n", win_errstr(s.out.result));
+ return False;
+ }
+
+ job_id = s.out.job_id;
+
+ printf("Testing EndDocPrinter\n");
+
+ e.in.handle = handle;
+
+ status = dcerpc_spoolss_EndDocPrinter(p, mem_ctx, &e);
+ if (!NT_STATUS_IS_OK(status)) {
+ printf("dcerpc_spoolss_EndDocPrinter failed - %s\n", nt_errstr(status));
+ return False;
+ }
+ if (!W_ERROR_IS_OK(e.out.result)) {
+ printf("EndDocPrinter failed - %s\n", win_errstr(e.out.result));
+ return False;
+ }
+
+ ret &= test_EnumJobs(p, mem_ctx, handle);
+
+ ret &= test_SetJob(p, mem_ctx, handle, job_id, SPOOLSS_JOB_CONTROL_DELETE);
+
+ return ret;
+}
+
static BOOL test_PausePrinter(struct dcerpc_pipe *p, TALLOC_CTX *mem_ctx,
struct policy_handle *handle)
{
@@ -1674,7 +1726,7 @@
ret = False;
}
- if (!test_EnumJobs(p, mem_ctx, &handle)) {
+ if (!test_DoPrintTest(p, mem_ctx, &handle)) {
ret = False;
}
More information about the samba-cvs
mailing list