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