diff options
author | Günther Deschner <gd@samba.org> | 2010-02-15 19:23:35 +0100 |
---|---|---|
committer | Günther Deschner <gd@samba.org> | 2010-02-15 22:12:55 +0100 |
commit | cdf2f6b672a17c34e7c16cc22c179e01d8281bcf (patch) | |
tree | bb9e508f6aa261cf50a2a046282e215c2804aef2 /source4/torture/rpc | |
parent | 1988f4274c3de5e4d1b807c83d27cd97cfc5bc0d (diff) | |
download | samba-cdf2f6b672a17c34e7c16cc22c179e01d8281bcf.tar.gz samba-cdf2f6b672a17c34e7c16cc22c179e01d8281bcf.tar.bz2 samba-cdf2f6b672a17c34e7c16cc22c179e01d8281bcf.zip |
s4-smbtorture: w2k8r2 allows to add printers w/o defining printprocessor.
Guenther
Diffstat (limited to 'source4/torture/rpc')
-rw-r--r-- | source4/torture/rpc/spoolss.c | 23 |
1 files changed, 14 insertions, 9 deletions
diff --git a/source4/torture/rpc/spoolss.c b/source4/torture/rpc/spoolss.c index e233a2752d..5303c942ce 100644 --- a/source4/torture/rpc/spoolss.c +++ b/source4/torture/rpc/spoolss.c @@ -3815,17 +3815,22 @@ static bool test_AddPrinter_normal(struct torture_context *tctx, dcerpc_spoolss_AddPrinter(p, tctx, &r), "failed to add printer"); result = ex ? rex.out.result : r.out.result; - torture_assert_werr_equal(tctx, result, WERR_UNKNOWN_PRINTPROCESSOR, - "unexpected result code"); - info2.printprocessor = "winprint"; + /* w2k8r2 allows to add printer w/o defining printprocessor */ - torture_assert_ntstatus_ok(tctx, ex ? dcerpc_spoolss_AddPrinterEx(p, tctx, &rex) : - dcerpc_spoolss_AddPrinter(p, tctx, &r), - "failed to add printer"); - result = ex ? rex.out.result : r.out.result; - torture_assert_werr_ok(tctx, result, - "failed to add printer"); + if (!W_ERROR_IS_OK(result)) { + torture_assert_werr_equal(tctx, result, WERR_UNKNOWN_PRINTPROCESSOR, + "unexpected result code"); + + info2.printprocessor = "winprint"; + + torture_assert_ntstatus_ok(tctx, ex ? dcerpc_spoolss_AddPrinterEx(p, tctx, &rex) : + dcerpc_spoolss_AddPrinter(p, tctx, &r), + "failed to add printer"); + result = ex ? rex.out.result : r.out.result; + torture_assert_werr_ok(tctx, result, + "failed to add printer"); + } *handle_p = handle; |