The branch, master has been updated via 34674e0... s3-selftest: move printing config to global section. via f84f653... s3-selftest: move printing config to global section. via 426cb9b... s4-smbtorture: add print test to RPC-SPOOLSS-PRINTER as well. via 6913c57... s4-smbtorture: create several printjobs during print test in RPC-SPOOLSS. via 27c5025... s4-smbtorture: mention job id in GetJob test output in RPC-SPOOLSS. via 1bb8341... s4-smbtorture: mention job id in SetJob test output in RPC-SPOOLSS. from 66b7fcc... Fix bug #7233 - print fails with jobs >4GB from Win7 clients.
http://gitweb.samba.org/?p=samba.git;a=shortlog;h=master - Log ----------------------------------------------------------------- commit 34674e0a61fe5b2983176e8c33aa48d43fd840ce Author: Günther Deschner <g...@samba.org> Date: Thu Mar 25 00:55:32 2010 +0100 s3-selftest: move printing config to global section. "make test" variant. Guenther commit f84f65306613d2794b14b3eaeba59fe3ca5751cb Author: Günther Deschner <g...@samba.org> Date: Thu Mar 25 00:55:13 2010 +0100 s3-selftest: move printing config to global section. Guenther commit 426cb9be1c882fea5a22475107aad05e8d0e124e Author: Günther Deschner <g...@samba.org> Date: Thu Mar 25 00:49:38 2010 +0100 s4-smbtorture: add print test to RPC-SPOOLSS-PRINTER as well. Guenther commit 6913c57b2f22550102e7fcea75d12c99db1776f7 Author: Günther Deschner <g...@samba.org> Date: Thu Mar 25 00:37:45 2010 +0100 s4-smbtorture: create several printjobs during print test in RPC-SPOOLSS. Guenther commit 27c50255f6b05ff68301a3a32c1ede58626cac2c Author: Günther Deschner <g...@samba.org> Date: Thu Mar 25 00:48:55 2010 +0100 s4-smbtorture: mention job id in GetJob test output in RPC-SPOOLSS. Guenther commit 1bb8341871a6d91ec6b2e826c2cbcb395cba13ee Author: Günther Deschner <g...@samba.org> Date: Thu Mar 25 00:33:35 2010 +0100 s4-smbtorture: mention job id in SetJob test output in RPC-SPOOLSS. Guenther ----------------------------------------------------------------------- Summary of changes: selftest/target/Samba3.pm | 17 ++++---- source3/script/tests/selftest.sh | 17 ++++---- source4/torture/rpc/spoolss.c | 77 ++++++++++++++++++++++++++----------- 3 files changed, 72 insertions(+), 39 deletions(-) Changeset truncated at 500 lines: diff --git a/selftest/target/Samba3.pm b/selftest/target/Samba3.pm index 94c2f95..be34d94 100644 --- a/selftest/target/Samba3.pm +++ b/selftest/target/Samba3.pm @@ -535,6 +535,15 @@ sub provision($$$$$$) create mask = 755 vfs objects = $bindir_abs/xattr_tdb.so $bindir_abs/streams_depot.so + printing = vlp + print command = $bindir_abs/vlp tdbfile=$lockdir/vlp.tdb print %p %s + lpq command = $bindir_abs/vlp tdbfile=$lockdir/vlp.tdb lpq %p + lp rm command = $bindir_abs/vlp tdbfile=$lockdir/vlp.tdb lprm %p %j + lp pause command = $bindir_abs/vlp tdbfile=$lockdir/vlp.tdb lppause %p %j + lp resume command = $bindir_abs/vlp tdbfile=$lockdir/vlp.tdb lpresume %p %j + queue pause command = $bindir_abs/vlp tdbfile=$lockdir/vlp.tdb queuepause %p + queue resume command = $bindir_abs/vlp tdbfile=$lockdir/vlp.tdb queueresume %p + # Begin extra options $extra_options # End extra options @@ -558,14 +567,6 @@ sub provision($$$$$$) [print1] copy = tmp printable = yes - printing = vlp - print command = $bindir_abs/vlp tdbfile=$lockdir/vlp.tdb print %p %s - lpq command = $bindir_abs/vlp tdbfile=$lockdir/vlp.tdb lpq %p - lp rm command = $bindir_abs/vlp tdbfile=$lockdir/vlp.tdb lprm %p %j - lp pause command = $bindir_abs/vlp tdbfile=$lockdir/vlp.tdb lppause %p %j - lp resume command = $bindir_abs/vlp tdbfile=$lockdir/vlp.tdb lpresume %p %j - queue pause command = $bindir_abs/vlp tdbfile=$lockdir/vlp.tdb queuepause %p - queue resume command = $bindir_abs/vlp tdbfile=$lockdir/vlp.tdb queueresume %p [print2] copy = print1 diff --git a/source3/script/tests/selftest.sh b/source3/script/tests/selftest.sh index d06af60..40ada28 100755 --- a/source3/script/tests/selftest.sh +++ b/source3/script/tests/selftest.sh @@ -307,6 +307,15 @@ cat >$SERVERCONFFILE<<EOF create mask = 755 vfs objects = $BINDIR/xattr_tdb.so $BINDIR/streams_depot.so + printing = vlp + print command = $BINDIR/vlp tdbfile=$LOCKDIR/vlp.tdb print %p %s + lpq command = $BINDIR/vlp tdbfile=$LOCKDIR/vlp.tdb lpq %p + lp rm command = $BINDIR/vlp tdbfile=$LOCKDIR/vlp.tdb lprm %p %j + lp pause command = $BINDIR/vlp tdbfile=$LOCKDIR/vlp.tdb lppause %p %j + lp resume command = $BINDIR/vlp tdbfile=$LOCKDIR/vlp.tdb lpresume %p %j + queue pause command = $BINDIR/vlp tdbfile=$LOCKDIR/vlp.tdb queuepause %p + queue resume command = $BINDIR/vlp tdbfile=$LOCKDIR/vlp.tdb queueresume %p + #Include user defined custom parameters if set $INCLUDE_CUSTOM_CONF @@ -327,14 +336,6 @@ cat >$SERVERCONFFILE<<EOF [print1] copy = tmp printable = yes - printing = vlp - print command = $BINDIR/vlp tdbfile=$LOCKDIR/vlp.tdb print %p %s - lpq command = $BINDIR/vlp tdbfile=$LOCKDIR/vlp.tdb lpq %p - lp rm command = $BINDIR/vlp tdbfile=$LOCKDIR/vlp.tdb lprm %p %j - lp pause command = $BINDIR/vlp tdbfile=$LOCKDIR/vlp.tdb lppause %p %j - lp resume command = $BINDIR/vlp tdbfile=$LOCKDIR/vlp.tdb lpresume %p %j - queue pause command = $BINDIR/vlp tdbfile=$LOCKDIR/vlp.tdb queuepause %p - queue resume command = $BINDIR/vlp tdbfile=$LOCKDIR/vlp.tdb queueresume %p [print2] copy = print1 diff --git a/source4/torture/rpc/spoolss.c b/source4/torture/rpc/spoolss.c index db7d5ab..b06c109 100644 --- a/source4/torture/rpc/spoolss.c +++ b/source4/torture/rpc/spoolss.c @@ -2537,14 +2537,14 @@ static bool test_GetJob(struct torture_context *tctx, r.out.needed = &needed; r.out.info = &info; - torture_comment(tctx, "Testing GetJob level %d\n", r.in.level); + torture_comment(tctx, "Testing GetJob(%d), level %d\n", job_id, r.in.level); status = dcerpc_spoolss_GetJob_r(b, tctx, &r); torture_assert_werr_equal(tctx, r.out.result, WERR_UNKNOWN_LEVEL, "Unexpected return code"); for (i = 0; i < ARRAY_SIZE(levels); i++) { - torture_comment(tctx, "Testing GetJob level %d\n", r.in.level); + torture_comment(tctx, "Testing GetJob(%d), level %d\n", job_id, r.in.level); needed = 0; @@ -2589,34 +2589,34 @@ static bool test_SetJob(struct torture_context *tctx, switch (command) { case SPOOLSS_JOB_CONTROL_PAUSE: - torture_comment(tctx, "Testing SetJob: SPOOLSS_JOB_CONTROL_PAUSE\n"); + torture_comment(tctx, "Testing SetJob(%d) SPOOLSS_JOB_CONTROL_PAUSE\n", job_id); break; case SPOOLSS_JOB_CONTROL_RESUME: - torture_comment(tctx, "Testing SetJob: SPOOLSS_JOB_CONTROL_RESUME\n"); + torture_comment(tctx, "Testing SetJob(%d), SPOOLSS_JOB_CONTROL_RESUME\n", job_id); break; case SPOOLSS_JOB_CONTROL_CANCEL: - torture_comment(tctx, "Testing SetJob: SPOOLSS_JOB_CONTROL_CANCEL\n"); + torture_comment(tctx, "Testing SetJob(%d), SPOOLSS_JOB_CONTROL_CANCEL\n", job_id); break; case SPOOLSS_JOB_CONTROL_RESTART: - torture_comment(tctx, "Testing SetJob: SPOOLSS_JOB_CONTROL_RESTART\n"); + torture_comment(tctx, "Testing SetJob(%d), SPOOLSS_JOB_CONTROL_RESTART\n", job_id); break; case SPOOLSS_JOB_CONTROL_DELETE: - torture_comment(tctx, "Testing SetJob: SPOOLSS_JOB_CONTROL_DELETE\n"); + torture_comment(tctx, "Testing SetJob(%d), SPOOLSS_JOB_CONTROL_DELETE\n", job_id); break; case SPOOLSS_JOB_CONTROL_SEND_TO_PRINTER: - torture_comment(tctx, "Testing SetJob: SPOOLSS_JOB_CONTROL_SEND_TO_PRINTER\n"); + torture_comment(tctx, "Testing SetJob(%d), SPOOLSS_JOB_CONTROL_SEND_TO_PRINTER\n", job_id); break; case SPOOLSS_JOB_CONTROL_LAST_PAGE_EJECTED: - torture_comment(tctx, "Testing SetJob: SPOOLSS_JOB_CONTROL_LAST_PAGE_EJECTED\n"); + torture_comment(tctx, "Testing SetJob(%d), SPOOLSS_JOB_CONTROL_LAST_PAGE_EJECTED\n", job_id); break; case SPOOLSS_JOB_CONTROL_RETAIN: - torture_comment(tctx, "Testing SetJob: SPOOLSS_JOB_CONTROL_RETAIN\n"); + torture_comment(tctx, "Testing SetJob(%d), SPOOLSS_JOB_CONTROL_RETAIN\n", job_id); break; case SPOOLSS_JOB_CONTROL_RELEASE: - torture_comment(tctx, "Testing SetJob: SPOOLSS_JOB_CONTROL_RELEASE\n"); + torture_comment(tctx, "Testing SetJob(%d), SPOOLSS_JOB_CONTROL_RELEASE\n", job_id); break; default: - torture_comment(tctx, "Testing SetJob\n"); + torture_comment(tctx, "Testing SetJob(%d)\n", job_id); break; } @@ -2715,11 +2715,11 @@ static bool test_EnumJobs(struct torture_context *tctx, return true; } -static bool test_DoPrintTest(struct torture_context *tctx, - struct dcerpc_binding_handle *b, - struct policy_handle *handle) +static bool test_DoPrintTest_one_job(struct torture_context *tctx, + struct dcerpc_binding_handle *b, + struct policy_handle *handle, + uint32_t *job_id) { - bool ret = true; NTSTATUS status; struct spoolss_StartDocPrinter s; struct spoolss_DocumentInfo1 info1; @@ -2728,7 +2728,6 @@ static bool test_DoPrintTest(struct torture_context *tctx, struct spoolss_EndPagePrinter ep; struct spoolss_EndDocPrinter e; int i; - uint32_t job_id; uint32_t num_written; torture_comment(tctx, "Testing StartDocPrinter\n"); @@ -2736,7 +2735,7 @@ static bool test_DoPrintTest(struct torture_context *tctx, s.in.handle = handle; s.in.level = 1; s.in.info.info1 = &info1; - s.out.job_id = &job_id; + s.out.job_id = job_id; info1.document_name = "TorturePrintJob"; info1.output_file = NULL; info1.datatype = "RAW"; @@ -2746,7 +2745,7 @@ static bool test_DoPrintTest(struct torture_context *tctx, torture_assert_werr_ok(tctx, s.out.result, "StartDocPrinter failed"); for (i=1; i < 4; i++) { - torture_comment(tctx, "Testing StartPagePrinter: Page[%d]\n", i); + torture_comment(tctx, "Testing StartPagePrinter: Page[%d], JobId[%d]\n", i, *job_id); sp.in.handle = handle; @@ -2755,7 +2754,7 @@ static bool test_DoPrintTest(struct torture_context *tctx, "dcerpc_spoolss_StartPagePrinter failed"); torture_assert_werr_ok(tctx, sp.out.result, "StartPagePrinter failed"); - torture_comment(tctx, "Testing WritePrinter: Page[%d]\n", i); + torture_comment(tctx, "Testing WritePrinter: Page[%d], JobId[%d]\n", i, *job_id); w.in.handle = handle; w.in.data = data_blob_string_const(talloc_asprintf(tctx,"TortureTestPage: %d\nData\n",i)); @@ -2765,7 +2764,7 @@ static bool test_DoPrintTest(struct torture_context *tctx, torture_assert_ntstatus_ok(tctx, status, "dcerpc_spoolss_WritePrinter failed"); torture_assert_werr_ok(tctx, w.out.result, "WritePrinter failed"); - torture_comment(tctx, "Testing EndPagePrinter: Page[%d]\n", i); + torture_comment(tctx, "Testing EndPagePrinter: Page[%d], JobId[%d]\n", i, *job_id); ep.in.handle = handle; @@ -2774,7 +2773,7 @@ static bool test_DoPrintTest(struct torture_context *tctx, torture_assert_werr_ok(tctx, ep.out.result, "EndPagePrinter failed"); } - torture_comment(tctx, "Testing EndDocPrinter\n"); + torture_comment(tctx, "Testing EndDocPrinter: JobId[%d]\n", *job_id); e.in.handle = handle; @@ -2782,10 +2781,30 @@ static bool test_DoPrintTest(struct torture_context *tctx, torture_assert_ntstatus_ok(tctx, status, "dcerpc_spoolss_EndDocPrinter failed"); torture_assert_werr_ok(tctx, e.out.result, "EndDocPrinter failed"); + return true; +} + +static bool test_DoPrintTest(struct torture_context *tctx, + struct dcerpc_binding_handle *b, + struct policy_handle *handle) +{ + bool ret = true; + uint32_t num_jobs = 8; + uint32_t *job_ids; + int i; + + job_ids = talloc_zero_array(tctx, uint32_t, num_jobs); + + for (i=0; i < num_jobs; i++) { + ret &= test_DoPrintTest_one_job(tctx, b, handle, &job_ids[i]); + } + ret &= test_AddJob(tctx, b, handle); ret &= test_EnumJobs(tctx, b, handle); - ret &= test_SetJob(tctx, b, handle, job_id, SPOOLSS_JOB_CONTROL_DELETE); + for (i=0; i < num_jobs; i++) { + ret &= test_SetJob(tctx, b, handle, job_ids[i], SPOOLSS_JOB_CONTROL_DELETE); + } return ret; } @@ -5132,6 +5151,18 @@ static bool test_one_printer(struct torture_context *tctx, bool ret = true; struct dcerpc_binding_handle *b = p->binding_handle; + if (!test_PausePrinter(tctx, b, handle)) { + ret = false; + } + + if (!test_DoPrintTest(tctx, b, handle)) { + ret = false; + } + + if (!test_ResumePrinter(tctx, b, handle)) { + ret = false; + } + if (!test_printer_info(tctx, b, handle)) { ret = false; } -- Samba Shared Repository