summaryrefslogtreecommitdiff
path: root/source4/torture
diff options
context:
space:
mode:
authorGünther Deschner <gd@samba.org>2010-04-28 18:29:18 +0200
committerGünther Deschner <gd@samba.org>2010-04-28 23:23:38 +0200
commitbdfb9a43d33ab0bff84591914566a8dff3f4cb46 (patch)
tree98541bf76a2307dd55933398208ea2934f5e350a /source4/torture
parent03d83128dd9d24d9aabeef51895f8995ae5a3b81 (diff)
downloadsamba-bdfb9a43d33ab0bff84591914566a8dff3f4cb46.tar.gz
samba-bdfb9a43d33ab0bff84591914566a8dff3f4cb46.tar.bz2
samba-bdfb9a43d33ab0bff84591914566a8dff3f4cb46.zip
s4-smbtorture: add test for rap_NetPrintQEnum.
Guenther
Diffstat (limited to 'source4/torture')
-rw-r--r--source4/torture/rap/printing.c36
1 files changed, 36 insertions, 0 deletions
diff --git a/source4/torture/rap/printing.c b/source4/torture/rap/printing.c
index ab32dbb1d7..b57151aee1 100644
--- a/source4/torture/rap/printing.c
+++ b/source4/torture/rap/printing.c
@@ -63,6 +63,41 @@ static bool test_raw_print(struct torture_context *tctx,
return true;
}
+static bool test_netprintqenum(struct torture_context *tctx,
+ struct smbcli_state *cli)
+{
+ struct rap_NetPrintQEnum r;
+ int i, q;
+ uint16_t levels[] = { 0, 1 };
+ NTSTATUS status;
+
+ for (i=0; i < ARRAY_SIZE(levels); i++) {
+
+ r.in.level = levels[i];
+ r.in.bufsize = 8192;
+
+ torture_comment(tctx,
+ "Testing rap_NetPrintQEnum level %d\n", r.in.level);
+
+ status = smbcli_rap_netprintqenum(cli->tree, lp_iconv_convenience(tctx->lp_ctx), tctx, &r);
+ if (!NT_STATUS_IS_OK(status)) {
+ torture_warning(tctx, "smbcli_rap_netprintqenum failed with %s\n", nt_errstr(status));
+ continue;
+ }
+
+ for (q=0; q<r.out.count; q++) {
+ switch (r.in.level) {
+ case 0:
+ printf("%s\n", r.out.info[q].info0.PrintQName);
+ break;
+ }
+ }
+ }
+
+ return true;
+}
+
+
static bool test_rap_print(struct torture_context *tctx,
struct smbcli_state *cli)
{
@@ -83,6 +118,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);
return suite;
}