1#
2# "$Id: ipp-tests.test 12131 2014-08-28 23:38:16Z msweet $"
3#
4# IPP Everywhere Printer Self-Certification Manual 1.0: Section 6: IPP Tests.
5#
6# Copyright 2014 by The Printer Working Group.
7# Copyright 2007-2013 by Apple Inc.
8# Copyright 2001-2006 by Easy Software Products. All rights reserved.
9#
10# These coded instructions, statements, and computer programs are the
11# property of Apple Inc. and are protected by Federal copyright
12# law.  Distribution and use rights are outlined in the file "LICENSE.txt"
13# which should have been included with this file.  If this file is
14# file is missing or damaged, see the license at "http://www.cups.org/".
15#
16# Usage:
17#
18#   ./ipptool -tI printer-uri ipp-tests.test
19#
20# History:
21#
22# This test file is loosely based on the IPP/1.1, IPP/2.0 and IPP Everywhere
23# test files from the CUPS "test" directory.  Many of those tests have been
24# combined or removed, and all print tests are performed using a sample JPEG
25# file.  These tests also validate support for the 'media-empty' and
26# 'media-needed' keywords in the "printer-state-reasons" Printer attribute.
27#
28
29FILE-ID "org.pwg.ipp-everywhere.20140826.ipp"
30
31# All tests use IPP version 2.0, unless overridden in a test...
32VERSION 2.0
33
34# Regular expressions for URI schemes:
35#
36#   HTTP_URI_SCHEME - Matches strings beginning with http:// or https://
37#   IPP_URI_SCHEME  - Matches strings beginning with ipp:// or ipps://
38#   UUID_URI        - Matches UUID URN strings.
39
40DEFINE HTTP_URI_SCHEME "/^https?://.+$$/"
41DEFINE IPP_URI_SCHEME "/^ipps?://.+$$/"
42DEFINE LINK_LOCAL "/^(\[|\[v1.)fe80:/"
43DEFINE UUID_URI "/^urn:uuid:[0-9A-Fa-f]{8,8}-[0-9A-Fa-f]{4,4}-[0-9A-Fa-f]{4,4}-[0-9A-Fa-f]{4,4}-[0-9A-Fa-f]{12,12}/"
44
45# Regular expression for PWG media size names (eek!)
46#
47# Generated with help from: http://www.msweet.org/abnf.php
48DEFINE MEDIA_REGEX "/^(choice(_((custom|na|asme|roc|oe|roll)_[a-z0-9][-a-z0-9]*_([1-9][0-9]*(\.[0-9]*[1-9])?|0\.[0-9]*[1-9])x([1-9][0-9]*(\.[0-9]*[1-9])?|0\.[0-9]*[1-9])in|(custom|iso|jis|jpn|prc|om|roll)_[a-z0-9][-a-z0-9]*_([1-9][0-9]*(\.[0-9]*[1-9])?|0\.[0-9]*[1-9])x([1-9][0-9]*(\.[0-9]*[1-9])?|0\.[0-9]*[1-9])mm)){2,}|(custom|na|asme|roc|oe|roll)_[a-z0-9][-a-z0-9]*_([1-9][0-9]*(\.[0-9]*[1-9])?|0\.[0-9]*[1-9])x([1-9][0-9]*(\.[0-9]*[1-9])?|0\.[0-9]*[1-9])in|(custom|iso|jis|jpn|prc|om|roll)_[a-z0-9][-a-z0-9]*_([1-9][0-9]*(\.[0-9]*[1-9])?|0\.[0-9]*[1-9])x([1-9][0-9]*(\.[0-9]*[1-9])?|0\.[0-9]*[1-9])mm)$$/"
49
50# Regular expression for printer-alert attribute
51#
52# Generated with help from: http://www.msweet.org/abnf.php
53DEFINE ALERT_REGEX "/^code\=[A-Za-z]+(;(index\=[0-9]+|severity\=[A-Za-z]+|training\=[A-Za-z]+|group\=[A-Za-z]+|groupindex\=[0-9]+|location\=[0-9]+|time\=[0-9]+)){0,1}$$/"
54
55# Regular expression for printer-supply attribute
56#
57# Generated with help from: http://www.msweet.org/abnf.php
58DEFINE SUPPLY_REGEX "/^(type\=[A-Za-z]+|(maxcapacity\=([0-9]|\-){0,1})(level\=([0-9]|\-){0,1})|);*((index\=[0-9]+|markerindex\=[0-9]+|class\=[A-Za-z]+|unit\=[A-Za-z]+|colorantindex\=[0-9]+|colorantrole\=[A-Za-z]+|colorantname\=[A-Za-z]+|coloranttonality\=[0-9]+);){0,1}$$/"
59
60# Test that a request-id value of 0 is not accepted.
61#
62# Required by: RFC 2911 section 3.1.1
63{
64	NAME "I-1. RFC 2911 section 3.1.1: Bad request-id value 0"
65	REQUEST-ID 0
66	OPERATION Get-Printer-Attributes
67	GROUP operation-attributes-tag
68	ATTR charset attributes-charset utf-8
69	ATTR naturalLanguage attributes-natural-language en
70	ATTR uri printer-uri $uri
71
72	STATUS client-error-bad-request
73	EXPECT !printer-uri-supported
74}
75
76
77# Test that the first two attributes must be attributes-charset and
78# attributes-natural-language.
79#
80# Required by: RFC 2911 section 3.1.4
81{
82	NAME "I-2. RFC 2911 section 3.1.4: No Operation Attributes"
83	REQUEST-ID random
84	OPERATION Get-Printer-Attributes
85	GROUP operation-attributes-tag
86
87	STATUS client-error-bad-request
88	EXPECT !printer-uri-supported
89}
90{
91	NAME "I-3. RFC 2911 section 3.1.4: attributes-charset"
92	OPERATION Get-Printer-Attributes
93	GROUP operation-attributes-tag
94	ATTR charset attributes-charset utf-8
95	ATTR uri printer-uri $uri
96
97	STATUS client-error-bad-request
98	EXPECT !printer-uri-supported
99}
100{
101	NAME "I-4. RFC 2911 section 3.1.4: attributes-natural-language"
102	OPERATION Get-Printer-Attributes
103	GROUP operation-attributes-tag
104	ATTR naturalLanguage attributes-natural-language en
105	ATTR uri printer-uri $uri
106
107	STATUS client-error-bad-request
108	EXPECT !printer-uri-supported
109}
110{
111	NAME "I-5. RFC 2911 section 3.1.4: attributes-natural-language + attributes-charset"
112	OPERATION Get-Printer-Attributes
113	GROUP operation-attributes-tag
114	ATTR naturalLanguage attributes-natural-language en
115	ATTR charset attributes-charset utf-8
116	ATTR uri printer-uri $uri
117
118	STATUS client-error-bad-request
119	EXPECT !printer-uri-supported
120}
121{
122	NAME "I-6. RFC 2911 section 3.1.4: attributes-charset + attributes-natural-language"
123	OPERATION Get-Printer-Attributes
124	GROUP operation-attributes-tag
125	ATTR charset attributes-charset utf-8
126	ATTR naturalLanguage attributes-natural-language en
127	ATTR uri printer-uri $uri
128
129	STATUS successful-ok
130	EXPECT printer-uri-supported OF-TYPE uri WITH-ALL-VALUES "$IPP_URI_SCHEME"
131}
132
133
134# Test that bad IPP versions are not supported.
135#
136# Required by: RFC 2911 section 3.1.8
137{
138	# The name of the test...
139	NAME "I-7. RFC 2911 section 3.1.8: Unsupported IPP version 0.0"
140	VERSION 0.0
141	OPERATION Get-Printer-Attributes
142	GROUP operation-attributes-tag
143	ATTR charset attributes-charset utf-8
144	ATTR naturalLanguage attributes-natural-language en
145	ATTR uri printer-uri $uri
146
147	STATUS server-error-version-not-supported
148	EXPECT !printer-uri-supported
149}
150
151
152# Test that printer operations require the printer-uri operation attribute.
153#
154# Required by: RFC 2911 section 3.2
155{
156	NAME "I-8. RFC 2911 section 3.2: No printer-uri operation attribute"
157	OPERATION Get-Printer-Attributes
158	GROUP operation-attributes-tag
159	ATTR charset attributes-charset utf-8
160	ATTR naturalLanguage attributes-natural-language en
161
162	STATUS client-error-bad-request
163	EXPECT !printer-uri-supported
164}
165
166
167# Test Get-Printer-Attributes operation
168#
169# Required by: PWG 5100.14 Section 5.x
170{
171	NAME "I-9. Get-Printer-Attributes Operation (default)"
172	OPERATION Get-Printer-Attributes
173	GROUP operation-attributes-tag
174	ATTR charset attributes-charset utf-8
175	ATTR naturalLanguage attributes-natural-language en
176	ATTR uri printer-uri $uri
177	ATTR name requesting-user-name $user
178
179	STATUS successful-ok
180
181	# PWG 5100.14 - Table 5 - Operations
182	EXPECT operations-supported OF-TYPE enum IN-GROUP printer-attributes-tag WITH-VALUE 0x0002 # Print-Job
183	EXPECT operations-supported WITH-VALUE 0x0004 # Validate-Job
184	EXPECT operations-supported WITH-VALUE 0x0005 # Create-Job
185	EXPECT operations-supported WITH-VALUE 0x0006 # Send-Document
186	EXPECT operations-supported WITH-VALUE 0x0008 # Cancel-Job
187	EXPECT operations-supported WITH-VALUE 0x0009 # Get-Job-Attributes
188	EXPECT operations-supported WITH-VALUE 0x000a # Get-Jobs
189	EXPECT operations-supported WITH-VALUE 0x000b # Get-Printer-Attributes
190	EXPECT operations-supported WITH-VALUE 0x0039 # Cancel-My-Jobs
191	EXPECT operations-supported WITH-VALUE 0x003b # Close-Job
192	EXPECT operations-supported WITH-VALUE 0x003c # Identify-Printer
193
194	# PWG 5100.14 - Table 6 - Printer Description Attributes
195	EXPECT charset-configured OF-TYPE charset IN-GROUP printer-attributes-tag COUNT 1
196
197	EXPECT charset-supported OF-TYPE charset IN-GROUP printer-attributes-tag WITH-VALUE utf-8
198
199	EXPECT color-supported OF-TYPE boolean IN-GROUP printer-attributes-tag COUNT 1
200	EXPECT color-supported WITH-VALUE true DEFINE-MATCH HAVE_COLOR
201
202	EXPECT compression-supported OF-TYPE keyword IN-GROUP printer-attributes-tag WITH-VALUE "none"
203	EXPECT compression-supported OF-TYPE keyword IN-GROUP printer-attributes-tag WITH-VALUE "deflate" DEFINE-MATCH HAVE_DEFLATE
204	EXPECT compression-supported OF-TYPE keyword IN-GROUP printer-attributes-tag WITH-VALUE "gzip" DEFINE-MATCH HAVE_GZIP
205
206	EXPECT copies-default OF-TYPE integer IN-GROUP printer-attributes-tag COUNT 1 WITH-VALUE >0
207	EXPECT copies-supported OF-TYPE rangeOfInteger IN-GROUP printer-attributes-tag
208
209	EXPECT document-format-default OF-TYPE mimeMediaType IN-GROUP printer-attributes-tag COUNT 1
210	EXPECT document-format-supported OF-TYPE mimeMediaType IN-GROUP printer-attributes-tag WITH-VALUE "image/jpeg"
211	EXPECT document-format-supported OF-TYPE mimeMediaType IN-GROUP printer-attributes-tag WITH-VALUE "image/pwg-raster"
212	EXPECT document-format-supported OF-TYPE mimeMediaType IN-GROUP printer-attributes-tag WITH-VALUE "application/pdf" DEFINE-MATCH HAVE_PDF
213
214	EXPECT document-password-supported OF-TYPE integer IN-GROUP printer-attributes-tag COUNT 1 IF-DEFINED HAVE_PDF
215
216	EXPECT feed-orientation-supported OF-TYPE keyword IN-GROUP printer-attributes-tag DEFINE-MATCH HAVE_FEED_ORIENTATION
217	EXPECT feed-orientation-default OF-TYPE keyword IN-GROUP printer-attributes-tag COUNT 1 IF-DEFINED HAVE_FEED_ORIENTATION
218
219	EXPECT finishings-supported OF-TYPE enum IN-GROUP printer-attributes-tag WITH-VALUE 3 DEFINE-MATCH HAVE_FINISHINGS
220	EXPECT finishings-default OF-TYPE enum IN-GROUP printer-attributes-tag IF-DEFINED HAVE_FINISHINGS
221
222	EXPECT generated-natural-language-supported OF-TYPE naturalLanguage IN-GROUP printer-attributes-tag
223
224	EXPECT identify-actions-default OF-TYPE keyword IN-GROUP printer-attributes-tag WITH-VALUE "/^(display|flash|sound|speak)$/"
225	EXPECT identify-actions-supported OF-TYPE keyword IN-GROUP printer-attributes-tag WITH-VALUE "/^(display|flash|sound|speak)$/"
226
227	EXPECT ipp-features-supported OF-TYPE keyword IN-GROUP printer-attributes-tag WITH-VALUE "ipp-everywhere"
228
229	EXPECT ipp-versions-supported OF-TYPE keyword IN-GROUP printer-attributes-tag WITH-VALUE "2.0"
230
231	EXPECT job-account-id-supported OF-TYPE boolean IN-GROUP printer-attributes-tag WITH-VALUE true COUNT 1 DEFINE-MATCH HAVE_JOB_ACCOUNT_ID
232	EXPECT job-account-id-default OF-TYPE name|no-value IN-GROUP printer-attributes-tag COUNT 1 IF-DEFINED HAVE_JOB_ACCOUNT_ID
233
234	EXPECT job-accounting-user-id-supported OF-TYPE boolean IN-GROUP printer-attributes-tag WITH-VALUE true COUNT 1 DEFINE-MATCH HAVE_JOB_ACCOUNTING_USER_ID
235	EXPECT job-accounting-user-id-default OF-TYPE name|no-value IN-GROUP printer-attributes-tag COUNT 1 IF-DEFINED HAVE_JOB_ACCOUNTING_USER_ID
236
237	EXPECT job-constraints-supported OF-TYPE collection IN-GROUP printer-attributes-tag DEFINE-MATCH HAVE_JOB_CONSTRAINTS
238
239	EXPECT job-creation-attributes-supported OF-TYPE keyword IN-GROUP printer-attributes-tag WITH-VALUE "/^(media|print-color-mode)$$/"
240
241	EXPECT job-ids-supported OF-TYPE boolean IN-GROUP printer-attributes-tag COUNT 1 WITH-VALUE true
242
243	# TODO: Make job-password-xxx conditionally required
244	EXPECT ?job-password-supported OF-TYPE integer IN-GROUP printer-attributes-tag COUNT 1
245	EXPECT ?job-password-encryption-supported OF-TYPE keyword IN-GROUP printer-attributes-tag
246
247	EXPECT job-preferred-attributes-supported OF-TYPE boolean IN-GROUP printer-attributes-tag COUNT 1
248
249	EXPECT job-resolvers-supported OF-TYPE collection IN-GROUP printer-attributes-tag IF-DEFINED HAVE_JOB_CONSTRAINTS
250
251	EXPECT media-bottom-margin-supported OF-TYPE integer IN-GROUP printer-attributes-tag WITH-ALL-VALUES >-1
252
253	# Default Get-Printer-Attributes MUST NOT return media-col-database, per PWG 5100.11 (JPS2)
254	EXPECT !media-col-database OF-TYPE collection IN-GROUP printer-attributes-tag
255
256	EXPECT media-source-supported OF-TYPE keyword|name IN-GROUP printer-attributes-tag DEFINE-MATCH HAVE_MEDIA_SOURCE
257
258	EXPECT media-type-supported OF-TYPE keyword|name IN-GROUP printer-attributes-tag DEFINE-MATCH HAVE_MEDIA_TYPE
259
260	EXPECT media-col-default OF-TYPE collection IN-GROUP printer-attributes-tag COUNT 1
261	EXPECT media-col-default/media-size OF-TYPE collection COUNT 1
262	EXPECT media-col-default/media-size/x-dimension OF-TYPE integer COUNT 1 WITH-VALUE >0
263	EXPECT media-col-default/media-size/y-dimension OF-TYPE integer COUNT 1 WITH-VALUE >0
264	EXPECT media-col-default/media-source OF-TYPE keyword|name COUNT 1 IF-DEFINED HAVE_MEDIA_SOURCE
265	EXPECT media-col-default/media-type OF-TYPE keyword|name COUNT 1 IF-DEFINED HAVE_MEDIA_TYPE
266
267	# TODO: Use EXPECT-ALL (STR #4469)
268	EXPECT media-col-ready OF-TYPE collection|no-value IN-GROUP printer-attributes-tag
269	EXPECT media-col-ready/media-size OF-TYPE collection COUNT 1
270	EXPECT media-col-ready/media-size/x-dimension OF-TYPE integer COUNT 1 WITH-VALUE >0
271	EXPECT media-col-ready/media-size/y-dimension OF-TYPE integer COUNT 1 WITH-VALUE >0
272	EXPECT media-col-ready/media-source OF-TYPE keyword|name COUNT 1 IF-DEFINED HAVE_MEDIA_SOURCE
273	EXPECT ?media-col-ready/media-source-properties OF-TYPE collection COUNT 1
274	EXPECT media-col-ready/media-type OF-TYPE keyword|name COUNT 1 IF-DEFINED HAVE_MEDIA_TYPE
275
276	EXPECT media-col-supported OF-TYPE keyword IN-GROUP printer-attributes-tag
277	EXPECT media-col-supported WITH-VALUE "media-size"
278	EXPECT media-col-supported WITH-VALUE "media-source" IF-DEFINED HAVE_MEDIA_SOURCE
279	EXPECT media-col-supported WITH-VALUE "media-type" IF-DEFINED HAVE_MEDIA_TYPE
280
281	EXPECT media-default OF-TYPE no-value|keyword|name IN-GROUP printer-attributes-tag COUNT 1 WITH-VALUE "$MEDIA_REGEX"
282	EXPECT media-default WITH-VALUE "$MEDIA_REGEX" DEFINE-VALUE DEFAULT_MEDIA
283
284	EXPECT media-left-margin-supported OF-TYPE integer IN-GROUP printer-attributes-tag WITH-ALL-VALUES >-1
285
286	EXPECT media-ready OF-TYPE keyword|name|no-value IN-GROUP printer-attributes-tag WITH-ALL-VALUES "$MEDIA_REGEX"
287
288	EXPECT media-right-margin-supported OF-TYPE integer IN-GROUP printer-attributes-tag WITH-ALL-VALUES >-1
289
290	EXPECT media-size-supported OF-TYPE collection IN-GROUP printer-attributes-tag
291	# TODO: Use EXPECT-ALL (STR #4469)
292	EXPECT media-size-supported/x-dimension OF-TYPE integer|rangeOfInteger
293	EXPECT media-size-supported/y-dimension OF-TYPE integer|rangeOfInteger
294
295	# media-source-supported tests above to set HAVE_MEDIA_SOURCE
296
297	EXPECT media-supported OF-TYPE keyword|name IN-GROUP printer-attributes-tag WITH-ALL-VALUES "$MEDIA_REGEX"
298
299	EXPECT media-top-margin-supported OF-TYPE integer IN-GROUP printer-attributes-tag WITH-ALL-VALUES >-1
300
301	# media-type-supported tests above to set HAVE_MEDIA_TYPE
302
303	EXPECT multiple-document-jobs-supported OF-TYPE boolean IN-GROUP printer-attributes-tag COUNT 1
304
305	EXPECT multiple-operation-time-out OF-TYPE integer IN-GROUP printer-attributes-tag COUNT 1 WITH-VALUE >0
306
307	EXPECT multiple-operation-time-out-action OF-TYPE keyword IN-GROUP printer-attributes-tag COUNT 1 WITH-VALUE "/^(abort-job|hold-job|process-job)$/"
308
309	EXPECT natural-language-configured OF-TYPE naturalLanguage IN-GROUP printer-attributes-tag COUNT 1
310
311	# operations-supported tested above for required operations
312
313	# TODO: Use WITH-VALUE-FROM "name-supported" syntax (STR #4470)
314	EXPECT orientation-requested-default OF-TYPE no-value|enum IN-GROUP printer-attributes-tag COUNT 1 WITH-VALUE 3,4,5,6,7
315	EXPECT orientation-requested-supported OF-TYPE enum IN-GROUP printer-attributes-tag WITH-VALUE 3,4,5,6,7
316
317	# TODO: Use WITH-VALUE-FROM "name-supported" syntax (STR #4470)
318	EXPECT output-bin-default OF-TYPE keyword|name IN-GROUP printer-attributes-tag COUNT 1
319	EXPECT output-bin-default DEFINE-VALUE DEFAULT_OUTPUT_BIN
320	EXPECT output-bin-supported OF-TYPE keyword|name IN-GROUP printer-attributes-tag
321
322	EXPECT overrides-supported OF-TYPE keyword IN-GROUP printer-attributes-tag WITH-VALUE "document-number" IF-DEFINED HAVE_PDF
323	EXPECT overrides-supported WITH-VALUE "pages" IF-DEFINED HAVE_PDF
324
325	EXPECT page-ranges-supported OF-TYPE boolean IN-GROUP printer-attributes-tag COUNT 1 WITH-VALUE true IF-DEFINED HAVE_PDF
326
327	EXPECT pages-per-minute OF-TYPE integer IN-GROUP printer-attributes-tag COUNT 1
328
329	EXPECT pages-per-minute-color OF-TYPE integer IN-GROUP printer-attributes-tag COUNT 1 IF-DEFINED HAVE_COLOR
330	EXPECT !pages-per-minute-color IF-NOT-DEFINED HAVE_COLOR
331
332	# TODO: Use WITH-VALUE-FROM "name-supported" syntax (STR #4470)
333	EXPECT print-color-mode-default OF-TYPE keyword IN-GROUP printer-attributes-tag COUNT 1 WITH-VALUE "/^(auto|auto-monochrome|bi-level|color|highlight|monochrome|process-bi-level|process-monochrome)$/"
334	EXPECT print-color-mode-default DEFINE-VALUE DEFAULT_PRINT_COLOR_MODE
335	EXPECT print-color-mode-supported OF-TYPE keyword IN-GROUP printer-attributes-tag WITH-ALL-VALUES "/^(auto|auto-monochrome|bi-level|color|highlight|monochrome|process-bi-level|process-monochrome)$/"
336
337	# TODO: Use WITH-VALUE-FROM "name-supported" syntax (STR #4470)
338	EXPECT print-content-optimize-default OF-TYPE keyword IN-GROUP printer-attributes-tag COUNT 1 WITH-VALUE "/^(auto|graphic|photo|text|text-and-graphic)$/"
339	EXPECT print-content-optimize-default DEFINE-VALUE DEFAULT_PRINT_CONTENT_OPTIMIZE
340	EXPECT print-content-optimize-supported OF-TYPE keyword IN-GROUP printer-attributes-tag WITH-ALL-VALUES "/^(auto|graphic|photo|text|text-and-graphic)$/"
341
342	# TODO: Use WITH-VALUE-FROM "name-supported" syntax (STR #4470)
343	EXPECT print-rendering-intent-default OF-TYPE keyword IN-GROUP printer-attributes-tag COUNT 1 WITH-VALUE "/^(auto|absolute|perceptual|relative|relative-bpc|saturation)$/"
344	EXPECT print-rendering-intent-default DEFINE-VALUE DEFAULT_PRINT_RENDERING_INTENT
345	EXPECT print-rendering-intent-supported OF-TYPE keyword IN-GROUP printer-attributes-tag WITH-ALL-VALUES "/^(auto|absolute|perceptual|relative|relative-bpc|saturation)$/"
346
347	# TODO: Use WITH-VALUE-FROM "name-supported" syntax (STR #4470)
348	EXPECT print-quality-default OF-TYPE enum IN-GROUP printer-attributes-tag COUNT 1 WITH-VALUE 3,4,5
349	EXPECT print-quality-default DEFINE-VALUE DEFAULT_PRINT_QUALITY
350	EXPECT print-quality-supported OF-TYPE enum IN-GROUP printer-attributes-tag WITH-VALUE 3,4,5
351
352	EXPECT ?printer-alert OF-TYPE octetString IN-GROUP printer-attributes-tag WITH-ALL-VALUES "$ALERT_REGEX"
353	EXPECT ?printer-alert-description OF-TYPE text IN-GROUP printer-attributes-tag SAME-COUNT-AS printer-alert
354
355	EXPECT ?printer-charge-info OF-TYPE text IN-GROUP printer-attributes-tag COUNT 1 DEFINE-MATCH HAVE_CHARGE_INFO
356	EXPECT printer-charge-info-uri OF-TYPE uri IN-GROUP printer-attributes-tag COUNT 1 IF-DEFINED HAVE_CHARGE_INFO
357
358	EXPECT printer-config-change-date-time OF-TYPE dateTime IN-GROUP printer-attributes-tag COUNT 1
359
360	EXPECT printer-config-change-time OF-TYPE integer IN-GROUP printer-attributes-tag COUNT 1 WITH-VALUE >-1
361
362	EXPECT printer-device-id OF-TYPE text IN-GROUP printer-attributes-tag COUNT 1 WITH-VALUE "/^([-A-Za-z ]+:[^;]*;)+$/"
363
364	EXPECT printer-geo-location OF-TYPE uri|unknown IN-GROUP printer-attributes-tag COUNT 1 WITH-VALUE "/^geo:/"
365
366	EXPECT printer-get-attributes-supported OF-TYPE keyword IN-GROUP printer-attributes-tag WITH-VALUE "document-format"
367
368	# TODO: Use EXPECT-ALL syntax
369	EXPECT printer-icc-profiles-supported OF-TYPE collection IN-GROUP printer-attributes-tag DEFINE-MATCH HAVE_ICC_PROFILES
370	EXPECT printer-icc-profiles-supported/profile-name OF-TYPE name COUNT 1 IF-DEFINED HAVE_ICC_PROFILES
371	EXPECT printer-icc-profiles-supported/profile-uri OF-TYPE uri COUNT 1 WITH-VALUE "$HTTP_URI_SCHEME" IF-DEFINED HAVE_ICC_PROFILES
372
373	EXPECT printer-icons OF-TYPE uri IN-GROUP printer-attributes-tag WITH-ALL-VALUES "$HTTP_URI_SCHEME"
374	EXPECT printer-icons OF-TYPE uri WITH-ALL-HOSTNAMES "$hostname"
375
376	EXPECT printer-info OF-TYPE text IN-GROUP printer-attributes-tag COUNT 1 WITH-VALUE "/^.{0,127}$$/"
377
378	EXPECT printer-is-accepting-jobs OF-TYPE boolean IN-GROUP printer-attributes-tag COUNT 1
379
380	EXPECT printer-location OF-TYPE text IN-GROUP printer-attributes-tag COUNT 1 WITH-VALUE "/^.{0,127}$$/"
381
382	EXPECT printer-make-and-model OF-TYPE text IN-GROUP printer-attributes-tag COUNT 1 WITH-VALUE "/^.{0,127}$$/"
383
384	EXPECT printer-more-info OF-TYPE uri IN-GROUP printer-attributes-tag COUNT 1 WITH-VALUE "$HTTP_URI_SCHEME"
385	# EXPECT !printer-more-info WITH-HOSTNAME "$LINK_LOCAL"
386	# TODO: Provide warnings when hostname doesn't match
387
388	EXPECT printer-name OF-TYPE name IN-GROUP printer-attributes-tag COUNT 1 WITH-VALUE "/^.{0,127}$$/"
389
390	EXPECT printer-organization OF-TYPE text IN-GROUP printer-attributes-tag
391
392	EXPECT printer-organizational-unit OF-TYPE text IN-GROUP printer-attributes-tag
393
394	# TODO: Use WITH-VALUE-FROM "name-supported" syntax (STR #4470)
395	EXPECT printer-resolution-default OF-TYPE resolution IN-GROUP printer-attributes-tag COUNT 1
396	EXPECT printer-resolution-default DEFINE-VALUE DEFAULT_PRINTER_RESOLUTION
397	EXPECT printer-resolution-supported OF-TYPE resolution IN-GROUP printer-attributes-tag
398
399	EXPECT printer-state OF-TYPE enum IN-GROUP printer-attributes-tag COUNT 1 WITH-VALUE 3,4,5
400
401	EXPECT printer-state-change-date-time OF-TYPE dateTime IN-GROUP printer-attributes-tag COUNT 1
402
403	EXPECT printer-state-change-time OF-TYPE integer IN-GROUP printer-attributes-tag COUNT 1 WITH-VALUE >-1
404
405	EXPECT printer-state-message OF-TYPE text IN-GROUP printer-attributes-tag
406
407	EXPECT printer-state-reasons OF-TYPE keyword IN-GROUP printer-attributes-tag
408
409	EXPECT printer-supply OF-TYPE octetString IN-GROUP printer-attributes-tag WITH-ALL-VALUES "$SUPPLY_REGEX"
410
411	EXPECT printer-supply-description OF-TYPE text IN-GROUP printer-attributes-tag SAME-COUNT-AS printer-supply
412
413	EXPECT printer-supply-info-uri OF-TYPE uri IN-GROUP printer-attributes-tag COUNT 1 WITH-VALUE "$HTTP_URI_SCHEME"
414	EXPECT printer-supply-info-uri WITH-HOSTNAME "$hostname"
415	# EXPECT !printer-supply-info-uri WITH-HOSTNAME "$LINK_LOCAL"
416
417	EXPECT printer-up-time OF-TYPE integer IN-GROUP printer-attributes-tag COUNT 1 WITH-VALUE >0
418
419	EXPECT printer-uri-supported OF-TYPE uri IN-GROUP printer-attributes-tag SAME-COUNT-AS uri-security-supported WITH-ALL-VALUES "$IPP_URI_SCHEME"
420	# EXPECT !printer-uri-supported WITH-HOSTNAME "$LINK_LOCAL"
421
422	EXPECT printer-uuid OF-TYPE uri IN-GROUP printer-attributes-tag COUNT 1 WITH-VALUE "$UUID_URI"
423
424	EXPECT pwg-raster-document-resolution-supported OF-TYPE resolution IN-GROUP printer-attributes-tag
425
426	EXPECT pwg-raster-document-sheet-back OF-TYPE keyword IN-GROUP printer-attributes-tag COUNT 1 WITH-VALUE "/^(flipped|manual-tumble|normal|rotated)$$/"
427
428	EXPECT pwg-raster-document-type-supported OF-TYPE keyword IN-GROUP printer-attributes-tag
429
430	EXPECT queued-job-count OF-TYPE integer IN-GROUP printer-attributes-tag COUNT 1
431
432	# TODO: Use WITH-VALUE-FROM "name-supported" syntax (STR #4470)
433	EXPECT sides-default OF-TYPE keyword IN-GROUP printer-attributes-tag COUNT 1 WITH-ALL-VALUES "/^(one-sided|two-sided-long-edge|two-sided-short-edge)$$/"
434	EXPECT sides-default DEFINE-VALUE DEFAULT_SIDES
435	EXPECT sides-supported OF-TYPE keyword IN-GROUP printer-attributes-tag WITH-ALL-VALUES "/^(one-sided|two-sided-long-edge|two-sided-short-edge)$$/"
436
437	EXPECT uri-authentication-supported OF-TYPE keyword IN-GROUP printer-attributes-tag
438
439	EXPECT uri-security-supported OF-TYPE keyword IN-GROUP printer-attributes-tag SAME-COUNT-AS uri-authentication-supported
440
441	EXPECT which-jobs-supported OF-TYPE keyword IN-GROUP printer-attributes-tag WITH-VALUE "completed"
442	EXPECT which-jobs-supported WITH-VALUE "not-completed"
443}
444
445
446# Test Get-Printer-Attributes operation with requested-attributes
447#
448# Required by: RFC 2911 section 3.2.5, PWG 5100.11 (JPS2)
449{
450	NAME "I-10. Get-Printer-Attributes Operation (requested-attributes)"
451	OPERATION Get-Printer-Attributes
452	GROUP operation-attributes-tag
453	ATTR charset attributes-charset utf-8
454	ATTR naturalLanguage attributes-natural-language en
455	ATTR uri printer-uri $uri
456	ATTR name requesting-user-name $user
457	ATTR keyword requested-attributes media-col-database,printer-uri-supported
458
459	STATUS successful-ok
460
461	# TODO: Use EXPECT-ALL (STR #4469)
462	EXPECT media-col-database OF-TYPE collection IN-GROUP printer-attributes-tag
463	EXPECT media-col-database/media-size OF-TYPE collection COUNT 1
464	EXPECT media-col-database/media-size/x-dimension OF-TYPE integer COUNT 1 WITH-VALUE >0
465	EXPECT media-col-database/media-size/y-dimension OF-TYPE integer COUNT 1 WITH-VALUE >0
466	EXPECT media-col-database/media-source OF-TYPE keyword|name COUNT 1 IF-DEFINED HAVE_MEDIA_SOURCE
467	EXPECT ?media-col-database/media-source-properties OF-TYPE collection COUNT 1
468	EXPECT media-col-database/media-type OF-TYPE keyword|name COUNT 1 IF-DEFINED HAVE_MEDIA_TYPE
469
470	EXPECT !printer-name
471	EXPECT printer-uri-supported OF-TYPE uri IN-GROUP printer-attributes-tag WITH-ALL-VALUES "$IPP_URI_SCHEME"
472}
473
474
475# Test Validate-Job operation
476#
477# Required by: RFC 2911 section 3.2.3
478{
479	NAME "I-11 Validate-Job Operation"
480	OPERATION Validate-Job
481	GROUP operation-attributes-tag
482	ATTR charset attributes-charset utf-8
483	ATTR naturalLanguage attributes-natural-language en
484	ATTR uri printer-uri $uri
485	ATTR name requesting-user-name $user
486	ATTR name job-name "color.jpg"
487	ATTR boolean ipp-attribute-fidelity false
488	ATTR name document-name "color.jpg"
489	ATTR keyword compression none
490	ATTR mimeMediaType document-format "image/jpeg"
491
492	GROUP job-attributes-tag
493	ATTR keyword media "$DEFAULT_MEDIA"
494	ATTR keyword print-color-mode "$DEFAULT_PRINT_COLOR_MODE"
495	ATTR keyword print-content-optimize "$DEFAULT_PRINT_CONTENT_OPTIMIZE"
496	ATTR keyword print-rendering-intent "$DEFAULT_PRINT_RENDERING_INTENT"
497	ATTR enum print-quality $DEFAULT_PRINT_QUALITY
498	ATTR resolution printer-resolution $DEFAULT_PRINTER_RESOLUTION
499	ATTR keyword sides "one-sided"
500
501	STATUS successful-ok
502}
503
504
505# Test Print-Job operation
506#
507# Required by: RFC 2911 section 3.2.1
508{
509	NAME "I-12. Print-Job Operation (color.jpg)"
510	OPERATION Print-Job
511	GROUP operation-attributes-tag
512	ATTR charset attributes-charset utf-8
513	ATTR naturalLanguage attributes-natural-language en
514	ATTR uri printer-uri $uri
515	ATTR name requesting-user-name $user
516	ATTR name job-name "job-color.jpg"
517	ATTR boolean ipp-attribute-fidelity false
518	ATTR name document-name "document-color.jpg"
519	ATTR keyword compression none
520	ATTR mimeMediaType document-format "image/jpeg"
521
522	GROUP job-attributes-tag
523	ATTR keyword media "$DEFAULT_MEDIA"
524	ATTR keyword print-color-mode "$DEFAULT_PRINT_COLOR_MODE"
525	ATTR keyword print-content-optimize "$DEFAULT_PRINT_CONTENT_OPTIMIZE"
526	ATTR keyword print-rendering-intent "$DEFAULT_PRINT_RENDERING_INTENT"
527	ATTR enum print-quality $DEFAULT_PRINT_QUALITY
528	ATTR resolution printer-resolution $DEFAULT_PRINTER_RESOLUTION
529	ATTR keyword sides "one-sided"
530
531	FILE "color.jpg"
532
533	STATUS successful-ok
534	STATUS server-error-job-canceled
535	STATUS server-error-busy REPEAT-MATCH REPEAT-LIMIT 30
536
537	EXPECT job-uri OF-TYPE uri COUNT 1 IN-GROUP job-attributes-tag WITH-VALUE "$IPP_URI_SCHEME"
538
539	EXPECT job-id OF-TYPE integer COUNT 1 IN-GROUP job-attributes-tag WITH-VALUE >0
540	EXPECT job-id DEFINE-VALUE PRINT_JOB_ID
541
542	EXPECT job-state OF-TYPE unknown|enum COUNT 1 IN-GROUP job-attributes-tag WITH-VALUE 3,4,5,6,7,8,9
543	EXPECT job-state WITH-VALUE 7,8,9 DEFINE-MATCH PRINT_JOB_COMPLETED
544
545	EXPECT job-state-message OF-TYPE text IN-GROUP job-attributes-tag
546
547	EXPECT job-state-reasons OF-TYPE keyword IN-GROUP job-attributes-tag
548}
549
550
551# Test Get-Jobs operation
552#
553# Required by: RFC 2911 section 3.2.6
554{
555	SKIP-IF-DEFINED PRINT_JOB_COMPLETED
556
557	NAME "I-13. Get-Jobs Operation (default)"
558	OPERATION Get-Jobs
559	GROUP operation-attributes-tag
560	ATTR charset attributes-charset utf-8
561	ATTR naturalLanguage attributes-natural-language en
562	ATTR uri printer-uri $uri
563	ATTR name requesting-user-name $user
564
565	STATUS successful-ok
566
567	EXPECT ?job-id OF-TYPE integer IN-GROUP job-attributes-tag COUNT 1 WITH-VALUE >0
568	EXPECT ?job-uri OF-TYPE uri IN-GROUP job-attributes-tag COUNT 1 WITH-VALUE "$IPP_URI_SCHEME"
569	EXPECT !job-name
570	EXPECT !job-state
571}
572
573
574# Test Get-Jobs operation
575#
576# Required by: RFC 2911 section 3.2.6
577{
578	SKIP-IF-DEFINED PRINT_JOB_COMPLETED
579
580	NAME "I-14. Get-Jobs Operation (requested-attributes)"
581	OPERATION Get-Jobs
582	GROUP operation-attributes-tag
583	ATTR charset attributes-charset utf-8
584	ATTR naturalLanguage attributes-natural-language en
585	ATTR uri printer-uri $uri
586	ATTR name requesting-user-name $user
587	ATTR keyword requested-attributes all
588
589	STATUS successful-ok
590
591	# PWG 5100.14 - Table 9 - Job Description attributes
592	EXPECT ?compression-supplied OF-TYPE keyword IN-GROUP job-attributes-tag COUNT 1
593	EXPECT date-time-at-completed OF-TYPE dateTime|no-value IN-GROUP job-attributes-tag COUNT 1
594	EXPECT date-time-at-creation OF-TYPE dateTime IN-GROUP job-attributes-tag COUNT 1
595	EXPECT date-time-at-processing OF-TYPE dateTime|no-value IN-GROUP job-attributes-tag COUNT 1
596	EXPECT document-format-supplied OF-TYPE mimeMediaType|no-value IN-GROUP job-attributes-tag COUNT 1
597	EXPECT ?document-format-version-supplied OF-TYPE text IN-GROUP job-attributes-tag COUNT 1
598	EXPECT document-name-supplied OF-TYPE name IN-GROUP job-attributes-tag COUNT 1
599	EXPECT job-id OF-TYPE integer IN-GROUP job-attributes-tag COUNT 1 WITH-VALUE >0
600	EXPECT job-impressions OF-TYPE integer|no-value IN-GROUP job-attributes-tag COUNT 1 WITH-VALUE >-1
601	EXPECT job-impressions-completed OF-TYPE integer IN-GROUP job-attributes-tag COUNT 1 WITH-VALUE >-1
602	EXPECT job-name OF-TYPE name IN-GROUP job-attributes-tag COUNT 1
603	EXPECT job-originating-user-name OF-TYPE name IN-GROUP job-attributes-tag COUNT 1 WITH-VALUE "$user"
604	EXPECT job-printer-up-time OF-TYPE integer IN-GROUP job-attributes-tag COUNT 1 WITH-VALUE >-1
605	EXPECT job-printer-uri OF-TYPE uri IN-GROUP job-attributes-tag COUNT 1 WITH-VALUE "$uri"
606	EXPECT job-state OF-TYPE unknown|enum IN-GROUP job-attributes-tag COUNT 1 WITH-VALUE >2,<7
607	EXPECT job-state-message OF-TYPE text IN-GROUP job-attributes-tag COUNT 1
608	EXPECT job-state-reasons OF-TYPE keyword IN-GROUP job-attributes-tag
609	EXPECT job-uri OF-TYPE uri IN-GROUP job-attributes-tag COUNT 1 WITH-VALUE "$IPP_URI_SCHEME"
610	EXPECT job-uuid OF-TYPE uri IN-GROUP job-attributes-tag COUNT 1 WITH-VALUE "$UUID_URI"
611	EXPECT time-at-completed OF-TYPE no-value|integer IN-GROUP job-attributes-tag COUNT 1 WITH-VALUE >-1
612	EXPECT time-at-creation OF-TYPE integer IN-GROUP job-attributes-tag COUNT 1 WITH-VALUE >-1
613	EXPECT time-at-processing OF-TYPE no-value|integer IN-GROUP job-attributes-tag COUNT 1 WITH-VALUE >-1
614
615	# PWG 5100.15 - Table 8 - Job Template attributes
616	EXPECT ?copies OF-TYPE integer IN-GROUP job-attributes-tag COUNT 1
617	EXPECT ?feed-orientation OF-TYPE enum IN-GROUP job-attributes-tag COUNT 1
618	EXPECT ?finishings OF-TYPE enum IN-GROUP job-attributes-tag
619	EXPECT ?job-account-id OF-TYPE name IN-GROUP job-attributes-tag COUNT 1
620	EXPECT ?job-accounting-user-id OF-TYPE name IN-GROUP job-attributes-tag COUNT 1
621	EXPECT ?media OF-TYPE keyword|name IN-GROUP job-attributes-tag COUNT 1
622	EXPECT ?media-col OF-TYPE collection IN-GROUP job-attributes-tag COUNT 1
623	EXPECT ?multiple-document-handling OF-TYPE keyword IN-GROUP job-attributes-tag COUNT 1
624	EXPECT ?orientation-requested OF-TYPE enum IN-GROUP job-attributes-tag COUNT 1
625	EXPECT ?output-bin OF-TYPE keyword|name IN-GROUP job-attributes-tag COUNT 1
626	EXPECT ?page-ranges OF-TYPE rangeOfInteger IN-GROUP job-attributes-tag
627	EXPECT ?print-color-mode OF-TYPE keyword IN-GROUP job-attributes-tag COUNT 1
628	EXPECT ?print-content-optimize OF-TYPE keyword IN-GROUP job-attributes-tag COUNT 1
629	EXPECT ?print-quality OF-TYPE enum IN-GROUP job-attributes-tag COUNT 1
630	EXPECT ?print-rendering-intent OF-TYPE keyword IN-GROUP job-attributes-tag COUNT 1
631	EXPECT ?printer-resolution OF-TYPE resolution IN-GROUP job-attributes-tag COUNT 1
632	EXPECT ?sides OF-TYPE keyword IN-GROUP job-attributes-tag COUNT 1
633}
634
635
636# Test Get-Jobs operation
637#
638# Required by: RFC 2911 section 3.2.6
639{
640	SKIP-IF-DEFINED PRINT_JOB_COMPLETED
641
642	NAME "I-15. Get-Jobs Operation (which-jobs=not-completed)"
643	OPERATION Get-Jobs
644	GROUP operation-attributes-tag
645	ATTR charset attributes-charset utf-8
646	ATTR naturalLanguage attributes-natural-language en
647	ATTR uri printer-uri $uri
648	ATTR name requesting-user-name $user
649	ATTR keyword which-jobs not-completed
650
651	STATUS successful-ok
652
653	EXPECT ?job-id OF-TYPE integer IN-GROUP job-attributes-tag COUNT 1 WITH-VALUE >0
654	EXPECT ?job-uri OF-TYPE uri IN-GROUP job-attributes-tag COUNT 1 WITH-VALUE "$IPP_URI_SCHEME"
655	EXPECT !job-name
656	EXPECT !job-state
657}
658
659
660# Wait for job to complete...
661{
662	SKIP-IF-NOT-DEFINED PRINT_JOB_ID
663
664	NAME "I-16. Get-Job-Attributes Until Job Complete"
665	OPERATION Get-Job-Attributes
666	GROUP operation-attributes-tag
667	ATTR charset attributes-charset utf-8
668	ATTR naturalLanguage attributes-natural-language en
669	ATTR uri printer-uri $uri
670	ATTR integer job-id $PRINT_JOB_ID
671	ATTR name requesting-user-name $user
672
673	STATUS successful-ok
674	EXPECT job-state OF-TYPE unknown|enum IN-GROUP job-attributes-tag COUNT 1 WITH-VALUE >6 REPEAT-NO-MATCH REPEAT-LIMIT 30
675	DISPLAY job-state
676
677	# PWG 5100.14 - Table 9 - Job Description attributes
678	EXPECT compression-supplied OF-TYPE keyword IN-GROUP job-attributes-tag COUNT 1 WITH-VALUE "none"
679	EXPECT date-time-at-completed OF-TYPE dateTime|no-value IN-GROUP job-attributes-tag COUNT 1
680	EXPECT date-time-at-creation OF-TYPE dateTime IN-GROUP job-attributes-tag COUNT 1
681	EXPECT date-time-at-processing OF-TYPE dateTime|no-value IN-GROUP job-attributes-tag COUNT 1
682	EXPECT document-format-supplied OF-TYPE mimeMediaType|no-value IN-GROUP job-attributes-tag COUNT 1 WITH-VALUE "image/jpeg"
683	EXPECT ?document-format-version-supplied OF-TYPE text IN-GROUP job-attributes-tag COUNT 1 WITH-VALUE ""
684	EXPECT document-name-supplied OF-TYPE name IN-GROUP job-attributes-tag COUNT 1 WITH-VALUE "document-color.jpg"
685	EXPECT job-id OF-TYPE integer IN-GROUP job-attributes-tag COUNT 1 WITH-VALUE $PRINT_JOB_ID
686	EXPECT job-impressions OF-TYPE integer|no-value IN-GROUP job-attributes-tag COUNT 1 WITH-VALUE >-1
687	EXPECT job-impressions-completed OF-TYPE integer IN-GROUP job-attributes-tag COUNT 1 WITH-VALUE >-1
688	EXPECT job-name OF-TYPE name IN-GROUP job-attributes-tag COUNT 1 WITH-VALUE "job-color.jpg"
689	EXPECT job-originating-user-name OF-TYPE name IN-GROUP job-attributes-tag COUNT 1
690	EXPECT job-printer-up-time OF-TYPE integer IN-GROUP job-attributes-tag COUNT 1 WITH-VALUE >-1
691	EXPECT job-printer-uri OF-TYPE uri IN-GROUP job-attributes-tag COUNT 1 WITH-VALUE "$uri"
692	EXPECT job-state OF-TYPE unknown|enum IN-GROUP job-attributes-tag COUNT 1 WITH-VALUE >2,<10
693	EXPECT job-state-message OF-TYPE text IN-GROUP job-attributes-tag COUNT 1
694	EXPECT job-state-reasons OF-TYPE keyword IN-GROUP job-attributes-tag
695	EXPECT job-uri OF-TYPE uri IN-GROUP job-attributes-tag COUNT 1 WITH-VALUE "$IPP_URI_SCHEME"
696	EXPECT job-uuid OF-TYPE uri IN-GROUP job-attributes-tag COUNT 1 WITH-VALUE "$UUID_URI"
697	EXPECT time-at-completed OF-TYPE no-value|integer IN-GROUP job-attributes-tag COUNT 1 WITH-VALUE >-1
698	EXPECT time-at-creation OF-TYPE integer IN-GROUP job-attributes-tag COUNT 1 WITH-VALUE >-1
699	EXPECT time-at-processing OF-TYPE no-value|integer IN-GROUP job-attributes-tag COUNT 1 WITH-VALUE >-1
700
701	# PWG 5100.15 - Table 8 - Job Template attributes
702	EXPECT ?copies OF-TYPE integer IN-GROUP job-attributes-tag COUNT 1 WITH-VALUE "1"
703	EXPECT ?feed-orientation OF-TYPE enum IN-GROUP job-attributes-tag COUNT 1
704	EXPECT ?finishings OF-TYPE enum IN-GROUP job-attributes-tag
705	EXPECT ?job-account-id OF-TYPE name IN-GROUP job-attributes-tag COUNT 1
706	EXPECT ?job-accounting-user-id OF-TYPE name IN-GROUP job-attributes-tag COUNT 1
707	EXPECT media OF-TYPE keyword IN-GROUP job-attributes-tag COUNT 1 WITH-VALUE "$DEFAULT_MEDIA"
708	EXPECT !media-col
709	EXPECT ?multiple-document-handling OF-TYPE keyword IN-GROUP job-attributes-tag COUNT 1
710	EXPECT ?orientation-requested OF-TYPE enum IN-GROUP job-attributes-tag COUNT 1
711	EXPECT ?output-bin OF-TYPE keyword|name IN-GROUP job-attributes-tag COUNT 1 WITH-VALUE "$DEFAULT_OUTPUT_BIN"
712	EXPECT !page-ranges
713	EXPECT print-color-mode OF-TYPE keyword IN-GROUP job-attributes-tag COUNT 1 WITH-VALUE "$DEFAULT_PRINT_COLOR_MODE"
714	EXPECT print-content-optimize OF-TYPE keyword IN-GROUP job-attributes-tag COUNT 1 WITH-VALUE "$DEFAULT_PRINT_CONTENT_OPTIMIZE"
715	EXPECT print-quality OF-TYPE enum IN-GROUP job-attributes-tag COUNT 1 WITH-VALUE $DEFAULT_PRINT_QUALITY
716	EXPECT print-rendering-intent OF-TYPE keyword IN-GROUP job-attributes-tag COUNT 1 WITH-VALUE "$DEFAULT_PRINT_RENDERING_INTENT"
717	EXPECT printer-resolution OF-TYPE resolution IN-GROUP job-attributes-tag COUNT 1 WITH-VALUE "$DEFAULT_PRINTER_RESOLUTION"
718	EXPECT sides OF-TYPE keyword IN-GROUP job-attributes-tag COUNT 1 WITH-VALUE "one-sided"
719}
720
721
722# Test Get-Jobs operation
723#
724# Required by: RFC 2911 section 3.2.6
725{
726	NAME "I-17. Get-Jobs Operation (which-jobs=completed)"
727	OPERATION Get-Jobs
728	GROUP operation-attributes-tag
729	ATTR charset attributes-charset utf-8
730	ATTR naturalLanguage attributes-natural-language en
731	ATTR uri printer-uri $uri
732	ATTR name requesting-user-name $user
733	ATTR keyword which-jobs completed
734
735	STATUS successful-ok
736
737	# TODO: Use EXPECT-ALL/ANY syntax to check for job that was just completed
738	EXPECT job-id OF-TYPE integer IN-GROUP job-attributes-tag COUNT 1 WITH-VALUE >0
739	EXPECT job-uri OF-TYPE uri IN-GROUP job-attributes-tag COUNT 1 WITH-VALUE "$IPP_URI_SCHEME"
740	EXPECT !job-name
741	EXPECT !job-state
742}
743
744
745# Test Get-Jobs operation
746#
747# Required by: RFC 2911 section 3.2.6
748{
749	NAME "I-18. Get-Jobs Operation (which-jobs, requested-attributes)"
750	OPERATION Get-Jobs
751	GROUP operation-attributes-tag
752	ATTR charset attributes-charset utf-8
753	ATTR naturalLanguage attributes-natural-language en
754	ATTR uri printer-uri $uri
755	ATTR name requesting-user-name $user
756	ATTR keyword requested-attributes all
757	ATTR keyword which-jobs completed
758
759	STATUS successful-ok
760
761	# PWG 5100.14 - Table 9 - Job Description attributes
762	EXPECT compression-supplied OF-TYPE keyword IN-GROUP job-attributes-tag COUNT 1
763	EXPECT date-time-at-completed OF-TYPE dateTime|no-value IN-GROUP job-attributes-tag COUNT 1
764	EXPECT date-time-at-creation OF-TYPE dateTime IN-GROUP job-attributes-tag COUNT 1
765	EXPECT date-time-at-processing OF-TYPE dateTime|no-value IN-GROUP job-attributes-tag COUNT 1
766	EXPECT document-format-supplied OF-TYPE mimeMediaType|no-value IN-GROUP job-attributes-tag COUNT 1
767	EXPECT ?document-format-version-supplied OF-TYPE text IN-GROUP job-attributes-tag COUNT 1
768	EXPECT document-name-supplied OF-TYPE name IN-GROUP job-attributes-tag COUNT 1
769	EXPECT job-id OF-TYPE integer IN-GROUP job-attributes-tag COUNT 1
770	EXPECT job-impressions OF-TYPE integer|no-value IN-GROUP job-attributes-tag COUNT 1 WITH-VALUE >-1
771	EXPECT job-impressions-completed OF-TYPE integer IN-GROUP job-attributes-tag COUNT 1 WITH-VALUE >-1
772	EXPECT job-name OF-TYPE name IN-GROUP job-attributes-tag COUNT 1
773	EXPECT job-originating-user-name OF-TYPE name IN-GROUP job-attributes-tag COUNT 1
774	EXPECT job-printer-up-time OF-TYPE integer IN-GROUP job-attributes-tag COUNT 1 WITH-VALUE >-1
775	EXPECT job-printer-uri OF-TYPE uri IN-GROUP job-attributes-tag COUNT 1 WITH-VALUE "$uri"
776	EXPECT job-state OF-TYPE unknown|enum IN-GROUP job-attributes-tag COUNT 1 WITH-VALUE >6,<10
777	EXPECT job-state-message OF-TYPE text IN-GROUP job-attributes-tag COUNT 1
778	EXPECT job-state-reasons OF-TYPE keyword IN-GROUP job-attributes-tag
779	EXPECT job-uri OF-TYPE uri IN-GROUP job-attributes-tag COUNT 1 WITH-VALUE "$IPP_URI_SCHEME"
780	EXPECT job-uuid OF-TYPE uri IN-GROUP job-attributes-tag COUNT 1 WITH-VALUE "$UUID_URI"
781	EXPECT time-at-completed OF-TYPE no-value|integer IN-GROUP job-attributes-tag COUNT 1 WITH-VALUE >-1
782	EXPECT time-at-creation OF-TYPE integer IN-GROUP job-attributes-tag COUNT 1 WITH-VALUE >-1
783	EXPECT time-at-processing OF-TYPE no-value|integer IN-GROUP job-attributes-tag COUNT 1 WITH-VALUE >-1
784
785	# PWG 5100.15 - Table 8 - Job Template attributes
786	EXPECT ?copies OF-TYPE integer IN-GROUP job-attributes-tag COUNT 1
787	EXPECT ?feed-orientation OF-TYPE enum IN-GROUP job-attributes-tag COUNT 1
788	EXPECT ?finishings OF-TYPE enum IN-GROUP job-attributes-tag
789	EXPECT ?job-account-id OF-TYPE name IN-GROUP job-attributes-tag COUNT 1
790	EXPECT ?job-accounting-user-id OF-TYPE name IN-GROUP job-attributes-tag COUNT 1
791	EXPECT ?media OF-TYPE keyword|name IN-GROUP job-attributes-tag COUNT 1
792	EXPECT ?media-col OF-TYPE collection IN-GROUP job-attributes-tag COUNT 1
793	EXPECT ?multiple-document-handling OF-TYPE keyword IN-GROUP job-attributes-tag COUNT 1
794	EXPECT ?orientation-requested OF-TYPE enum IN-GROUP job-attributes-tag COUNT 1
795	EXPECT ?output-bin OF-TYPE keyword|name IN-GROUP job-attributes-tag COUNT 1
796	EXPECT ?page-ranges OF-TYPE rangeOfInteger IN-GROUP job-attributes-tag
797	EXPECT ?print-color-mode OF-TYPE keyword IN-GROUP job-attributes-tag COUNT 1
798	EXPECT ?print-content-optimize OF-TYPE keyword IN-GROUP job-attributes-tag COUNT 1
799	EXPECT ?print-quality OF-TYPE enum IN-GROUP job-attributes-tag COUNT 1
800	EXPECT ?print-rendering-intent OF-TYPE keyword IN-GROUP job-attributes-tag COUNT 1
801	EXPECT ?printer-resolution OF-TYPE resolution IN-GROUP job-attributes-tag COUNT 1
802	EXPECT ?sides OF-TYPE keyword IN-GROUP job-attributes-tag COUNT 1
803}
804
805
806# Test Cancel-Job operation
807#
808# Required by: RFC 2911 section 3.3.3
809{
810	NAME "I-19. Cancel-Job Operation (completed job)"
811	OPERATION Cancel-Job
812	GROUP operation-attributes-tag
813	ATTR charset attributes-charset utf-8
814	ATTR naturalLanguage attributes-natural-language en
815	ATTR uri printer-uri $uri
816	ATTR integer job-id $PRINT_JOB_ID
817	ATTR name requesting-user-name $user
818
819	STATUS client-error-not-possible
820}
821
822
823# Test Print-Job operation
824#
825# Required by: RFC 2911 section 3.2.1
826{
827	NAME "I-20. Print-Job Operation (color.jpg)"
828	OPERATION Print-Job
829	GROUP operation-attributes-tag
830	ATTR charset attributes-charset utf-8
831	ATTR naturalLanguage attributes-natural-language en
832	ATTR uri printer-uri $uri
833	ATTR name requesting-user-name $user
834	ATTR name job-name "job2-color.jpg"
835	ATTR boolean ipp-attribute-fidelity false
836	ATTR name document-name "document2-color.jpg"
837	ATTR keyword compression none
838	ATTR mimeMediaType document-format "image/jpeg"
839
840	GROUP job-attributes-tag
841	ATTR keyword media "$DEFAULT_MEDIA"
842	ATTR keyword print-color-mode "$DEFAULT_PRINT_COLOR_MODE"
843	ATTR keyword print-content-optimize "$DEFAULT_PRINT_CONTENT_OPTIMIZE"
844	ATTR keyword print-rendering-intent "$DEFAULT_PRINT_RENDERING_INTENT"
845	ATTR enum print-quality $DEFAULT_PRINT_QUALITY
846	ATTR resolution printer-resolution $DEFAULT_PRINTER_RESOLUTION
847	ATTR keyword sides "one-sided"
848
849	FILE "color.jpg"
850
851	STATUS successful-ok
852	STATUS server-error-job-canceled
853	STATUS server-error-busy REPEAT-MATCH REPEAT-LIMIT 30
854
855	EXPECT job-uri OF-TYPE uri COUNT 1 IN-GROUP job-attributes-tag WITH-VALUE "$IPP_URI_SCHEME"
856
857	EXPECT job-id OF-TYPE integer COUNT 1 IN-GROUP job-attributes-tag WITH-VALUE >0
858	EXPECT job-id DEFINE-VALUE PRINT_JOB2_ID
859
860	EXPECT job-state OF-TYPE unknown|enum COUNT 1 IN-GROUP job-attributes-tag WITH-VALUE 3,4,5,6,7,8,9
861
862	EXPECT job-state-message OF-TYPE text IN-GROUP job-attributes-tag
863
864	EXPECT job-state-reasons OF-TYPE keyword IN-GROUP job-attributes-tag
865}
866
867
868# Test Cancel-Job operation
869#
870# Required by: RFC 2911 section 3.3.3
871{
872	NAME "I-21. Cancel-Job Operation (pending/processing job)"
873	OPERATION Cancel-Job
874	GROUP operation-attributes-tag
875	ATTR charset attributes-charset utf-8
876	ATTR naturalLanguage attributes-natural-language en
877	ATTR uri printer-uri $uri
878	ATTR integer job-id $PRINT_JOB2_ID
879	ATTR name requesting-user-name $user
880
881	STATUS successful-ok
882	STATUS client-error-not-possible
883}
884
885
886# Test Get-Job-Attributes operation
887#
888# Required by: RFC 2911 section 3.3.4
889{
890	NAME "I-22. Get-Job-Attributes Operation"
891	OPERATION Get-Job-Attributes
892	GROUP operation-attributes-tag
893	ATTR charset attributes-charset utf-8
894	ATTR naturalLanguage attributes-natural-language en
895	ATTR uri printer-uri $uri
896	ATTR integer job-id $PRINT_JOB2_ID
897	ATTR name requesting-user-name $user
898
899	STATUS successful-ok
900
901	# PWG 5100.14 - Table 9 - Job Description attributes
902	EXPECT compression-supplied OF-TYPE keyword IN-GROUP job-attributes-tag COUNT 1 WITH-VALUE "none"
903	EXPECT date-time-at-completed OF-TYPE dateTime|no-value IN-GROUP job-attributes-tag COUNT 1
904	EXPECT date-time-at-creation OF-TYPE dateTime IN-GROUP job-attributes-tag COUNT 1
905	EXPECT date-time-at-processing OF-TYPE dateTime|no-value IN-GROUP job-attributes-tag COUNT 1
906	EXPECT document-format-supplied OF-TYPE mimeMediaType|no-value IN-GROUP job-attributes-tag COUNT 1 WITH-VALUE "image/jpeg"
907	EXPECT ?document-format-version-supplied OF-TYPE text IN-GROUP job-attributes-tag COUNT 1 WITH-VALUE ""
908	EXPECT document-name-supplied OF-TYPE name IN-GROUP job-attributes-tag COUNT 1 WITH-VALUE "document2-color.jpg"
909	EXPECT job-id OF-TYPE integer IN-GROUP job-attributes-tag COUNT 1 WITH-VALUE $PRINT_JOB2_ID
910	EXPECT job-impressions OF-TYPE integer|no-value IN-GROUP job-attributes-tag COUNT 1 WITH-VALUE >-1
911	EXPECT job-impressions-completed OF-TYPE integer IN-GROUP job-attributes-tag COUNT 1 WITH-VALUE >-1
912	EXPECT job-name OF-TYPE name IN-GROUP job-attributes-tag COUNT 1 WITH-VALUE "job2-color.jpg"
913	EXPECT job-originating-user-name OF-TYPE name IN-GROUP job-attributes-tag COUNT 1
914	EXPECT job-printer-up-time OF-TYPE integer IN-GROUP job-attributes-tag COUNT 1 WITH-VALUE >-1
915	EXPECT job-printer-uri OF-TYPE uri IN-GROUP job-attributes-tag COUNT 1 WITH-VALUE "$uri"
916	EXPECT job-state OF-TYPE unknown|enum IN-GROUP job-attributes-tag COUNT 1 WITH-VALUE >6,<10
917	EXPECT job-state-message OF-TYPE text IN-GROUP job-attributes-tag COUNT 1
918	EXPECT job-state-reasons OF-TYPE keyword IN-GROUP job-attributes-tag
919	EXPECT job-uri OF-TYPE uri IN-GROUP job-attributes-tag COUNT 1 WITH-VALUE "$IPP_URI_SCHEME"
920	EXPECT job-uuid OF-TYPE uri IN-GROUP job-attributes-tag COUNT 1 WITH-VALUE "$UUID_URI"
921	EXPECT time-at-completed OF-TYPE no-value|integer IN-GROUP job-attributes-tag COUNT 1 WITH-VALUE >-1
922	EXPECT time-at-creation OF-TYPE integer IN-GROUP job-attributes-tag COUNT 1 WITH-VALUE >-1
923	EXPECT time-at-processing OF-TYPE no-value|integer IN-GROUP job-attributes-tag COUNT 1 WITH-VALUE >-1
924
925	# PWG 5100.15 - Table 8 - Job Template attributes
926	EXPECT ?copies OF-TYPE integer IN-GROUP job-attributes-tag COUNT 1 WITH-VALUE "1"
927	EXPECT ?feed-orientation OF-TYPE enum IN-GROUP job-attributes-tag COUNT 1
928	EXPECT ?finishings OF-TYPE enum IN-GROUP job-attributes-tag
929	EXPECT ?job-account-id OF-TYPE name IN-GROUP job-attributes-tag COUNT 1
930	EXPECT ?job-accounting-user-id OF-TYPE name IN-GROUP job-attributes-tag COUNT 1
931	EXPECT media OF-TYPE keyword IN-GROUP job-attributes-tag COUNT 1 WITH-VALUE "$DEFAULT_MEDIA"
932	EXPECT !media-col
933	EXPECT ?multiple-document-handling OF-TYPE keyword IN-GROUP job-attributes-tag COUNT 1
934	EXPECT ?orientation-requested OF-TYPE enum IN-GROUP job-attributes-tag COUNT 1
935	EXPECT ?output-bin OF-TYPE keyword|name IN-GROUP job-attributes-tag COUNT 1 WITH-VALUE "$DEFAULT_OUTPUT_BIN"
936	EXPECT !page-ranges
937	EXPECT print-color-mode OF-TYPE keyword IN-GROUP job-attributes-tag COUNT 1 WITH-VALUE "$DEFAULT_PRINT_COLOR_MODE"
938	EXPECT print-content-optimize OF-TYPE keyword IN-GROUP job-attributes-tag COUNT 1 WITH-VALUE "$DEFAULT_PRINT_CONTENT_OPTIMIZE"
939	EXPECT print-quality OF-TYPE enum IN-GROUP job-attributes-tag COUNT 1 WITH-VALUE $DEFAULT_PRINT_QUALITY
940	EXPECT print-rendering-intent OF-TYPE keyword IN-GROUP job-attributes-tag COUNT 1 WITH-VALUE "$DEFAULT_PRINT_RENDERING_INTENT"
941	EXPECT printer-resolution OF-TYPE resolution IN-GROUP job-attributes-tag COUNT 1 WITH-VALUE "$DEFAULT_PRINTER_RESOLUTION"
942	EXPECT sides OF-TYPE keyword IN-GROUP job-attributes-tag COUNT 1 WITH-VALUE "one-sided"
943}
944
945
946# Test Create-Job and Send-Document operations
947#
948# Defined by: RFC 2911 section 3.2.4 and 3.3.1
949{
950	NAME "I-23. Create-Job Operation"
951	OPERATION Create-Job
952	GROUP operation-attributes-tag
953	ATTR charset attributes-charset utf-8
954	ATTR naturalLanguage attributes-natural-language en
955	ATTR uri printer-uri $uri
956	ATTR name requesting-user-name $user
957	ATTR name job-name "job3-color.jpg"
958	ATTR boolean ipp-attribute-fidelity false
959
960	GROUP job-attributes-tag
961	ATTR keyword media "$DEFAULT_MEDIA"
962	ATTR keyword print-color-mode "$DEFAULT_PRINT_COLOR_MODE"
963	ATTR keyword print-content-optimize "$DEFAULT_PRINT_CONTENT_OPTIMIZE"
964	ATTR keyword print-rendering-intent "$DEFAULT_PRINT_RENDERING_INTENT"
965	ATTR enum print-quality $DEFAULT_PRINT_QUALITY
966	ATTR resolution printer-resolution $DEFAULT_PRINTER_RESOLUTION
967	ATTR keyword sides "one-sided"
968
969	STATUS successful-ok
970	STATUS server-error-job-canceled
971	STATUS server-error-busy REPEAT-MATCH REPEAT-LIMIT 30
972
973	EXPECT job-uri OF-TYPE uri COUNT 1 IN-GROUP job-attributes-tag WITH-VALUE "$IPP_URI_SCHEME"
974
975	EXPECT job-id OF-TYPE integer COUNT 1 IN-GROUP job-attributes-tag WITH-VALUE >0
976	EXPECT job-id DEFINE-VALUE PRINT_JOB3_ID
977
978	EXPECT job-state OF-TYPE unknown|enum COUNT 1 IN-GROUP job-attributes-tag WITH-VALUE 3,4,5,6
979
980	EXPECT job-state-message OF-TYPE text IN-GROUP job-attributes-tag
981
982	EXPECT job-state-reasons OF-TYPE keyword IN-GROUP job-attributes-tag
983}
984
985{
986	SKIP-IF-NOT-DEFINED PRINT_JOB3_ID
987
988	NAME "I-24. Send-Document Operation (color.jpg)"
989	OPERATION Send-Document
990	GROUP operation-attributes-tag
991	ATTR charset attributes-charset utf-8
992	ATTR naturalLanguage attributes-natural-language en
993	ATTR uri printer-uri $uri
994	ATTR integer job-id $PRINT_JOB3_ID
995	ATTR name requesting-user-name $user
996	ATTR boolean last-document true
997	ATTR name document-name "document3-color.jpg"
998	ATTR keyword compression none
999	ATTR mimeMediaType document-format "image/jpeg"
1000
1001	FILE "color.jpg"
1002
1003	STATUS successful-ok
1004	STATUS server-error-job-canceled
1005}
1006
1007
1008# Wait for job to complete...
1009{
1010	SKIP-IF-NOT-DEFINED PRINT_JOB3_ID
1011
1012	NAME "I-25. Get-Job-Attributes Until Job Complete"
1013	OPERATION Get-Job-Attributes
1014	GROUP operation-attributes-tag
1015	ATTR charset attributes-charset utf-8
1016	ATTR naturalLanguage attributes-natural-language en
1017	ATTR uri printer-uri $uri
1018	ATTR integer job-id $PRINT_JOB3_ID
1019	ATTR name requesting-user-name $user
1020
1021	STATUS successful-ok
1022	EXPECT job-state OF-TYPE unknown|enum IN-GROUP job-attributes-tag COUNT 1 WITH-VALUE >6 REPEAT-NO-MATCH REPEAT-LIMIT 30
1023	DISPLAY job-state
1024
1025	# PWG 5100.14 - Table 9 - Job Description attributes
1026	EXPECT compression-supplied OF-TYPE keyword IN-GROUP job-attributes-tag COUNT 1 WITH-VALUE "none"
1027	EXPECT date-time-at-completed OF-TYPE dateTime|no-value IN-GROUP job-attributes-tag COUNT 1
1028	EXPECT date-time-at-creation OF-TYPE dateTime IN-GROUP job-attributes-tag COUNT 1
1029	EXPECT date-time-at-processing OF-TYPE dateTime|no-value IN-GROUP job-attributes-tag COUNT 1
1030	EXPECT document-format-supplied OF-TYPE mimeMediaType|no-value IN-GROUP job-attributes-tag COUNT 1 WITH-VALUE "image/jpeg"
1031	EXPECT ?document-format-version-supplied OF-TYPE text IN-GROUP job-attributes-tag COUNT 1 WITH-VALUE ""
1032	EXPECT document-name-supplied OF-TYPE name IN-GROUP job-attributes-tag COUNT 1 WITH-VALUE "document3-color.jpg"
1033	EXPECT job-id OF-TYPE integer IN-GROUP job-attributes-tag COUNT 1 WITH-VALUE $PRINT_JOB3_ID
1034	EXPECT job-impressions OF-TYPE integer|no-value IN-GROUP job-attributes-tag COUNT 1 WITH-VALUE >-1
1035	EXPECT job-impressions-completed OF-TYPE integer IN-GROUP job-attributes-tag COUNT 1 WITH-VALUE >-1
1036	EXPECT job-name OF-TYPE name IN-GROUP job-attributes-tag COUNT 1 WITH-VALUE "job3-color.jpg"
1037	EXPECT job-originating-user-name OF-TYPE name IN-GROUP job-attributes-tag COUNT 1
1038	EXPECT job-printer-up-time OF-TYPE integer IN-GROUP job-attributes-tag COUNT 1 WITH-VALUE >-1
1039	EXPECT job-printer-uri OF-TYPE uri IN-GROUP job-attributes-tag COUNT 1 WITH-VALUE "$uri"
1040	EXPECT job-state OF-TYPE unknown|enum IN-GROUP job-attributes-tag COUNT 1 WITH-VALUE >2,<10
1041	EXPECT job-state-message OF-TYPE text IN-GROUP job-attributes-tag COUNT 1
1042	EXPECT job-state-reasons OF-TYPE keyword IN-GROUP job-attributes-tag
1043	EXPECT job-uri OF-TYPE uri IN-GROUP job-attributes-tag COUNT 1 WITH-VALUE "$IPP_URI_SCHEME"
1044	EXPECT job-uuid OF-TYPE uri IN-GROUP job-attributes-tag COUNT 1 WITH-VALUE "$UUID_URI"
1045	EXPECT time-at-completed OF-TYPE no-value|integer IN-GROUP job-attributes-tag COUNT 1 WITH-VALUE >-1
1046	EXPECT time-at-creation OF-TYPE integer IN-GROUP job-attributes-tag COUNT 1 WITH-VALUE >-1
1047	EXPECT time-at-processing OF-TYPE no-value|integer IN-GROUP job-attributes-tag COUNT 1 WITH-VALUE >-1
1048
1049	# PWG 5100.15 - Table 8 - Job Template attributes
1050	EXPECT ?copies OF-TYPE integer IN-GROUP job-attributes-tag COUNT 1 WITH-VALUE "1"
1051	EXPECT ?feed-orientation OF-TYPE enum IN-GROUP job-attributes-tag COUNT 1
1052	EXPECT ?finishings OF-TYPE enum IN-GROUP job-attributes-tag
1053	EXPECT ?job-account-id OF-TYPE name IN-GROUP job-attributes-tag COUNT 1
1054	EXPECT ?job-accounting-user-id OF-TYPE name IN-GROUP job-attributes-tag COUNT 1
1055	EXPECT media OF-TYPE keyword IN-GROUP job-attributes-tag COUNT 1 WITH-VALUE "$DEFAULT_MEDIA"
1056	EXPECT !media-col
1057	EXPECT ?multiple-document-handling OF-TYPE keyword IN-GROUP job-attributes-tag COUNT 1
1058	EXPECT ?orientation-requested OF-TYPE enum IN-GROUP job-attributes-tag COUNT 1
1059	EXPECT ?output-bin OF-TYPE keyword|name IN-GROUP job-attributes-tag COUNT 1 WITH-VALUE "$DEFAULT_OUTPUT_BIN"
1060	EXPECT !page-ranges
1061	EXPECT print-color-mode OF-TYPE keyword IN-GROUP job-attributes-tag COUNT 1 WITH-VALUE "$DEFAULT_PRINT_COLOR_MODE"
1062	EXPECT print-content-optimize OF-TYPE keyword IN-GROUP job-attributes-tag COUNT 1 WITH-VALUE "$DEFAULT_PRINT_CONTENT_OPTIMIZE"
1063	EXPECT print-quality OF-TYPE enum IN-GROUP job-attributes-tag COUNT 1 WITH-VALUE $DEFAULT_PRINT_QUALITY
1064	EXPECT print-rendering-intent OF-TYPE keyword IN-GROUP job-attributes-tag COUNT 1 WITH-VALUE "$DEFAULT_PRINT_RENDERING_INTENT"
1065	EXPECT printer-resolution OF-TYPE resolution IN-GROUP job-attributes-tag COUNT 1 WITH-VALUE "$DEFAULT_PRINTER_RESOLUTION"
1066	EXPECT sides OF-TYPE keyword IN-GROUP job-attributes-tag COUNT 1 WITH-VALUE "one-sided"
1067}
1068
1069
1070# Test 'media-empty' reason
1071{
1072	PAUSE "Remove media from printer."
1073
1074	NAME "I-26. Media Empty: Printer correctly reports 'media-empty' when at least one removable tray is empty (MUST NOT be a manual feed or bypass tray)"
1075	OPERATION Get-Printer-Attributes
1076	GROUP operation-attributes-tag
1077	ATTR charset attributes-charset utf-8
1078	ATTR naturalLanguage attributes-natural-language en
1079	ATTR uri printer-uri $uri
1080	ATTR name requesting-user-name $user
1081	ATTR keyword requested-attributes "printer-state-reasons"
1082
1083	STATUS successful-ok
1084
1085	EXPECT printer-state-reasons OF-TYPE keyword IN-GROUP printer-attributes-tag WITH-VALUE "/^media-empty/"
1086	EXPECT !printer-state
1087}
1088
1089
1090# Test Print-Job operation
1091#
1092# Required by: RFC 2911 section 3.2.1
1093{
1094	NAME "I-27. Print-Job Operation (color.jpg)"
1095	OPERATION Print-Job
1096	GROUP operation-attributes-tag
1097	ATTR charset attributes-charset utf-8
1098	ATTR naturalLanguage attributes-natural-language en
1099	ATTR uri printer-uri $uri
1100	ATTR name requesting-user-name $user
1101	ATTR name job-name "job4-color.jpg"
1102	ATTR boolean ipp-attribute-fidelity false
1103	ATTR name document-name "document4-color.jpg"
1104	ATTR keyword compression none
1105	ATTR mimeMediaType document-format "image/jpeg"
1106
1107	GROUP job-attributes-tag
1108	ATTR keyword media "$DEFAULT_MEDIA"
1109	ATTR keyword print-color-mode "$DEFAULT_PRINT_COLOR_MODE"
1110	ATTR keyword print-content-optimize "$DEFAULT_PRINT_CONTENT_OPTIMIZE"
1111	ATTR keyword print-rendering-intent "$DEFAULT_PRINT_RENDERING_INTENT"
1112	ATTR enum print-quality $DEFAULT_PRINT_QUALITY
1113	ATTR resolution printer-resolution $DEFAULT_PRINTER_RESOLUTION
1114	ATTR keyword sides "one-sided"
1115
1116	FILE "color.jpg"
1117
1118	STATUS successful-ok
1119	STATUS server-error-job-canceled
1120	STATUS server-error-busy REPEAT-MATCH REPEAT-LIMIT 30
1121
1122	EXPECT job-uri OF-TYPE uri COUNT 1 IN-GROUP job-attributes-tag WITH-VALUE "$IPP_URI_SCHEME"
1123
1124	EXPECT job-id OF-TYPE integer COUNT 1 IN-GROUP job-attributes-tag WITH-VALUE >0
1125	EXPECT job-id DEFINE-VALUE PRINT_JOB4_ID
1126
1127	EXPECT job-state OF-TYPE unknown|enum COUNT 1 IN-GROUP job-attributes-tag WITH-VALUE 3,4,5,6,7,8,9
1128	EXPECT job-state WITH-VALUE 7,8,9 DEFINE-MATCH PRINT_JOB_COMPLETED
1129
1130	EXPECT job-state-message OF-TYPE text IN-GROUP job-attributes-tag
1131
1132	EXPECT job-state-reasons OF-TYPE keyword IN-GROUP job-attributes-tag
1133}
1134
1135
1136# Test 'media-needed' reason
1137{
1138	NAME "I-28. Media Needed: Printer correctly reports 'media-needed' when a job is queued."
1139	OPERATION Get-Printer-Attributes
1140	GROUP operation-attributes-tag
1141	ATTR charset attributes-charset utf-8
1142	ATTR naturalLanguage attributes-natural-language en
1143	ATTR uri printer-uri $uri
1144	ATTR name requesting-user-name $user
1145	ATTR keyword requested-attributes "printer-state-reasons"
1146
1147	STATUS successful-ok
1148
1149	EXPECT printer-state-reasons OF-TYPE keyword IN-GROUP printer-attributes-tag WITH-VALUE "/^media-needed/"
1150	EXPECT !printer-state
1151}
1152
1153
1154
1155
1156#
1157# End of "$Id: ipp-tests.test 12131 2014-08-28 23:38:16Z msweet $".
1158#
1159