From 24373c16a5b3e96ea3adc18e7aac837be59fb2c2 Mon Sep 17 00:00:00 2001 From: Günther Deschner Date: Fri, 20 Feb 2009 14:22:39 +0100 Subject: s4-smbtorture: fix eventlog getinformation test. Guenther --- source4/torture/rpc/eventlog.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'source4/torture/rpc') diff --git a/source4/torture/rpc/eventlog.c b/source4/torture/rpc/eventlog.c index 2fd9d923f1..10c4886259 100644 --- a/source4/torture/rpc/eventlog.c +++ b/source4/torture/rpc/eventlog.c @@ -306,7 +306,7 @@ static bool test_GetLogInformation(struct torture_context *tctx, struct dcerpc_pipe *p) { NTSTATUS status; - struct eventlog_GetLogIntormation r; + struct eventlog_GetLogInformation r; struct eventlog_CloseEventLog cr; struct policy_handle handle; uint32_t bytes_needed = 0; @@ -320,14 +320,14 @@ static bool test_GetLogInformation(struct torture_context *tctx, r.out.buffer = NULL; r.out.bytes_needed = &bytes_needed; - status = dcerpc_eventlog_GetLogIntormation(p, tctx, &r); + status = dcerpc_eventlog_GetLogInformation(p, tctx, &r); torture_assert_ntstatus_equal(tctx, status, NT_STATUS_INVALID_LEVEL, "GetLogInformation failed"); r.in.level = 0; - status = dcerpc_eventlog_GetLogIntormation(p, tctx, &r); + status = dcerpc_eventlog_GetLogInformation(p, tctx, &r); torture_assert_ntstatus_equal(tctx, status, NT_STATUS_BUFFER_TOO_SMALL, "GetLogInformation failed"); @@ -335,7 +335,7 @@ static bool test_GetLogInformation(struct torture_context *tctx, r.in.buf_size = bytes_needed; r.out.buffer = talloc_array(tctx, uint8_t, bytes_needed); - status = dcerpc_eventlog_GetLogIntormation(p, tctx, &r); + status = dcerpc_eventlog_GetLogInformation(p, tctx, &r); torture_assert_ntstatus_ok(tctx, status, "GetLogInformation failed"); -- cgit From 666cc916ebea618fbf7bfed99dbfff38326189fa Mon Sep 17 00:00:00 2001 From: Günther Deschner Date: Wed, 25 Feb 2009 16:17:44 +0100 Subject: s4-smbtorture: add test_GetPrintProcessorDirectory to RPC-SPOOLSS. Guenther --- source4/torture/rpc/spoolss.c | 64 +++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 64 insertions(+) (limited to 'source4/torture/rpc') diff --git a/source4/torture/rpc/spoolss.c b/source4/torture/rpc/spoolss.c index de600e8fb3..f8a66e7753 100644 --- a/source4/torture/rpc/spoolss.c +++ b/source4/torture/rpc/spoolss.c @@ -168,6 +168,69 @@ static bool test_EnumPorts(struct torture_context *tctx, return true; } +static bool test_GetPrintProcessorDirectory(struct torture_context *tctx, + struct dcerpc_pipe *p, + struct test_spoolss_context *ctx) +{ + NTSTATUS status; + struct spoolss_GetPrintProcessorDirectory r; + struct { + uint16_t level; + const char *server; + } levels[] = {{ + .level = 1, + .server = NULL + },{ + .level = 1, + .server = "" + },{ + .level = 78, + .server = "" + },{ + .level = 1, + .server = talloc_asprintf(ctx, "\\\\%s", dcerpc_server_name(p)) + },{ + .level = 1024, + .server = talloc_asprintf(ctx, "\\\\%s", dcerpc_server_name(p)) + } + }; + int i; + uint32_t needed; + + for (i=0;iserver_handle, true); ret &= test_EnumPorts(torture, p, ctx); ret &= test_GetPrinterDriverDirectory(torture, p, ctx); + ret &= test_GetPrintProcessorDirectory(torture, p, ctx); ret &= test_EnumPrinterDrivers(torture, p, ctx); ret &= test_EnumMonitors(torture, p, ctx); ret &= test_EnumPrintProcessors(torture, p, ctx); -- cgit From 6cd30a351a13822a557f20de3abe04bd8b2e3112 Mon Sep 17 00:00:00 2001 From: Günther Deschner Date: Wed, 25 Feb 2009 21:10:44 +0100 Subject: s4-smbtorture: expand RPC-SPOOLSS enumform and getform tests for level 2 forms. Guenther --- source4/torture/rpc/spoolss.c | 74 ++++++++++++++++++++++++------------------- 1 file changed, 42 insertions(+), 32 deletions(-) (limited to 'source4/torture/rpc') diff --git a/source4/torture/rpc/spoolss.c b/source4/torture/rpc/spoolss.c index f8a66e7753..04c9768ea8 100644 --- a/source4/torture/rpc/spoolss.c +++ b/source4/torture/rpc/spoolss.c @@ -742,7 +742,8 @@ static bool test_ClosePrinter(struct torture_context *tctx, static bool test_GetForm(struct torture_context *tctx, struct dcerpc_pipe *p, struct policy_handle *handle, - const char *form_name) + const char *form_name, + uint32_t level) { NTSTATUS status; struct spoolss_GetForm r; @@ -750,12 +751,12 @@ static bool test_GetForm(struct torture_context *tctx, r.in.handle = handle; r.in.form_name = form_name; - r.in.level = 1; + r.in.level = level; r.in.buffer = NULL; r.in.offered = 0; r.out.needed = &needed; - torture_comment(tctx, "Testing GetForm\n"); + torture_comment(tctx, "Testing GetForm level %d\n", r.in.level); status = dcerpc_spoolss_GetForm(p, tctx, &r); torture_assert_ntstatus_ok(tctx, status, "GetForm failed"); @@ -787,45 +788,54 @@ static bool test_EnumForms(struct torture_context *tctx, bool ret = true; uint32_t needed; uint32_t count; + uint32_t levels[] = { 1, 2 }; + int i; - r.in.handle = handle; - r.in.level = 1; - r.in.buffer = NULL; - r.in.offered = 0; - r.out.needed = &needed; - r.out.count = &count; + for (i=0; i Date: Mon, 9 Feb 2009 22:22:45 +0100 Subject: s4-smbtorture: add test_AddJob test to RPC-SPOOLSS test. Guenther --- source4/torture/rpc/spoolss.c | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) (limited to 'source4/torture/rpc') diff --git a/source4/torture/rpc/spoolss.c b/source4/torture/rpc/spoolss.c index 04c9768ea8..9d8bc4b186 100644 --- a/source4/torture/rpc/spoolss.c +++ b/source4/torture/rpc/spoolss.c @@ -1045,6 +1045,33 @@ static bool test_SetJob(struct torture_context *tctx, return true; } +static bool test_AddJob(struct torture_context *tctx, + struct dcerpc_pipe *p, + struct policy_handle *handle) +{ + NTSTATUS status; + struct spoolss_AddJob r; + uint32_t needed; + + r.in.level = 0; + r.in.handle = handle; + r.in.offered = 0; + r.out.needed = &needed; + + torture_comment(tctx, "Testing AddJob\n"); + + status = dcerpc_spoolss_AddJob(p, tctx, &r); + torture_assert_werr_equal(tctx, r.out.result, WERR_UNKNOWN_LEVEL, "AddJob failed"); + + r.in.level = 1; + + status = dcerpc_spoolss_AddJob(p, tctx, &r); + torture_assert_werr_equal(tctx, r.out.result, WERR_INVALID_PARAM, "AddJob failed"); + + return true; +} + + static bool test_EnumJobs(struct torture_context *tctx, struct dcerpc_pipe *p, struct policy_handle *handle) @@ -1084,6 +1111,7 @@ static bool test_EnumJobs(struct torture_context *tctx, info = r.out.info; for (j = 0; j < count; j++) { + test_GetJob(tctx, p, handle, info[j].info1.job_id); test_SetJob(tctx, p, handle, info[j].info1.job_id, SPOOLSS_JOB_CONTROL_PAUSE); test_SetJob(tctx, p, handle, info[j].info1.job_id, SPOOLSS_JOB_CONTROL_RESUME); @@ -1163,6 +1191,7 @@ static bool test_DoPrintTest(struct torture_context *tctx, torture_assert_ntstatus_ok(tctx, status, "dcerpc_spoolss_EndDocPrinter failed"); torture_assert_werr_ok(tctx, e.out.result, "EndDocPrinter failed"); + ret &= test_AddJob(tctx, p, handle); ret &= test_EnumJobs(tctx, p, handle); ret &= test_SetJob(tctx, p, handle, job_id, SPOOLSS_JOB_CONTROL_DELETE); -- cgit