summaryrefslogtreecommitdiff
path: root/source4/torture/rpc/spoolss.c
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 00:59:36 +0200
commit5f0c9c57f53f9b0026b4f58f68442a72103c0d7d (patch)
tree0d88b9cafc1c544a872aa8ce88ab5b18a7b49a6a /source4/torture/rpc/spoolss.c
parentdd073a333ed60ea84cdf7a735884fa91a4c62535 (diff)
downloadsamba-5f0c9c57f53f9b0026b4f58f68442a72103c0d7d.tar.gz
samba-5f0c9c57f53f9b0026b4f58f68442a72103c0d7d.tar.bz2
samba-5f0c9c57f53f9b0026b4f58f68442a72103c0d7d.zip
s4-smbtorture: test all levels in test_GetJob().
Guenther
Diffstat (limited to 'source4/torture/rpc/spoolss.c')
-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 bc89eabfe1..bfe667240c 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;