s4-smbtorture: use test_SetPrinter call in spoolss security descriptor tests.
authorGünther Deschner <gd@samba.org>
Mon, 15 Feb 2010 20:55:06 +0000 (21:55 +0100)
committerGünther Deschner <gd@samba.org>
Mon, 15 Feb 2010 21:15:33 +0000 (22:15 +0100)
Guenther

source4/torture/rpc/spoolss.c

index 5303c942ce557f7eb65f17372432b5c426ea22f3..242b3053937ad04288efb2df580fb3ecdb8ba355 100644 (file)
@@ -951,7 +951,7 @@ static bool test_SetPrinter(struct torture_context *tctx,
        r.in.secdesc_ctr = secdesc_ctr;
        r.in.command = command;
 
        r.in.secdesc_ctr = secdesc_ctr;
        r.in.command = command;
 
-       torture_comment(tctx, "Testing SetPrinter Level %d\n", r.in.info_ctr->level);
+       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_ntstatus_ok(tctx, dcerpc_spoolss_SetPrinter(p, tctx, &r),
                "failed to call SetPrinter");
@@ -1578,7 +1578,6 @@ static bool test_sd_set_level(struct torture_context *tctx,
                              uint32_t level,
                              struct security_descriptor *sd)
 {
                              uint32_t level,
                              struct security_descriptor *sd)
 {
-       struct spoolss_SetPrinter r;
        struct spoolss_SetPrinterInfoCtr info_ctr;
        struct spoolss_DevmodeContainer devmode_ctr;
        struct sec_desc_buf secdesc_ctr;
        struct spoolss_SetPrinterInfoCtr info_ctr;
        struct spoolss_DevmodeContainer devmode_ctr;
        struct sec_desc_buf secdesc_ctr;
@@ -1635,14 +1634,8 @@ static bool test_sd_set_level(struct torture_context *tctx,
 
        secdesc_ctr.sd = sd;
 
 
        secdesc_ctr.sd = sd;
 
-       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 = 0;
-
-       torture_assert_ntstatus_ok(tctx, dcerpc_spoolss_SetPrinter(p, tctx, &r), "SetPrinter failed");
-       torture_assert_werr_ok(tctx, r.out.result, "SetPrinter failed");
+       torture_assert(tctx,
+               test_SetPrinter(tctx, p, handle, &info_ctr, &devmode_ctr, &secdesc_ctr, 0), "");
 
        return true;
 }
 
        return true;
 }
@@ -1709,7 +1702,6 @@ static bool test_PrinterInfo_SD(struct torture_context *tctx,
                                struct policy_handle *handle)
 {
        union spoolss_PrinterInfo info;
                                struct policy_handle *handle)
 {
        union spoolss_PrinterInfo info;
-       struct spoolss_SetPrinter r;
        struct spoolss_SetPrinterInfo3 info3;
        struct spoolss_SetPrinterInfoCtr info_ctr;
        struct spoolss_DevmodeContainer devmode_ctr;
        struct spoolss_SetPrinterInfo3 info3;
        struct spoolss_SetPrinterInfoCtr info_ctr;
        struct spoolss_DevmodeContainer devmode_ctr;
@@ -1739,14 +1731,8 @@ static bool test_PrinterInfo_SD(struct torture_context *tctx,
 
        secdesc_ctr.sd = sd;
 
 
        secdesc_ctr.sd = sd;
 
-       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 = 0;
-
-       torture_assert_ntstatus_ok(tctx, dcerpc_spoolss_SetPrinter(p, tctx, &r), "SetPrinter failed");
-       torture_assert_werr_ok(tctx, r.out.result, "SetPrinter failed");
+       torture_assert(tctx,
+               test_SetPrinter(tctx, p, handle, &info_ctr, &devmode_ctr, &secdesc_ctr, 0), "");
 
        return ret;
 }
 
        return ret;
 }