From 038628b9c5eb033213e187b38f8260573cbf6b17 Mon Sep 17 00:00:00 2001 From: Stefan Metzmacher Date: Thu, 16 Jun 2005 16:46:42 +0000 Subject: r7642: - test NULL server_name in GetPrinterDriverDirectory() too, (same result as "") - test EnumForms() on the PrintServer (NT4 returns WERR_BADFID) (jerry: how do it get the lists of forms in the printserver gui) metze (This used to be commit fddfe1f04b3ae594e75d702aba4d17ee4d103b8e) --- source4/torture/rpc/spoolss.c | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/source4/torture/rpc/spoolss.c b/source4/torture/rpc/spoolss.c index 86a8c7155f..d5a57ae79a 100644 --- a/source4/torture/rpc/spoolss.c +++ b/source4/torture/rpc/spoolss.c @@ -219,6 +219,9 @@ static BOOL test_GetPrinterDriverDirectory(struct test_spoolss_context *ctx) uint16_t level; const char *server; } levels[] = {{ + .level = 1, + .server = NULL + },{ .level = 1, .server = "" },{ @@ -846,7 +849,7 @@ static BOOL test_GetForm(struct dcerpc_pipe *p, TALLOC_CTX *mem_ctx, } static BOOL test_EnumForms(struct dcerpc_pipe *p, TALLOC_CTX *mem_ctx, - struct policy_handle *handle) + struct policy_handle *handle, BOOL print_server) { NTSTATUS status; struct spoolss_EnumForms r; @@ -864,6 +867,11 @@ static BOOL test_EnumForms(struct dcerpc_pipe *p, TALLOC_CTX *mem_ctx, return False; } + if (print_server && W_ERROR_EQUAL(r.out.result,WERR_BADFID)) { + printf("EnumForms on the PrintServer isn't supported by test server (NT4)\n"); + return True; + } + if (W_ERROR_EQUAL(r.out.result, WERR_INSUFFICIENT_BUFFER)) { union spoolss_FormInfo *info; int j; @@ -1809,7 +1817,7 @@ static BOOL test_OpenPrinterEx(struct dcerpc_pipe *p, TALLOC_CTX *mem_ctx, ret = False; } - if (!test_EnumForms(p, mem_ctx, &handle)) { + if (!test_EnumForms(p, mem_ctx, &handle, False)) { ret = False; } @@ -2064,6 +2072,8 @@ BOOL torture_rpc_spoolss(void) ret &= test_GetPrinterData(ctx->p, ctx, &ctx->server_handle, "Architecture"); ret &= test_GetPrinterData(ctx->p, ctx, &ctx->server_handle, "DsPresent"); + ret &= test_EnumForms(ctx->p, ctx, &ctx->server_handle, True); + ret &= test_EnumPorts(ctx); ret &= test_GetPrinterDriverDirectory(ctx); -- cgit