summaryrefslogtreecommitdiffstats
path: root/source4
diff options
context:
space:
mode:
authorDavid Disseldorp <ddiss@samba.org>2014-10-29 11:54:19 +0100
committerAndreas Schneider <asn@cryptomilk.org>2014-10-29 14:31:52 +0100
commitea962a656ca43954a1ffb3af19dd406b69dee0e7 (patch)
tree69de340114785a6776011a26aa3c5b9b686b11f8 /source4
parent6adcc7bffd5e1474ecba04d2328955c0b208cabc (diff)
downloadsamba-ea962a656ca43954a1ffb3af19dd406b69dee0e7.tar.gz
samba-ea962a656ca43954a1ffb3af19dd406b69dee0e7.tar.xz
samba-ea962a656ca43954a1ffb3af19dd406b69dee0e7.zip
torture/spoolss: cleanup print_job_enum test jobs
Purge print queue on startup to ensure that the test is not affected by jobs queued for prior tests. Also, empty the queue at the end of the test to play nice with others. Signed-off-by: David Disseldorp <ddiss@samba.org> Reviewed-by: Andreas Schneider <asn@samba.org> Autobuild-User(master): Andreas Schneider <asn@cryptomilk.org> Autobuild-Date(master): Wed Oct 29 14:31:52 CET 2014 on sn-devel-104
Diffstat (limited to 'source4')
-rw-r--r--source4/torture/rpc/spoolss.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/source4/torture/rpc/spoolss.c b/source4/torture/rpc/spoolss.c
index dea55491ec..20e86fc16a 100644
--- a/source4/torture/rpc/spoolss.c
+++ b/source4/torture/rpc/spoolss.c
@@ -8867,6 +8867,11 @@ static bool test_print_job_enum(struct torture_context *tctx,
test_PausePrinter(tctx, b, &t->handle),
"failed to pause printer");
+ /* purge in case of any jobs from previous tests */
+ torture_assert(tctx,
+ test_printer_purge(tctx, b, &t->handle),
+ "failed to purge printer");
+
/* enum before jobs, valid level */
torture_assert(tctx,
test_EnumJobs_args(tctx, b, &t->handle, 1, WERR_OK,
@@ -8912,6 +8917,11 @@ static bool test_print_job_enum(struct torture_context *tctx,
&count, &info),
"EnumJobs with invalid level");
+ for (i = 0; i < num_jobs; i++) {
+ test_SetJob(tctx, b, &t->handle, job_ids[i], NULL,
+ SPOOLSS_JOB_CONTROL_DELETE);
+ }
+
torture_assert(tctx,
test_ResumePrinter(tctx, b, &t->handle),
"failed to resume printer");