From bdfb9a43d33ab0bff84591914566a8dff3f4cb46 Mon Sep 17 00:00:00 2001 From: =?utf8?q?G=C3=BCnther=20Deschner?= Date: Wed, 28 Apr 2010 18:29:18 +0200 Subject: [PATCH] s4-smbtorture: add test for rap_NetPrintQEnum. Guenther --- source4/torture/rap/printing.c | 36 ++++++++++++++++++++++++++++++++++ 1 file changed, 36 insertions(+) diff --git a/source4/torture/rap/printing.c b/source4/torture/rap/printing.c index ab32dbb1d74..b57151aee19 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