diff options
author | Günther Deschner <gd@samba.org> | 2010-04-29 13:19:23 +0200 |
---|---|---|
committer | Günther Deschner <gd@samba.org> | 2010-04-29 13:47:33 +0200 |
commit | 5e8db42d50809b7664bc7c477010b689918e62c8 (patch) | |
tree | 7c79007f43a3b4412f47ade395dae5b9825d0f1b /source4 | |
parent | 0df8c9ffde0e8692e5fa3898b2f559aa9f0e0fe6 (diff) | |
download | samba-5e8db42d50809b7664bc7c477010b689918e62c8.tar.gz samba-5e8db42d50809b7664bc7c477010b689918e62c8.tar.bz2 samba-5e8db42d50809b7664bc7c477010b689918e62c8.zip |
s4-smbtorture: add test_netprintqgetinfo to RAP-PRINTING.
Guenther
Diffstat (limited to 'source4')
-rw-r--r-- | source4/torture/rap/printing.c | 44 |
1 files changed, 44 insertions, 0 deletions
diff --git a/source4/torture/rap/printing.c b/source4/torture/rap/printing.c index 7030c39436..7ae8ceae2f 100644 --- a/source4/torture/rap/printing.c +++ b/source4/torture/rap/printing.c @@ -97,6 +97,49 @@ static bool test_netprintqenum(struct torture_context *tctx, return true; } +static bool test_netprintqgetinfo(struct torture_context *tctx, + struct smbcli_state *cli) +{ + struct rap_NetPrintQGetInfo r; + struct rap_NetPrintQEnum r_enum; + int i, p; + uint16_t levels[] = { 0, 1, 3, 5 }; + NTSTATUS status; + + r_enum.in.level = 5; + r_enum.in.bufsize = 8192; + + torture_assert_ntstatus_ok(tctx, + smbcli_rap_netprintqenum(cli->tree, lp_iconv_convenience(tctx->lp_ctx), tctx, &r_enum), + "failed to enum printq"); + + for (p=0; p < r_enum.out.count; p++) { + + for (i=0; i < ARRAY_SIZE(levels); i++) { + + r.in.level = levels[i]; + r.in.bufsize = 8192; + r.in.PrintQueueName = r_enum.out.info[p].info5.PrintQueueName; + + torture_comment(tctx, "Testing rap_NetPrintQGetInfo(%s) level %d\n", + r.in.PrintQueueName, r.in.level); + + status = smbcli_rap_netprintqgetinfo(cli->tree, lp_iconv_convenience(tctx->lp_ctx), tctx, &r); + if (!NT_STATUS_IS_OK(status)) { + torture_warning(tctx, "smbcli_rap_netprintqgetinfo failed with %s\n", nt_errstr(status)); + continue; + } + + switch (r.in.level) { + case 0: + printf("%s\n", r.out.info.info0.PrintQName); + break; + } + } + } + + return true; +} static bool test_rap_print(struct torture_context *tctx, struct smbcli_state *cli) @@ -119,6 +162,7 @@ struct torture_suite *torture_rap_printing(TALLOC_CTX *mem_ctx) torture_suite_add_1smb_test(suite, "raw_print", test_raw_print); torture_suite_add_1smb_test(suite, "rap_print", test_rap_print); torture_suite_add_1smb_test(suite, "rap_printq_enum", test_netprintqenum); + torture_suite_add_1smb_test(suite, "rap_printq_getinfo", test_netprintqgetinfo); return suite; } |