summaryrefslogtreecommitdiff
path: root/source4/torture/rpc
diff options
context:
space:
mode:
authorGünther Deschner <gd@samba.org>2009-02-09 22:22:45 +0100
committerGünther Deschner <gd@samba.org>2009-02-25 23:48:29 +0100
commit8bf0c256d7f06fe7d0abf031921abd83e6956c8b (patch)
tree8d44f3c550abcf1852c9a6db1c2b7354bd80c641 /source4/torture/rpc
parent9b8bb1ad957f9c2d91e55ac6a27657cd8f6d4a14 (diff)
downloadsamba-8bf0c256d7f06fe7d0abf031921abd83e6956c8b.tar.gz
samba-8bf0c256d7f06fe7d0abf031921abd83e6956c8b.tar.bz2
samba-8bf0c256d7f06fe7d0abf031921abd83e6956c8b.zip
s4-smbtorture: add test_AddJob test to RPC-SPOOLSS test.
Guenther
Diffstat (limited to 'source4/torture/rpc')
-rw-r--r--source4/torture/rpc/spoolss.c29
1 files changed, 29 insertions, 0 deletions
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);