From cdf2f6b672a17c34e7c16cc22c179e01d8281bcf Mon Sep 17 00:00:00 2001 From: Günther Deschner Date: Mon, 15 Feb 2010 19:23:35 +0100 Subject: s4-smbtorture: w2k8r2 allows to add printers w/o defining printprocessor. Guenther --- source4/torture/rpc/spoolss.c | 23 ++++++++++++++--------- 1 file 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; -- cgit