1# 2# "$Id: 4.2-cups-printer-ops.test 11830 2014-04-24 12:10:41Z 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 ATTR text printer-info "Test Printer 1" 208 209 FILE testps.ppd 210 211 # What statuses are OK? 212 STATUS successful-ok 213 214 # What attributes do we expect? 215 EXPECT attributes-charset 216 EXPECT attributes-natural-language 217} 218{ 219 # The name of the test... 220 NAME "Verify Printer Test1 Re-Added" 221 222 # The operation to use 223 OPERATION get-printer-attributes 224 RESOURCE / 225 226 # The attributes to send 227 GROUP operation 228 ATTR charset attributes-charset utf-8 229 ATTR language attributes-natural-language en 230 ATTR uri printer-uri $method://$hostname:$port/printers/Test1 231 232 # What statuses are OK? 233 STATUS successful-ok 234 235 # What attributes do we expect? 236 EXPECT attributes-charset 237 EXPECT attributes-natural-language 238} 239{ 240 # The name of the test... 241 NAME "Get Default Printer with no default set" 242 243 # The operation to use 244 OPERATION cups-get-default 245 RESOURCE / 246 247 # The attributes to send 248 GROUP operation 249 ATTR charset attributes-charset utf-8 250 ATTR language attributes-natural-language en 251 252 # What statuses are OK? 253 STATUS client-error-not-found 254 255 # What attributes do we expect? 256 EXPECT attributes-charset 257 EXPECT attributes-natural-language 258} 259{ 260 # The name of the test... 261 NAME "Set Default Printer to Test1" 262 263 # The operation to use 264 OPERATION cups-set-default 265 RESOURCE /admin/ 266 267 # The attributes to send 268 GROUP operation 269 ATTR charset attributes-charset utf-8 270 ATTR language attributes-natural-language en 271 ATTR uri printer-uri $method://$hostname:$port/printers/Test1 272 273 # What statuses are OK? 274 STATUS successful-ok 275 276 # What attributes do we expect? 277 EXPECT attributes-charset 278 EXPECT attributes-natural-language 279} 280{ 281 # The name of the test... 282 NAME "Get Default Printer" 283 284 # The operation to use 285 OPERATION cups-get-default 286 RESOURCE / 287 288 # The attributes to send 289 GROUP operation 290 ATTR charset attributes-charset utf-8 291 ATTR language attributes-natural-language en 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 printer-name 300 EXPECT printer-uri-supported 301} 302{ 303 # The name of the test... 304 NAME "Get IPP/2.x Attributes for Printer Test1" 305 306 # The operation to use 307 OPERATION get-printer-attributes 308 RESOURCE / 309 310 # The IPP version to use 311 VERSION 2.0 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 $method://$hostname:$port/printers/Test1 318 319 # What statuses are OK? 320 STATUS successful-ok 321 322 # What attributes do we expect? 323 EXPECT media-col-default 324} 325 326# 327# End of "$Id: 4.2-cups-printer-ops.test 11830 2014-04-24 12:10:41Z msweet $" 328# 329