1# 2# "$Id: 4.2-cups-printer-ops.test 11433 2013-11-20 18:57:44Z msweet $" 3# 4# Verify that the CUPS printer operations work. 5# 6{ 7 # The name of the test... 8 NAME "Add Printer Test1" 9 10 # The operation to use 11 OPERATION cups-add-printer 12 RESOURCE /admin/ 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 20 FILE testhp.ppd 21 22 # What statuses are OK? 23 STATUS successful-ok 24 25 # What attributes do we expect? 26 EXPECT attributes-charset 27 EXPECT attributes-natural-language 28} 29{ 30 # The name of the test... 31 NAME "Verify Printer Test1 Added" 32 33 # The operation to use 34 OPERATION get-printer-attributes 35 RESOURCE / 36 37 # The attributes to send 38 GROUP operation 39 ATTR charset attributes-charset utf-8 40 ATTR language attributes-natural-language en 41 ATTR uri printer-uri $method://$hostname:$port/printers/Test1 42 43 # What statuses are OK? 44 STATUS successful-ok 45 46 # What attributes do we expect? 47 EXPECT attributes-charset 48 EXPECT attributes-natural-language 49} 50{ 51 # The name of the test... 52 NAME "Delete Printer Test1" 53 54 # The operation to use 55 OPERATION cups-delete-printer 56 RESOURCE /admin/ 57 58 # The attributes to send 59 GROUP operation 60 ATTR charset attributes-charset utf-8 61 ATTR language attributes-natural-language en 62 ATTR uri printer-uri $method://$hostname:$port/printers/Test1 63 64 # What statuses are OK? 65 STATUS successful-ok 66 67 # What attributes do we expect? 68 EXPECT attributes-charset 69 EXPECT attributes-natural-language 70} 71{ 72 # The name of the test... 73 NAME "Verify Printer Test1 Deleted" 74 75 # The operation to use 76 OPERATION get-printer-attributes 77 RESOURCE / 78 79 # The attributes to send 80 GROUP operation 81 ATTR charset attributes-charset utf-8 82 ATTR language attributes-natural-language en 83 ATTR uri printer-uri $method://$hostname:$port/printers/Test1 84 85 # What statuses are OK? 86 STATUS client-error-not-found 87 88 # What attributes do we expect? 89 EXPECT attributes-charset 90 EXPECT attributes-natural-language 91} 92{ 93 # The name of the test... 94 NAME "Subscribe to Printer Events" 95 96 # The operation to use 97 OPERATION Create-Printer-Subscription 98 RESOURCE / 99 100 # The attributes to send 101 GROUP operation 102 ATTR charset attributes-charset utf-8 103 ATTR language attributes-natural-language en 104 ATTR uri printer-uri $method://$hostname:$port/ 105 ATTR name requesting-user-name $user 106 107 GROUP subscription 108 ATTR uri notify-recipient-uri testnotify:// 109 ATTR keyword notify-events printer-added,printer-modified,printer-deleted 110 111 # What statuses are OK? 112 STATUS successful-ok 113 114 # What attributes do we expect? 115 EXPECT attributes-charset 116 EXPECT attributes-natural-language 117 EXPECT notify-subscription-id 118} 119{ 120 # The name of the test... 121 NAME "Add Printer Test2" 122 123 # The operation to use 124 OPERATION cups-add-printer 125 RESOURCE /admin/ 126 127 # The attributes to send 128 GROUP operation 129 ATTR charset attributes-charset utf-8 130 ATTR language attributes-natural-language en 131 ATTR uri printer-uri $method://$hostname:$port/printers/Test2 132 133 FILE testhp.ppd 134 135 # What statuses are OK? 136 STATUS successful-ok 137 138 # What attributes do we expect? 139 EXPECT attributes-charset 140 EXPECT attributes-natural-language 141} 142{ 143 # The name of the test... 144 NAME "Verify Printer Test2 Added" 145 146 # The operation to use 147 OPERATION get-printer-attributes 148 RESOURCE / 149 150 # The attributes to send 151 GROUP operation 152 ATTR charset attributes-charset utf-8 153 ATTR language attributes-natural-language en 154 ATTR uri printer-uri $method://$hostname:$port/printers/Test2 155 156 # What statuses are OK? 157 STATUS successful-ok 158 159 # What attributes do we expect? 160 EXPECT attributes-charset 161 EXPECT attributes-natural-language 162} 163{ 164 # The name of the test... 165 NAME "Modify Printer Test2" 166 167 # The operation to use 168 OPERATION cups-add-printer 169 RESOURCE /admin/ 170 171 # The attributes to send 172 GROUP operation 173 ATTR charset attributes-charset utf-8 174 ATTR language attributes-natural-language en 175 ATTR uri printer-uri $method://$hostname:$port/printers/Test2 176 177 GROUP printer 178 ATTR uri device-uri file:/tmp/Test2 179 ATTR enum printer-state 3 180 ATTR boolean printer-is-accepting-jobs true 181 182 # What statuses are OK? 183 STATUS successful-ok 184 185 # What attributes do we expect? 186 EXPECT attributes-charset 187 EXPECT attributes-natural-language 188} 189{ 190 # The name of the test... 191 NAME "Re-Add Printer Test1" 192 193 # The operation to use 194 OPERATION cups-add-printer 195 RESOURCE /admin/ 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 203 GROUP printer 204 ATTR uri device-uri file:/tmp/Test1 205 ATTR enum printer-state 3 206 ATTR boolean printer-is-accepting-jobs true 207 208 FILE testps.ppd 209 210 # What statuses are OK? 211 STATUS successful-ok 212 213 # What attributes do we expect? 214 EXPECT attributes-charset 215 EXPECT attributes-natural-language 216} 217{ 218 # The name of the test... 219 NAME "Verify Printer Test1 Re-Added" 220 221 # The operation to use 222 OPERATION get-printer-attributes 223 RESOURCE / 224 225 # The attributes to send 226 GROUP operation 227 ATTR charset attributes-charset utf-8 228 ATTR language attributes-natural-language en 229 ATTR uri printer-uri $method://$hostname:$port/printers/Test1 230 231 # What statuses are OK? 232 STATUS successful-ok 233 234 # What attributes do we expect? 235 EXPECT attributes-charset 236 EXPECT attributes-natural-language 237} 238{ 239 # The name of the test... 240 NAME "Get Default Printer with no default set" 241 242 # The operation to use 243 OPERATION cups-get-default 244 RESOURCE / 245 246 # The attributes to send 247 GROUP operation 248 ATTR charset attributes-charset utf-8 249 ATTR language attributes-natural-language en 250 251 # What statuses are OK? 252 STATUS client-error-not-found 253 254 # What attributes do we expect? 255 EXPECT attributes-charset 256 EXPECT attributes-natural-language 257} 258{ 259 # The name of the test... 260 NAME "Set Default Printer to Test1" 261 262 # The operation to use 263 OPERATION cups-set-default 264 RESOURCE /admin/ 265 266 # The attributes to send 267 GROUP operation 268 ATTR charset attributes-charset utf-8 269 ATTR language attributes-natural-language en 270 ATTR uri printer-uri $method://$hostname:$port/printers/Test1 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 Default Printer" 282 283 # The operation to use 284 OPERATION cups-get-default 285 RESOURCE / 286 287 # The attributes to send 288 GROUP operation 289 ATTR charset attributes-charset utf-8 290 ATTR language attributes-natural-language en 291 292 # What statuses are OK? 293 STATUS successful-ok 294 295 # What attributes do we expect? 296 EXPECT attributes-charset 297 EXPECT attributes-natural-language 298 EXPECT printer-name 299 EXPECT printer-uri-supported 300} 301{ 302 # The name of the test... 303 NAME "Get IPP/2.x Attributes for Printer Test1" 304 305 # The operation to use 306 OPERATION get-printer-attributes 307 RESOURCE / 308 309 # The IPP version to use 310 VERSION 2.0 311 312 # The attributes to send 313 GROUP operation 314 ATTR charset attributes-charset utf-8 315 ATTR language attributes-natural-language en 316 ATTR uri printer-uri $method://$hostname:$port/printers/Test1 317 318 # What statuses are OK? 319 STATUS successful-ok 320 321 # What attributes do we expect? 322 EXPECT media-col-default 323} 324 325# 326# End of "$Id: 4.2-cups-printer-ops.test 11433 2013-11-20 18:57:44Z msweet $" 327# 328