2 # Verify that the CUPS printer operations work.
4 # Copyright © 2007-2019 by Apple Inc.
5 # Copyright © 2001-2006 by Easy Software Products. All rights reserved.
7 # Licensed under Apache License v2.0. See the file "LICENSE" for more
11 # The name of the test...
12 NAME "Add Printer Test1"
14 # The operation to use
15 OPERATION cups-add-printer
18 # The attributes to send
20 ATTR charset attributes-charset utf-8
21 ATTR language attributes-natural-language en
22 ATTR uri printer-uri $method://$hostname:$port/printers/Test1
26 # What statuses are OK?
29 # What attributes do we expect?
30 EXPECT attributes-charset
31 EXPECT attributes-natural-language
34 # The name of the test...
35 NAME "Verify Printer Test1 Added"
37 # The operation to use
38 OPERATION get-printer-attributes
41 # The attributes to send
43 ATTR charset attributes-charset utf-8
44 ATTR language attributes-natural-language en
45 ATTR uri printer-uri $method://$hostname:$port/printers/Test1
47 # What statuses are OK?
50 # What attributes do we expect?
51 EXPECT attributes-charset
52 EXPECT attributes-natural-language
55 # The name of the test...
56 NAME "Delete Printer Test1"
58 # The operation to use
59 OPERATION cups-delete-printer
62 # The attributes to send
64 ATTR charset attributes-charset utf-8
65 ATTR language attributes-natural-language en
66 ATTR uri printer-uri $method://$hostname:$port/printers/Test1
68 # What statuses are OK?
71 # What attributes do we expect?
72 EXPECT attributes-charset
73 EXPECT attributes-natural-language
76 # The name of the test...
77 NAME "Verify Printer Test1 Deleted"
79 # The operation to use
80 OPERATION get-printer-attributes
83 # The attributes to send
85 ATTR charset attributes-charset utf-8
86 ATTR language attributes-natural-language en
87 ATTR uri printer-uri $method://$hostname:$port/printers/Test1
89 # What statuses are OK?
90 STATUS client-error-not-found
92 # What attributes do we expect?
93 EXPECT attributes-charset
94 EXPECT attributes-natural-language
97 # The name of the test...
98 NAME "Subscribe to Printer Events"
100 # The operation to use
101 OPERATION Create-Printer-Subscription
104 # The attributes to send
106 ATTR charset attributes-charset utf-8
107 ATTR language attributes-natural-language en
108 ATTR uri printer-uri $method://$hostname:$port/
109 ATTR name requesting-user-name $user
112 ATTR uri notify-recipient-uri testnotify://
113 ATTR keyword notify-events printer-added,printer-modified,printer-deleted
115 # What statuses are OK?
118 # What attributes do we expect?
119 EXPECT attributes-charset
120 EXPECT attributes-natural-language
121 EXPECT notify-subscription-id
124 # The name of the test...
125 NAME "Add Printer Test2"
127 # The operation to use
128 OPERATION cups-add-printer
131 # The attributes to send
133 ATTR charset attributes-charset utf-8
134 ATTR language attributes-natural-language en
135 ATTR uri printer-uri $method://$hostname:$port/printers/Test2
139 # What statuses are OK?
142 # What attributes do we expect?
143 EXPECT attributes-charset
144 EXPECT attributes-natural-language
147 # The name of the test...
148 NAME "Verify Printer Test2 Added"
150 # The operation to use
151 OPERATION get-printer-attributes
154 # The attributes to send
156 ATTR charset attributes-charset utf-8
157 ATTR language attributes-natural-language en
158 ATTR uri printer-uri $method://$hostname:$port/printers/Test2
160 # What statuses are OK?
163 # What attributes do we expect?
164 EXPECT attributes-charset
165 EXPECT attributes-natural-language
168 # The name of the test...
169 NAME "Modify Printer Test2"
171 # The operation to use
172 OPERATION cups-add-printer
175 # The attributes to send
177 ATTR charset attributes-charset utf-8
178 ATTR language attributes-natural-language en
179 ATTR uri printer-uri $method://$hostname:$port/printers/Test2
182 ATTR uri device-uri file:/tmp/Test2
183 ATTR enum printer-state 3
184 ATTR boolean printer-is-accepting-jobs true
186 # What statuses are OK?
189 # What attributes do we expect?
190 EXPECT attributes-charset
191 EXPECT attributes-natural-language
194 # The name of the test...
195 NAME "Re-Add Printer Test1"
197 # The operation to use
198 OPERATION cups-add-printer
201 # The attributes to send
203 ATTR charset attributes-charset utf-8
204 ATTR language attributes-natural-language en
205 ATTR uri printer-uri $method://$hostname:$port/printers/Test1
208 ATTR uri device-uri file:/tmp/Test1
209 ATTR enum printer-state 3
210 ATTR boolean printer-is-accepting-jobs true
211 ATTR text printer-info "Test Printer 1"
215 # What statuses are OK?
218 # What attributes do we expect?
219 EXPECT attributes-charset
220 EXPECT attributes-natural-language
223 # The name of the test...
224 NAME "Verify Printer Test1 Re-Added"
226 # The operation to use
227 OPERATION get-printer-attributes
230 # The attributes to send
232 ATTR charset attributes-charset utf-8
233 ATTR language attributes-natural-language en
234 ATTR uri printer-uri $method://$hostname:$port/printers/Test1
236 # What statuses are OK?
239 # What attributes do we expect?
240 EXPECT attributes-charset
241 EXPECT attributes-natural-language
244 # The name of the test...
245 NAME "Get Default Printer with no default set"
247 # The operation to use
248 OPERATION cups-get-default
251 # The attributes to send
253 ATTR charset attributes-charset utf-8
254 ATTR language attributes-natural-language en
256 # What statuses are OK?
257 STATUS client-error-not-found
259 # What attributes do we expect?
260 EXPECT attributes-charset
261 EXPECT attributes-natural-language
264 # The name of the test...
265 NAME "Set Default Printer to Test1"
267 # The operation to use
268 OPERATION cups-set-default
271 # The attributes to send
273 ATTR charset attributes-charset utf-8
274 ATTR language attributes-natural-language en
275 ATTR uri printer-uri $method://$hostname:$port/printers/Test1
277 # What statuses are OK?
280 # What attributes do we expect?
281 EXPECT attributes-charset
282 EXPECT attributes-natural-language
285 # The name of the test...
286 NAME "Get Default Printer"
288 # The operation to use
289 OPERATION cups-get-default
292 # The attributes to send
294 ATTR charset attributes-charset utf-8
295 ATTR language attributes-natural-language en
297 # What statuses are OK?
300 # What attributes do we expect?
301 EXPECT attributes-charset
302 EXPECT attributes-natural-language
304 EXPECT printer-uri-supported
307 # The name of the test...
308 NAME "Get IPP/2.x Attributes for Printer Test1"
310 # The operation to use
311 OPERATION get-printer-attributes
314 # The IPP version to use
317 # The attributes to send
319 ATTR charset attributes-charset utf-8
320 ATTR language attributes-natural-language en
321 ATTR uri printer-uri $method://$hostname:$port/printers/Test1
323 # What statuses are OK?
326 # What attributes do we expect?
327 EXPECT media-col-default