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