diff options
author | Günther Deschner <gd@samba.org> | 2013-01-31 20:44:54 +0100 |
---|---|---|
committer | David Disseldorp <ddiss@samba.org> | 2013-05-20 18:50:00 +0200 |
commit | c51866eadf6159a6fa76af28be3b9a724ed28b46 (patch) | |
tree | 7c11af7120ccb95699bca0623f556e3ff7009ec8 /source4/torture/rpc | |
parent | aa1e5f29af2a4560eecaac08ed62c2e63d3c8504 (diff) | |
download | samba-c51866eadf6159a6fa76af28be3b9a724ed28b46.tar.gz samba-c51866eadf6159a6fa76af28be3b9a724ed28b46.tar.bz2 samba-c51866eadf6159a6fa76af28be3b9a724ed28b46.zip |
s4-torture: add simple test for spoolss_RpcSendRecvBidiData.
Guenther
Signed-off-by: Günther Deschner <gd@samba.org>
Reviewed-by: David Disseldorp <ddiss@samba.org>
Diffstat (limited to 'source4/torture/rpc')
-rw-r--r-- | source4/torture/rpc/spoolss.c | 44 |
1 files changed, 44 insertions, 0 deletions
diff --git a/source4/torture/rpc/spoolss.c b/source4/torture/rpc/spoolss.c index 5b24b15756..32cc2974c7 100644 --- a/source4/torture/rpc/spoolss.c +++ b/source4/torture/rpc/spoolss.c @@ -8370,6 +8370,49 @@ static bool test_printer_ic(struct torture_context *tctx, return true; } +static bool test_printer_bidi(struct torture_context *tctx, + void *private_data) +{ + struct torture_printer_context *t = + talloc_get_type_abort(private_data, + struct torture_printer_context); + struct dcerpc_pipe *p = t->spoolss_pipe; + struct dcerpc_binding_handle *b = p->binding_handle; + struct spoolss_RpcSendRecvBidiData r; + struct RPC_BIDI_REQUEST_CONTAINER bidi_req; + struct RPC_BIDI_RESPONSE_CONTAINER *bidi_rep = NULL; + + if (torture_setting_bool(tctx, "samba3", false)) { + torture_skip(tctx, "skip printer bidirectional tests against samba"); + } + + ZERO_STRUCT(bidi_req); + + r.in.hPrinter = t->handle; + r.in.pAction = "foobar"; + r.in.pReqData = &bidi_req; + r.out.ppRespData = &bidi_rep; + + torture_assert_ntstatus_ok(tctx, + dcerpc_spoolss_RpcSendRecvBidiData_r(b, tctx, &r), + "RpcSendRecvBidiData failed"); + torture_assert_werr_equal(tctx, r.out.result, WERR_NOT_SUPPORTED, + "RpcSendRecvBidiData failed"); + + if (!(t->info2.attributes & PRINTER_ATTRIBUTE_ENABLE_BIDI)) { + torture_skip(tctx, "skipping further tests as printer is not BIDI enabled"); + } + + r.in.pAction = BIDI_ACTION_ENUM_SCHEMA; + + torture_assert_ntstatus_ok(tctx, + dcerpc_spoolss_RpcSendRecvBidiData_r(b, tctx, &r), + "RpcSendRecvBidiData failed"); + torture_assert_werr_ok(tctx, r.out.result, + "RpcSendRecvBidiData failed"); + + return true; +} static bool test_driver_info_winreg(struct torture_context *tctx, void *private_data) @@ -8413,6 +8456,7 @@ void torture_tcase_printer(struct torture_tcase *tcase) torture_tcase_add_simple_test(tcase, "driver_info_winreg", test_driver_info_winreg); torture_tcase_add_simple_test(tcase, "printer_rename", test_printer_rename); torture_tcase_add_simple_test(tcase, "printer_ic", test_printer_ic); + torture_tcase_add_simple_test(tcase, "bidi", test_printer_bidi); } struct torture_suite *torture_rpc_spoolss_printer(TALLOC_CTX *mem_ctx) |