summaryrefslogtreecommitdiff
path: root/source4/torture/rap
diff options
context:
space:
mode:
authorGünther Deschner <gd@samba.org>2010-04-29 13:18:33 +0200
committerGünther Deschner <gd@samba.org>2010-04-29 13:47:33 +0200
commit0df8c9ffde0e8692e5fa3898b2f559aa9f0e0fe6 (patch)
tree8a71d65b1fb440711f35dc7a81911be6616c2d02 /source4/torture/rap
parent169b72dce432bc6c5afc6a14ddf80dedcb467178 (diff)
downloadsamba-0df8c9ffde0e8692e5fa3898b2f559aa9f0e0fe6.tar.gz
samba-0df8c9ffde0e8692e5fa3898b2f559aa9f0e0fe6.tar.bz2
samba-0df8c9ffde0e8692e5fa3898b2f559aa9f0e0fe6.zip
s4-smbtorture: add smbcli_rap_netprintqgetinfo().
Guenther
Diffstat (limited to 'source4/torture/rap')
-rw-r--r--source4/torture/rap/rap.c85
1 files changed, 85 insertions, 0 deletions
diff --git a/source4/torture/rap/rap.c b/source4/torture/rap/rap.c
index e553f9687d..e1191bb731 100644
--- a/source4/torture/rap/rap.c
+++ b/source4/torture/rap/rap.c
@@ -681,6 +681,91 @@ NTSTATUS smbcli_rap_netprintqenum(struct smbcli_tree *tree,
return result;
}
+NTSTATUS smbcli_rap_netprintqgetinfo(struct smbcli_tree *tree,
+ struct smb_iconv_convenience *iconv_convenience,
+ TALLOC_CTX *mem_ctx,
+ struct rap_NetPrintQGetInfo *r)
+{
+ struct rap_call *call;
+ NTSTATUS result = NT_STATUS_UNSUCCESSFUL;
+
+ if (!(call = new_rap_cli_call(mem_ctx, iconv_convenience, RAP_WPrintQGetInfo))) {
+ return NT_STATUS_NO_MEMORY;
+ }
+
+ rap_cli_push_string(call, r->in.PrintQueueName);
+ rap_cli_push_word(call, r->in.level);
+ rap_cli_push_rcvbuf(call, r->in.bufsize);
+ rap_cli_expect_word(call);
+
+ switch(r->in.level) {
+ case 0:
+ rap_cli_expect_format(call, "B13");
+ break;
+ case 1:
+ rap_cli_expect_format(call, "B13BWWWzzzzzWW");
+ break;
+ case 2:
+ rap_cli_expect_format(call, "B13BWWWzzzzzWN");
+ break;
+ case 3:
+ rap_cli_expect_format(call, "zWWWWzzzzWWzzl");
+ break;
+ case 4:
+ rap_cli_expect_format(call, "zWWWWzzzzWNzzl");
+ break;
+ case 5:
+ rap_cli_expect_format(call, "z");
+ break;
+ default:
+ result = NT_STATUS_INVALID_PARAMETER;
+ goto done;
+ }
+
+ if (DEBUGLEVEL >= 10) {
+ NDR_PRINT_IN_DEBUG(rap_NetPrintQGetInfo, r);
+ }
+
+ result = rap_cli_do_call(tree, iconv_convenience, call);
+
+ if (!NT_STATUS_IS_OK(result))
+ goto done;
+
+ result = NT_STATUS_INVALID_PARAMETER;
+
+ NDR_GOTO(ndr_pull_uint16(call->ndr_pull_param, NDR_SCALARS, &r->out.status));
+ NDR_GOTO(ndr_pull_uint16(call->ndr_pull_param, NDR_SCALARS, &r->out.convert));
+ NDR_GOTO(ndr_pull_uint16(call->ndr_pull_param, NDR_SCALARS, &r->out.available));
+
+ switch(r->in.level) {
+ case 0:
+ result = rap_pull_rap_PrintQueue0(mem_ctx, call->ndr_pull_data, r->out.convert, &r->out.info.info0);
+ break;
+ case 1:
+ result = rap_pull_rap_PrintQueue1(mem_ctx, call->ndr_pull_data, r->out.convert, &r->out.info.info1);
+ break;
+ case 3:
+ result = rap_pull_rap_PrintQueue3(mem_ctx, call->ndr_pull_data, r->out.convert, &r->out.info.info3);
+ break;
+ case 5:
+ result = rap_pull_rap_PrintQueue5(mem_ctx, call->ndr_pull_data, r->out.convert, &r->out.info.info5);
+ break;
+ }
+
+ if (!NT_STATUS_IS_OK(result)) {
+ goto done;
+ }
+
+ if (DEBUGLEVEL >= 10) {
+ NDR_PRINT_OUT_DEBUG(rap_NetPrintQGetInfo, r);
+ }
+
+ done:
+ talloc_free(call);
+ return result;
+}
+
+
static bool test_netservergetinfo(struct torture_context *tctx,
struct smbcli_state *cli)
{