s4-smbtorture: add test_SetPrinter to RPC-SPOOLSS.
authorGünther Deschner <gd@samba.org>
Wed, 6 Jan 2010 18:33:39 +0000 (19:33 +0100)
committerGünther Deschner <gd@samba.org>
Wed, 6 Jan 2010 21:09:36 +0000 (22:09 +0100)
Guenther

source4/torture/rpc/spoolss.c

index d37384201b4c5cf1a589dd097029afef58d99d65..b8ed50157561c1042ff78a49b187ec9a70dd36a4 100644 (file)
@@ -933,6 +933,32 @@ static bool test_GetPrinter(struct torture_context *tctx,
        return true;
 }
 
+static bool test_SetPrinter(struct torture_context *tctx,
+                           struct dcerpc_pipe *p,
+                           struct policy_handle *handle,
+                           struct spoolss_SetPrinterInfoCtr *info_ctr,
+                           struct spoolss_DevmodeContainer *devmode_ctr,
+                           struct sec_desc_buf *secdesc_ctr,
+                           enum spoolss_PrinterControl command)
+{
+       struct spoolss_SetPrinter r;
+
+       r.in.handle = handle;
+       r.in.info_ctr = info_ctr;
+       r.in.devmode_ctr = devmode_ctr;
+       r.in.secdesc_ctr = secdesc_ctr;
+       r.in.command = command;
+
+       torture_comment(tctx, "Testing SetPrinter Level %d\n", r.in.info_ctr->level);
+
+       torture_assert_ntstatus_ok(tctx, dcerpc_spoolss_SetPrinter(p, tctx, &r),
+               "failed to call SetPrinter");
+       torture_assert_werr_ok(tctx, r.out.result,
+               "failed to call SetPrinter");
+
+       return true;
+}
+
 static bool test_SetPrinter_errors(struct torture_context *tctx,
                                   struct dcerpc_pipe *p,
                                   struct policy_handle *handle)