• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1# Test print-job and later job-hold-until attribute
2{
3	# The name of the test...
4	NAME "Disable printer..."
5
6	# The resource to use for the POST
7	RESOURCE /admin/
8
9	# The operation to use
10	OPERATION pause-printer
11
12	# Attributes, starting in the operation group...
13	GROUP operation
14	ATTR charset attributes-charset utf-8
15	ATTR language attributes-natural-language en
16	ATTR uri printer-uri $uri
17	ATTR name requesting-user-name $user
18
19	# What statuses are OK?
20	STATUS successful-ok
21	STATUS successful-ok-ignored-or-substituted-attributes
22}
23
24{
25	# The name of the test...
26	NAME "Print job"
27
28	# The resource to use for the POST
29	# RESOURCE /admin
30
31	# The operation to use
32	OPERATION print-job
33
34	# Attributes, starting in the operation group...
35	GROUP operation
36	ATTR charset attributes-charset utf-8
37	ATTR language attributes-natural-language en
38	ATTR uri printer-uri $uri
39	ATTR name requesting-user-name $user
40	ATTR mimetype document-format application/postscript
41
42	GROUP job
43	ATTR integer copies 1
44
45	FILE ../data/testprint.ps
46
47	# What statuses are OK?
48	STATUS successful-ok
49	STATUS successful-ok-ignored-or-substituted-attributes
50
51	# What attributes do we expect?
52	EXPECT job-id
53	EXPECT job-uri
54}
55
56{
57	# The name of the test...
58	NAME "Get job attrs"
59
60	# The resource to use for the POST
61	RESOURCE /
62
63	# The operation to use
64	OPERATION get-job-attributes
65
66	# Attributes, starting in the operation group...
67	GROUP operation
68	ATTR charset attributes-charset utf-8
69	ATTR language attributes-natural-language en
70	ATTR uri printer-uri $uri
71	ATTR integer job-id $job-id
72
73	# What statuses are OK?
74	STATUS successful-ok
75	STATUS successful-ok-ignored-or-substituted-attributes
76
77	# What attributes do we expect?
78	EXPECT job-state
79	EXPECT job-hold-until
80}
81
82{
83	# The name of the test...
84	NAME "Set job attrs with job-hold-until"
85
86	# The resource to use for the POST
87	# RESOURCE /admin
88
89	# The operation to use
90	OPERATION set-job-attributes
91
92	# Attributes, starting in the operation group...
93	GROUP operation
94	ATTR charset attributes-charset utf-8
95	ATTR language attributes-natural-language en
96	ATTR uri printer-uri $uri
97	ATTR integer job-id $job-id
98	ATTR name requesting-user-name $user
99
100	GROUP job
101	ATTR name job-hold-until 00:30:00
102
103	# What statuses are OK?
104	STATUS successful-ok
105	STATUS successful-ok-ignored-or-substituted-attributes
106}
107
108{
109	# The name of the test...
110	NAME "Get job attrs again"
111
112	# The resource to use for the POST
113	RESOURCE /
114
115	# The operation to use
116	OPERATION get-job-attributes
117
118	# Attributes, starting in the operation group...
119	GROUP operation
120	ATTR charset attributes-charset utf-8
121	ATTR language attributes-natural-language en
122	ATTR uri printer-uri $uri
123	ATTR integer job-id $job-id
124
125	# What statuses are OK?
126	STATUS successful-ok
127	STATUS successful-ok-ignored-or-substituted-attributes
128
129	# What attributes do we expect?
130	EXPECT job-state
131	EXPECT job-hold-until
132}
133
134{
135	# The name of the test...
136	NAME "Enable printer..."
137
138	# The resource to use for the POST
139	RESOURCE /admin/
140
141	# The operation to use
142	OPERATION resume-printer
143
144	# Attributes, starting in the operation group...
145	GROUP operation
146	ATTR charset attributes-charset utf-8
147	ATTR language attributes-natural-language en
148	ATTR uri printer-uri $uri
149	ATTR name requesting-user-name $user
150
151	# What statuses are OK?
152	STATUS successful-ok
153	STATUS successful-ok-ignored-or-substituted-attributes
154}
155
156{
157	# The name of the test...
158	NAME "Get job attrs (last time)"
159
160	# The resource to use for the POST
161	RESOURCE /
162
163	# The operation to use
164	OPERATION get-job-attributes
165
166	# Attributes, starting in the operation group...
167	GROUP operation
168	ATTR charset attributes-charset utf-8
169	ATTR language attributes-natural-language en
170	ATTR uri printer-uri $uri
171	ATTR integer job-id $job-id
172
173	# What statuses are OK?
174	STATUS successful-ok
175	STATUS successful-ok-ignored-or-substituted-attributes
176
177	# What attributes do we expect?
178	EXPECT job-state
179	EXPECT job-hold-until
180}
181