2 # Verify that the CUPS subscription 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 Subscription w/Lease"
14 # The operation to use
15 OPERATION Create-Printer-Subscription
18 # The attributes to send
20 ATTR charset attributes-charset utf-8
21 ATTR language attributes-natural-language en
22 ATTR uri printer-uri $scheme://$hostname:$port/printers/Test1
23 ATTR name requesting-user-name $user
26 ATTR uri notify-recipient-uri testnotify://
27 ATTR keyword notify-events printer-state-changed
28 ATTR integer notify-lease-duration 5
30 # What statuses are OK?
33 # What attributes do we expect?
34 EXPECT attributes-charset
35 EXPECT attributes-natural-language
36 EXPECT notify-subscription-id
37 DISPLAY notify-subscription-id
40 # The name of the test...
41 NAME "Verify Subscription Expiration"
43 # Delay test for 7 seconds to allow lease to expire...
46 # The operation to use
47 OPERATION Get-Subscription-Attributes
50 # The attributes to send
52 ATTR charset attributes-charset utf-8
53 ATTR language attributes-natural-language en
54 ATTR uri printer-uri $scheme://$hostname:$port/printers/Test1
55 ATTR integer notify-subscription-id $notify-subscription-id
56 ATTR name requesting-user-name $user
58 # What statuses are OK?
59 STATUS client-error-not-found
61 # What attributes do we expect?
62 EXPECT attributes-charset
63 EXPECT attributes-natural-language
66 # The name of the test...
67 NAME "Add 2 Printer Subscriptions w/Lease"
69 # The operation to use
70 OPERATION Create-Printer-Subscription
73 # The attributes to send
75 ATTR charset attributes-charset utf-8
76 ATTR language attributes-natural-language en
77 ATTR uri printer-uri $scheme://$hostname:$port/printers/Test1
78 ATTR name requesting-user-name $user
81 ATTR uri notify-recipient-uri testnotify://
82 ATTR keyword notify-events printer-state-changed
83 ATTR integer notify-lease-duration 5
86 ATTR uri notify-recipient-uri testnotify://
87 ATTR keyword notify-events printer-config-changed
88 ATTR integer notify-lease-duration 5
90 # What statuses are OK?
93 # What attributes do we expect?
94 EXPECT attributes-charset
95 EXPECT attributes-natural-language
96 EXPECT notify-subscription-id
97 DISPLAY notify-subscription-id
100 # The name of the test...
101 NAME "List Printer Subscriptions"
103 # The operation to use
104 OPERATION Get-Subscriptions
107 # The attributes to send
109 ATTR charset attributes-charset utf-8
110 ATTR language attributes-natural-language en
111 ATTR uri printer-uri $scheme://$hostname:$port/printers/Test1
112 ATTR name requesting-user-name $user
114 # What statuses are OK?
117 # What attributes do we expect?
118 EXPECT attributes-charset
119 EXPECT attributes-natural-language
120 EXPECT notify-subscription-id
121 DISPLAY notify-subscription-id
122 EXPECT notify-printer-uri
123 DISPLAY notify-printer-uri
125 DISPLAY notify-events
128 # The name of the test...
129 NAME "Check MaxSubscriptions limits"
131 # The operation to use
132 OPERATION Create-Printer-Subscription
135 # The attributes to send
137 ATTR charset attributes-charset utf-8
138 ATTR language attributes-natural-language en
139 ATTR uri printer-uri $scheme://$hostname:$port/printers/Test1
140 ATTR name requesting-user-name $user
143 ATTR uri notify-recipient-uri testnotify://
144 ATTR keyword notify-events printer-state-changed
145 ATTR integer notify-lease-duration 5
147 # What statuses are OK?
148 STATUS client-error-too-many-subscriptions
150 # What attributes do we expect?
151 EXPECT attributes-charset
152 EXPECT attributes-natural-language