summaryrefslogtreecommitdiff
path: root/source4
diff options
context:
space:
mode:
authorGünther Deschner <gd@samba.org>2010-04-29 19:24:50 +0200
committerGünther Deschner <gd@samba.org>2010-04-30 01:24:45 +0200
commit37901bb96a7436f9b34e198d7de0b754b09612da (patch)
treee70a1aeb41999be24e0d9406f9c2246fd28fb500 /source4
parent1f69a7a80eb9057498a4805b883158dc1ce25901 (diff)
downloadsamba-37901bb96a7436f9b34e198d7de0b754b09612da.tar.gz
samba-37901bb96a7436f9b34e198d7de0b754b09612da.tar.bz2
samba-37901bb96a7436f9b34e198d7de0b754b09612da.zip
s4-smbtorture: add test_netprintjob() to RAP-PRINTING.
Guenther
Diffstat (limited to 'source4')
-rw-r--r--source4/torture/rap/printing.c70
1 files changed, 70 insertions, 0 deletions
diff --git a/source4/torture/rap/printing.c b/source4/torture/rap/printing.c
index 7ae8ceae2f..9b28719377 100644
--- a/source4/torture/rap/printing.c
+++ b/source4/torture/rap/printing.c
@@ -141,6 +141,75 @@ static bool test_netprintqgetinfo(struct torture_context *tctx,
return true;
}
+static bool test_netprintjob_pause(struct torture_context *tctx,
+ struct smbcli_state *cli,
+ uint16_t job_id)
+{
+ struct rap_NetPrintJobPause r;
+
+ r.in.JobID = job_id;
+
+ torture_comment(tctx, "Testing rap_NetPrintJobPause(%d)\n", r.in.JobID);
+
+ torture_assert_ntstatus_ok(tctx,
+ smbcli_rap_netprintjobpause(cli->tree, lp_iconv_convenience(tctx->lp_ctx), tctx, &r),
+ "smbcli_rap_netprintjobpause failed");
+
+ return true;
+}
+
+static bool test_netprintjob_continue(struct torture_context *tctx,
+ struct smbcli_state *cli,
+ uint16_t job_id)
+{
+ struct rap_NetPrintJobContinue r;
+
+ r.in.JobID = job_id;
+
+ torture_comment(tctx, "Testing rap_NetPrintJobContinue(%d)\n", r.in.JobID);
+
+ torture_assert_ntstatus_ok(tctx,
+ smbcli_rap_netprintjobcontinue(cli->tree, lp_iconv_convenience(tctx->lp_ctx), tctx, &r),
+ "smbcli_rap_netprintjobcontinue failed");
+
+ return true;
+}
+
+static bool test_netprintjob_delete(struct torture_context *tctx,
+ struct smbcli_state *cli,
+ uint16_t job_id)
+{
+ struct rap_NetPrintJobDelete r;
+
+ r.in.JobID = job_id;
+
+ torture_comment(tctx, "Testing rap_NetPrintJobDelete(%d)\n", r.in.JobID);
+
+ torture_assert_ntstatus_ok(tctx,
+ smbcli_rap_netprintjobdelete(cli->tree, lp_iconv_convenience(tctx->lp_ctx), tctx, &r),
+ "smbcli_rap_netprintjobdelete failed");
+
+ return true;
+}
+
+static bool test_netprintjob(struct torture_context *tctx,
+ struct smbcli_state *cli)
+{
+ uint16_t job_id = 400;
+
+ torture_assert(tctx,
+ test_netprintjob_pause(tctx, cli, job_id),
+ "failed to pause job");
+ torture_assert(tctx,
+ test_netprintjob_continue(tctx, cli, job_id),
+ "failed to continue job");
+ torture_assert(tctx,
+ test_netprintjob_delete(tctx, cli, job_id),
+ "failed to delete job");
+
+ return true;
+}
+
static bool test_rap_print(struct torture_context *tctx,
struct smbcli_state *cli)
{
@@ -163,6 +232,7 @@ struct torture_suite *torture_rap_printing(TALLOC_CTX *mem_ctx)
torture_suite_add_1smb_test(suite, "rap_print", test_rap_print);
torture_suite_add_1smb_test(suite, "rap_printq_enum", test_netprintqenum);
torture_suite_add_1smb_test(suite, "rap_printq_getinfo", test_netprintqgetinfo);
+ torture_suite_add_1smb_test(suite, "rap_printjob", test_netprintjob);
return suite;
}