diff options
author | Andrew Bartlett <abartlet@samba.org> | 2009-04-14 10:55:53 +1000 |
---|---|---|
committer | Andrew Bartlett <abartlet@samba.org> | 2009-04-14 10:55:53 +1000 |
commit | 41e4f12c482082d6e622d1fdc830e38853cdbd8b (patch) | |
tree | 754245cda53332b540b7a85a0d5d0f2674edd92c /source4/torture/rpc/spoolss_notify.c | |
parent | 82ad66e9dfd30f7ffe912f6c9198908c40802ac4 (diff) | |
parent | fc056e561b95fb7869053bdec810e8c47e6c6dc2 (diff) | |
download | samba-41e4f12c482082d6e622d1fdc830e38853cdbd8b.tar.gz samba-41e4f12c482082d6e622d1fdc830e38853cdbd8b.tar.bz2 samba-41e4f12c482082d6e622d1fdc830e38853cdbd8b.zip |
Merge branch 'master' of ssh://git.samba.org/data/git/samba into master-devel
Diffstat (limited to 'source4/torture/rpc/spoolss_notify.c')
-rw-r--r-- | source4/torture/rpc/spoolss_notify.c | 36 |
1 files changed, 36 insertions, 0 deletions
diff --git a/source4/torture/rpc/spoolss_notify.c b/source4/torture/rpc/spoolss_notify.c index b7f2d3c410..a8a0ca5df6 100644 --- a/source4/torture/rpc/spoolss_notify.c +++ b/source4/torture/rpc/spoolss_notify.c @@ -289,6 +289,41 @@ static bool test_RFFPCNEx(struct torture_context *tctx, return true; } +/** Test that makes sure that calling ReplyOpenPrinter() + * on Samba 4 will cause an irpc broadcast call. + */ +static bool test_ReplyOpenPrinter(struct torture_context *tctx, + struct dcerpc_pipe *pipe) +{ + struct spoolss_ReplyOpenPrinter r; + struct spoolss_ReplyClosePrinter s; + struct policy_handle h; + + r.in.server_name = "earth"; + r.in.printer_local = 2; + r.in.type = REG_DWORD; + r.in.bufsize = 0; + r.in.buffer = NULL; + r.out.handle = &h; + + torture_assert_ntstatus_ok(tctx, + dcerpc_spoolss_ReplyOpenPrinter(pipe, tctx, &r), + "spoolss_ReplyOpenPrinter call failed"); + + torture_assert_werr_ok(tctx, r.out.result, "error return code"); + + s.in.handle = &h; + s.out.handle = &h; + + torture_assert_ntstatus_ok(tctx, + dcerpc_spoolss_ReplyClosePrinter(pipe, tctx, &s), + "spoolss_ReplyClosePrinter call failed"); + + torture_assert_werr_ok(tctx, r.out.result, "error return code"); + + return true; +} + struct torture_suite *torture_rpc_spoolss_notify(TALLOC_CTX *mem_ctx) { struct torture_suite *suite = torture_suite_create(mem_ctx, "SPOOLSS-NOTIFY"); @@ -297,6 +332,7 @@ struct torture_suite *torture_rpc_spoolss_notify(TALLOC_CTX *mem_ctx) "notify", &ndr_table_spoolss); torture_rpc_tcase_add_test(tcase, "testRFFPCNEx", test_RFFPCNEx); + torture_rpc_tcase_add_test(tcase, "testReplyOpenPrinter", test_ReplyOpenPrinter); return suite; } |