]> git.ipfire.org Git - thirdparty/cups.git/blob - test/4.4-subscription-ops.test
Import CUPS v1.7.1
[thirdparty/cups.git] / test / 4.4-subscription-ops.test
1 #
2 # "$Id: 4.4-subscription-ops.test 11396 2013-11-06 20:09:03Z msweet $"
3 #
4 # Verify that the CUPS subscription operations work.
5 #
6 {
7 # The name of the test...
8 NAME "Add Printer Subscription w/Lease"
9
10 # The operation to use
11 OPERATION Create-Printer-Subscription
12 RESOURCE /
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 $scheme://$hostname:$port/printers/Test1
19 ATTR name requesting-user-name $user
20
21 GROUP subscription
22 ATTR uri notify-recipient-uri testnotify://
23 ATTR keyword notify-events printer-state-changed
24 ATTR integer notify-lease-duration 5
25
26 # What statuses are OK?
27 STATUS successful-ok
28
29 # What attributes do we expect?
30 EXPECT attributes-charset
31 EXPECT attributes-natural-language
32 EXPECT notify-subscription-id
33 DISPLAY notify-subscription-id
34 }
35 {
36 # The name of the test...
37 NAME "Verify Subscription Expiration"
38
39 # Delay test for 7 seconds to allow lease to expire...
40 DELAY 7
41
42 # The operation to use
43 OPERATION Get-Subscription-Attributes
44 RESOURCE /
45
46 # The attributes to send
47 GROUP operation
48 ATTR charset attributes-charset utf-8
49 ATTR language attributes-natural-language en
50 ATTR uri printer-uri $scheme://$hostname:$port/printers/Test1
51 ATTR integer notify-subscription-id $notify-subscription-id
52 ATTR name requesting-user-name $user
53
54 # What statuses are OK?
55 STATUS client-error-not-found
56
57 # What attributes do we expect?
58 EXPECT attributes-charset
59 EXPECT attributes-natural-language
60 }
61 {
62 # The name of the test...
63 NAME "Add 2 Printer Subscriptions w/Lease"
64
65 # The operation to use
66 OPERATION Create-Printer-Subscription
67 RESOURCE /
68
69 # The attributes to send
70 GROUP operation
71 ATTR charset attributes-charset utf-8
72 ATTR language attributes-natural-language en
73 ATTR uri printer-uri $scheme://$hostname:$port/printers/Test1
74 ATTR name requesting-user-name $user
75
76 GROUP subscription
77 ATTR uri notify-recipient-uri testnotify://
78 ATTR keyword notify-events printer-state-changed
79 ATTR integer notify-lease-duration 5
80
81 GROUP subscription
82 ATTR uri notify-recipient-uri testnotify://
83 ATTR keyword notify-events printer-config-changed
84 ATTR integer notify-lease-duration 5
85
86 # What statuses are OK?
87 STATUS successful-ok
88
89 # What attributes do we expect?
90 EXPECT attributes-charset
91 EXPECT attributes-natural-language
92 EXPECT notify-subscription-id
93 DISPLAY notify-subscription-id
94 }
95 {
96 # The name of the test...
97 NAME "List Printer Subscriptions"
98
99 # The operation to use
100 OPERATION Get-Subscriptions
101 RESOURCE /
102
103 # The attributes to send
104 GROUP operation
105 ATTR charset attributes-charset utf-8
106 ATTR language attributes-natural-language en
107 ATTR uri printer-uri $scheme://$hostname:$port/printers/Test1
108 ATTR name requesting-user-name $user
109
110 # What statuses are OK?
111 STATUS successful-ok
112
113 # What attributes do we expect?
114 EXPECT attributes-charset
115 EXPECT attributes-natural-language
116 EXPECT notify-subscription-id
117 DISPLAY notify-subscription-id
118 EXPECT notify-printer-uri
119 DISPLAY notify-printer-uri
120 EXPECT notify-events
121 DISPLAY notify-events
122 }
123 {
124 # The name of the test...
125 NAME "Check MaxSubscriptions limits"
126
127 # The operation to use
128 OPERATION Create-Printer-Subscription
129 RESOURCE /
130
131 # The attributes to send
132 GROUP operation
133 ATTR charset attributes-charset utf-8
134 ATTR language attributes-natural-language en
135 ATTR uri printer-uri $scheme://$hostname:$port/printers/Test1
136 ATTR name requesting-user-name $user
137
138 GROUP subscription
139 ATTR uri notify-recipient-uri testnotify://
140 ATTR keyword notify-events printer-state-changed
141 ATTR integer notify-lease-duration 5
142
143 # What statuses are OK?
144 STATUS client-error-too-many-subscriptions
145
146 # What attributes do we expect?
147 EXPECT attributes-charset
148 EXPECT attributes-natural-language
149 }
150
151 #
152 # End of "$Id: 4.4-subscription-ops.test 11396 2013-11-06 20:09:03Z msweet $"
153 #