s4-smbtorture: Make sure RPC-SPOOLSS and RPC-SPOOLSS-PRINTER pass against s3.
authorGünther Deschner <gd@samba.org>
Tue, 1 Jun 2010 14:46:37 +0000 (16:46 +0200)
committerGünther Deschner <gd@samba.org>
Tue, 1 Jun 2010 14:49:24 +0000 (16:49 +0200)
Printjobs are extremely fragile beasts on paused virtual printers within make
test. Very often the printq updater in the background is not fast enough, so
subsequent tests don't get to the updated information. Something to remember and
to work on later...

Guenther

source4/torture/rpc/spoolss.c

index d5b0f0ea77a412de58562553a6b551edb185767e..233d6e7ec88f7b170bea9c7bf858143cb86c75b1 100644 (file)
@@ -3258,6 +3258,35 @@ static bool test_DoPrintTest(struct torture_context *tctx,
        uint32_t *job_ids;
        int i;
 
+       torture_comment(tctx, "Testing real print operations\n");
+
+       job_ids = talloc_zero_array(tctx, uint32_t, num_jobs);
+
+       for (i=0; i < num_jobs; i++) {
+               ret &= test_DoPrintTest_add_one_job(tctx, b, handle, &job_ids[i]);
+       }
+
+       for (i=0; i < num_jobs; i++) {
+               ret &= test_SetJob(tctx, b, handle, job_ids[i], NULL, SPOOLSS_JOB_CONTROL_DELETE);
+       }
+
+       if (ret == true) {
+               torture_comment(tctx, "real print operations test succeeded\n\n");
+       }
+
+       return ret;
+}
+
+static bool test_DoPrintTest_extended(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;
+       torture_comment(tctx, "Testing real print operations (extended)\n");
+
        job_ids = talloc_zero_array(tctx, uint32_t, num_jobs);
 
        for (i=0; i < num_jobs; i++) {
@@ -3270,6 +3299,10 @@ static bool test_DoPrintTest(struct torture_context *tctx,
                ret &= test_SetJob(tctx, b, handle, job_ids[i], NULL, SPOOLSS_JOB_CONTROL_DELETE);
        }
 
+       if (ret == true) {
+               torture_comment(tctx, "real print operations (extended) test succeeded\n\n");
+       }
+
        return ret;
 }
 
@@ -6347,6 +6380,10 @@ static bool test_one_printer(struct torture_context *tctx,
                ret = false;
        }
 
+       if (!test_DoPrintTest_extended(tctx, b, handle)) {
+               torture_comment(tctx, "extended printing test failed!\n");
+       }
+
        if (!test_ResumePrinter(tctx, b, handle)) {
                ret = false;
        }