From 0c6aae4d53488738d2180947a31c6373bf6ec81d Mon Sep 17 00:00:00 2001 From: Günther Deschner Date: Sun, 31 Jan 2010 20:31:00 +0100 Subject: s4-smbtorture: also test RouterRefreshPrinterChangeNotify call in RPC-SPOOLSS-NOTIFY. Guenther --- source4/torture/rpc/spoolss_notify.c | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) diff --git a/source4/torture/rpc/spoolss_notify.c b/source4/torture/rpc/spoolss_notify.c index 1e441f9ac2..dc324861d0 100644 --- a/source4/torture/rpc/spoolss_notify.c +++ b/source4/torture/rpc/spoolss_notify.c @@ -292,6 +292,29 @@ static bool test_RemoteFindFirstPrinterChangeNotifyEx(struct torture_context *tc return true; } +static bool test_RouterRefreshPrinterChangeNotify(struct torture_context *tctx, + struct dcerpc_pipe *p, + struct policy_handle *handle, + struct spoolss_NotifyOption *options) +{ + struct spoolss_RouterRefreshPrinterChangeNotify r; + struct spoolss_NotifyInfo *info; + + torture_comment(tctx, "Testing RouterRefreshPrinterChangeNotify\n"); + + r.in.handle = handle; + r.in.change_low = 0; + r.in.options = options; + r.out.info = &info; + + torture_assert_ntstatus_ok(tctx, dcerpc_spoolss_RouterRefreshPrinterChangeNotify(p, tctx, &r), + "RouterRefreshPrinterChangeNotify failed"); + torture_assert_werr_ok(tctx, r.out.result, + "error return code for RouterRefreshPrinterChangeNotify"); + + return true; +} + static bool test_ClosePrinter(struct torture_context *tctx, struct dcerpc_pipe *p, struct policy_handle *handle) @@ -391,6 +414,8 @@ static bool test_RFFPCNEx(struct torture_context *tctx, torture_assert(tctx, received_packets, "no packets received"); torture_assert_int_equal(tctx, received_packets->opnum, NDR_SPOOLSS_REPLYOPENPRINTER, "no ReplyOpenPrinter packet after RemoteFindFirstPrinterChangeNotifyEx"); + torture_assert(tctx, test_RouterRefreshPrinterChangeNotify(tctx, p, &handle, NULL), ""); + torture_assert(tctx, test_RouterRefreshPrinterChangeNotify(tctx, p, &handle, server_option), ""); torture_assert(tctx, test_ClosePrinter(tctx, p, &handle), ""); tmp = last_packet(received_packets); torture_assert_int_equal(tctx, tmp->opnum, NDR_SPOOLSS_REPLYCLOSEPRINTER, -- cgit