• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1#
2# Verify that the IPP job operations work.
3#
4# Copyright © 2020-2024 by OpenPrinting.
5# Copyright © 2007-2019 by Apple Inc.
6# Copyright © 2001-2006 by Easy Software Products. All rights reserved.
7#
8# Licensed under Apache License v2.0.  See the file "LICENSE" for more
9# information.
10#
11{
12	# The name of the test...
13	NAME "Print PostScript Job with bad job-sheets value to Test1"
14
15	# The operation to use
16	OPERATION print-job
17	RESOURCE /printers/Test1
18
19	# The attributes to send
20	GROUP operation
21	ATTR charset attributes-charset utf-8
22	ATTR language attributes-natural-language en
23	ATTR uri printer-uri $method://$hostname:$port/printers/Test1
24	ATTR name requesting-user-name $user
25	ATTR name job-sheets "none\,none"
26
27	FILE ../examples/testfile.ps
28
29	# What statuses are OK?
30	STATUS client-error-bad-request
31}
32{
33	# The name of the test...
34	NAME "Print PostScript Job to Test1"
35
36	# The operation to use
37	OPERATION print-job
38	RESOURCE /printers/Test1
39
40	# The attributes to send
41	GROUP operation
42	ATTR charset attributes-charset utf-8
43	ATTR language attributes-natural-language en
44	ATTR uri printer-uri $method://$hostname:$port/printers/Test1
45	ATTR name requesting-user-name $user
46
47	FILE ../examples/testfile.ps
48
49	# What statuses are OK?
50	STATUS successful-ok
51
52	# What attributes do we expect?
53	EXPECT attributes-charset
54	EXPECT attributes-natural-language
55	EXPECT job-id
56}
57{
58	# The name of the test...
59	NAME "Get Job Attributes"
60
61	# The operation to use
62	OPERATION get-job-attributes
63	RESOURCE /jobs
64
65	# The attributes to send
66	GROUP operation
67	ATTR charset attributes-charset utf-8
68	ATTR language attributes-natural-language en
69	ATTR uri printer-uri $method://$hostname:$port/printers/Test1
70	ATTR integer job-id $job-id
71
72	# What statuses are OK?
73	STATUS successful-ok
74
75	# What attributes do we expect?
76	EXPECT attributes-charset
77	EXPECT attributes-natural-language
78	EXPECT job-id
79	EXPECT job-uri
80	EXPECT job-state
81}
82{
83	# The name of the test...
84	NAME "Print JPEG Job to Test2"
85
86	# The operation to use
87	OPERATION print-job
88	RESOURCE /printers/Test2
89
90	# The attributes to send
91	GROUP operation
92	ATTR charset attributes-charset utf-8
93	ATTR language attributes-natural-language en
94	ATTR uri printer-uri $method://$hostname:$port/printers/Test2
95	ATTR name requesting-user-name $user
96
97        GROUP subscription
98	ATTR uri notify-recipient-uri testnotify:///
99
100	FILE ../examples/testfile.jpg
101
102	# What statuses are OK?
103	STATUS successful-ok
104
105	# What attributes do we expect?
106	EXPECT attributes-charset
107	EXPECT attributes-natural-language
108	EXPECT job-id
109	EXPECT notify-subscription-id
110}
111{
112	# The name of the test...
113	NAME "Get Job Attributes"
114
115	# The operation to use
116	OPERATION get-job-attributes
117	RESOURCE /jobs
118
119	# The attributes to send
120	GROUP operation
121	ATTR charset attributes-charset utf-8
122	ATTR language attributes-natural-language en
123	ATTR uri printer-uri $method://$hostname:$port/printers/Test2
124	ATTR integer job-id $job-id
125
126	# What statuses are OK?
127	STATUS successful-ok
128
129	# What attributes do we expect?
130	EXPECT attributes-charset
131	EXPECT attributes-natural-language
132	EXPECT job-id
133	EXPECT job-uri
134	EXPECT job-state
135}
136{
137	# The name of the test...
138	NAME "Print Text Job to Test1"
139
140	# The operation to use
141	OPERATION print-job
142	RESOURCE /printers/Test1
143
144	# The attributes to send
145	GROUP operation
146	ATTR charset attributes-charset utf-8
147	ATTR language attributes-natural-language en
148	ATTR uri printer-uri $method://$hostname:$port/printers/Test1
149	ATTR name requesting-user-name $user
150
151	FILE ../examples/testfile.txt
152
153	# What statuses are OK?
154	STATUS successful-ok
155
156	# What attributes do we expect?
157	EXPECT attributes-charset
158	EXPECT attributes-natural-language
159	EXPECT job-id
160}
161{
162	# The name of the test...
163	NAME "Print PDF Job to Test1"
164
165	# The operation to use
166	OPERATION print-job
167	RESOURCE /printers/Test1
168
169	# The attributes to send
170	GROUP operation
171	ATTR charset attributes-charset utf-8
172	ATTR language attributes-natural-language en
173	ATTR uri printer-uri $method://$hostname:$port/printers/Test1
174	ATTR name requesting-user-name $user
175
176	GROUP job
177	ATTR keyword job-hold-until weekend
178
179	FILE ../examples/testfile.pdf
180
181	# What statuses are OK?
182	STATUS successful-ok
183
184	# What attributes do we expect?
185	EXPECT attributes-charset
186	EXPECT attributes-natural-language
187	EXPECT job-id
188}
189{
190	# The name of the test...
191	NAME "Hold Job on Test1"
192
193	# The operation to use
194	OPERATION hold-job
195	RESOURCE /printers/Test1
196
197	# The attributes to send
198	GROUP operation
199	ATTR charset attributes-charset utf-8
200	ATTR language attributes-natural-language en
201	ATTR uri printer-uri $method://$hostname:$port/printers/Test1
202	ATTR integer job-id $job-id
203	ATTR name requesting-user-name $user
204
205	# What statuses are OK?
206	STATUS successful-ok
207
208	# What attributes do we expect?
209	EXPECT attributes-charset
210	EXPECT attributes-natural-language
211}
212{
213	# The name of the test...
214	NAME "Release Job on Test1"
215
216	# The operation to use
217	OPERATION release-job
218	RESOURCE /printers/Test1
219
220	# The attributes to send
221	GROUP operation
222	ATTR charset attributes-charset utf-8
223	ATTR language attributes-natural-language en
224	ATTR uri printer-uri $method://$hostname:$port/printers/Test1
225	ATTR integer job-id $job-id
226	ATTR name requesting-user-name $user
227
228	# What statuses are OK?
229	STATUS successful-ok
230
231	# What attributes do we expect?
232	EXPECT attributes-charset
233	EXPECT attributes-natural-language
234}
235{
236	# The name of the test...
237	NAME "Print Held Image Job to Test1"
238
239	# The operation to use
240	OPERATION print-job
241	RESOURCE /printers/Test1
242
243	# The attributes to send
244	GROUP operation
245	ATTR charset attributes-charset utf-8
246	ATTR language attributes-natural-language en
247	ATTR uri printer-uri $method://$hostname:$port/printers/Test1
248	ATTR name requesting-user-name $user
249	GROUP job
250	ATTR keyword job-hold-until indefinite
251
252	FILE ../examples/testfile.jpg
253
254	# What statuses are OK?
255	STATUS successful-ok
256
257	# What attributes do we expect?
258	EXPECT attributes-charset
259	EXPECT attributes-natural-language
260	EXPECT job-id
261}
262{
263	# The name of the test...
264	NAME "Cancel Job"
265
266	# The operation to use
267	OPERATION cancel-job
268	RESOURCE /jobs
269
270	# The attributes to send
271	GROUP operation
272	ATTR charset attributes-charset utf-8
273	ATTR language attributes-natural-language en
274	ATTR uri job-uri $method://$hostname:$port/jobs/$job-id
275	ATTR name requesting-user-name $user
276
277	# What statuses are OK?
278	STATUS successful-ok
279
280	# What attributes do we expect?
281	EXPECT attributes-charset
282	EXPECT attributes-natural-language
283}
284{
285	# The name of the test...
286	NAME "Get Job List on Test1"
287
288	# The operation to use
289	OPERATION get-jobs
290	RESOURCE /printers/Test1
291
292	# The attributes to send
293	GROUP operation
294	ATTR charset attributes-charset utf-8
295	ATTR language attributes-natural-language en
296	ATTR uri printer-uri $method://$hostname:$port/printers/Test1
297
298	# What statuses are OK?
299	STATUS successful-ok
300
301	# What attributes do we expect?
302	EXPECT attributes-charset
303	EXPECT attributes-natural-language
304	EXPECT !job-printer-uri
305}
306{
307	# The name of the test...
308	NAME "Get All Jobs"
309
310	# The operation to use
311	OPERATION get-jobs
312	RESOURCE /jobs
313
314	# The attributes to send
315	GROUP operation
316	ATTR charset attributes-charset utf-8
317	ATTR language attributes-natural-language en
318	ATTR uri printer-uri $scheme://$hostname:$port/
319	ATTR keyword requested-attributes all
320
321	# What statuses are OK?
322	STATUS successful-ok
323
324	# What attributes do we expect?
325	EXPECT attributes-charset
326	EXPECT attributes-natural-language
327	EXPECT job-uri
328	EXPECT job-id
329	EXPECT job-state
330	EXPECT job-printer-uri
331}
332