summaryrefslogtreecommitdiff
path: root/source4
diff options
context:
space:
mode:
authorGünther Deschner <gd@samba.org>2009-04-13 23:56:59 +0200
committerGünther Deschner <gd@samba.org>2009-04-20 01:03:00 +0200
commitfeec2a814ee09800c26ae4c1f637796737b7ad2a (patch)
tree59ee244cd56ed35b22414364a2d30a2517b79c31 /source4
parent6689b0da85ac3b2f146c5e9851b73cf7d1e21c2b (diff)
downloadsamba-feec2a814ee09800c26ae4c1f637796737b7ad2a.tar.gz
s4-smbtorture: test all levels in test_GetJob().
Guenther (cherry picked from commit 5f0c9c57f53f9b0026b4f58f68442a72103c0d7d)
Diffstat (limited to 'source4')
-rw-r--r--source4/torture/rpc/spoolss.c31
1 files changed, 23 insertions, 8 deletions
diff --git a/source4/torture/rpc/spoolss.c b/source4/torture/rpc/spoolss.c
index bc89eabfe17..bfe667240cd 100644
--- a/source4/torture/rpc/spoolss.c
+++ b/source4/torture/rpc/spoolss.c
@@ -1064,28 +1064,43 @@ static bool test_GetJob(struct torture_context *tctx,
NTSTATUS status;
struct spoolss_GetJob r;
uint32_t needed;
+ uint32_t levels[] = {1, 2 /* 3, 4 */};
+ uint32_t i;
r.in.handle = handle;
r.in.job_id = job_id;
- r.in.level = 1;
+ r.in.level = 0;
r.in.buffer = NULL;
r.in.offered = 0;
r.out.needed = &needed;
- torture_comment(tctx, "Testing GetJob\n");
+ torture_comment(tctx, "Testing GetJob level %d\n", r.in.level);
status = dcerpc_spoolss_GetJob(p, tctx, &r);
- torture_assert_ntstatus_ok(tctx, status, "GetJob failed");
+ torture_assert_werr_equal(tctx, r.out.result, WERR_UNKNOWN_LEVEL, "Unexpected return code");
- if (W_ERROR_EQUAL(r.out.result, WERR_INSUFFICIENT_BUFFER)) {
- DATA_BLOB blob = data_blob_talloc(tctx, NULL, needed);
- data_blob_clear(&blob);
- r.in.buffer = &blob;
- r.in.offered = needed;
+ for (i = 0; i < ARRAY_SIZE(levels); i++) {
+
+ torture_comment(tctx, "Testing GetJob level %d\n", r.in.level);
+
+ r.in.level = levels[i];
+ r.in.offered = 0;
status = dcerpc_spoolss_GetJob(p, tctx, &r);
+ torture_assert_ntstatus_ok(tctx, status, "GetJob failed");
+ if (W_ERROR_EQUAL(r.out.result, WERR_INSUFFICIENT_BUFFER)) {
+ DATA_BLOB blob = data_blob_talloc(tctx, NULL, needed);
+ data_blob_clear(&blob);
+ r.in.buffer = &blob;
+ r.in.offered = needed;
+
+ status = dcerpc_spoolss_GetJob(p, tctx, &r);
+ torture_assert_ntstatus_ok(tctx, status, "GetJob failed");
+
+ }
torture_assert(tctx, r.out.info, "No job info returned");
+ torture_assert_werr_ok(tctx, r.out.result, "GetJob failed");
}
return true;