Skip to content

Commit 2c506ed

Browse files
committed
Update IPP/2.1 tests.
1 parent 6128211 commit 2c506ed

1 file changed

Lines changed: 159 additions & 68 deletions

File tree

examples/ipp-2.1.test

Lines changed: 159 additions & 68 deletions
Original file line numberDiff line numberDiff line change
@@ -12,76 +12,167 @@
1212
#
1313
# ./ipptool -V 2.1 -f filename -t printer-uri ipp-2.1.test
1414
#
15+
# Options:
16+
#
17+
# -d NOPRINT=1 Disable the print tests.
18+
#
1519

16-
# Do all of the IPP/1.1 and IPP/2.0 tests as an IPP/2.1 client
17-
INCLUDE "ipp-2.0.test"
1820

21+
# (REQUIRED) PWG 5101.1-2023: Media Standardized Names v2.1 (MSN)
22+
DEFINE REQUIRE_MSN 1
1923

20-
# Test required printer description attribute support.
21-
#
22-
# Required by: PWG 5100.12 section 6.3
24+
# (REQUIRED) IETF STD 92: Internet Printing Protocol/1.1
25+
INCLUDE "ipp-1.1.test"
26+
27+
# (REQUIRED) PWG 5100.1-2022: IPP Finishings v3.0 (MSN)
28+
DEFINE REQUIRE_FIN 1
29+
INCLUDE "pwg5100.1.test"
30+
31+
# (REQUIRED) PWG 5100.2-2001: IPP "output-bin" Attribute
32+
DEFINE REQUIRE_OUTPUTBIN 1
33+
INCLUDE "pwg5100.2.test"
34+
35+
# (RECOMMENDED) PWG 5100.5-2024: IPP Document Object v1.2 (DOCOBJECT)
36+
INCLUDE "pwg5100.5.test"
37+
38+
# (RECOMMENDED) PWG 5100.6-2003: IPP Page Overrides
39+
INCLUDE "pwg5100.6.test"
40+
41+
# (REQUIRED) PWG 5100.7-2023: IPP Job Extensions v2.1 (JOBEXT)
42+
DEFINE REQUIRE_JOBEXT 1
43+
INCLUDE "pwg5100.7.test"
44+
45+
# (RECOMMENDED) PWG 5100.8-2003: IPP "-actual" attributes
46+
INCLUDE "pwg5100.8.test"
47+
48+
# (REQUIRED) PWG 5100.9-2009: IPP Printer State Extensions v1.0 (STATE)
49+
DEFINE REQUIRE_STATE 1
50+
INCLUDE "pwg5100.9.test"
51+
52+
# (REQUIRED) PWG 5100.11-2024: IPP Enterprise Printing Extensions v2.0 (EPX)
53+
DEFINE REQUIRE_EPX 1
54+
INCLUDE "pwg5100.11.test"
55+
56+
# (REQUIRED) RFC 3380: IPP: Job and Printer Set Operations
57+
DEFINE REQUIRE_RFC3380 1
58+
INCLUDE "rfc3380.test"
59+
60+
# (REQUIRED) RFC 3995: IPP: Notifications and Subscriptions
61+
# (REQUIRED) RFC 3996: IPP: The 'ippget' Delivery Method for Event Notifications
62+
DEFINE REQUIRE_RFC3995 1
63+
DEFINE REQUIRE_RFC3996 1
64+
INCLUDE "rfc3995-3996.test"
65+
66+
# (REQUIRED) RFC 3998: IPP: Job and Printer Administrative Operations
67+
DEFINE REQUIRE_RFC3998 1
68+
INCLUDE "rfc3998.test"
69+
70+
# PWG 5100.12-2024: IPP/2.x Fourth Edition (for IPP/2.1)
2371
{
24-
NAME "PWG 5100.12 section 6.3 - Required Printer Description Attributes"
25-
OPERATION Get-Printer-Attributes
26-
GROUP operation-attributes-tag
27-
ATTR charset attributes-charset utf-8
28-
ATTR naturalLanguage attributes-natural-language en
29-
ATTR uri printer-uri $uri
30-
ATTR name requesting-user-name $user
31-
ATTR mimeMediaType document-format application/octet-stream
32-
33-
STATUS successful-ok
34-
35-
# Job template attributes
36-
EXPECT job-hold-until-default OF-TYPE keyword|name IN-GROUP printer-attributes-tag COUNT 1
37-
EXPECT job-hold-until-supported OF-TYPE keyword|name IN-GROUP printer-attributes-tag WITH-VALUE no-hold
38-
EXPECT job-priority-default OF-TYPE integer IN-GROUP printer-attributes-tag COUNT 1 WITH-VALUE >0,<101
39-
EXPECT job-priority-supported OF-TYPE integer IN-GROUP printer-attributes-tag COUNT 1 WITH-VALUE >0,<101
40-
EXPECT job-settable-attributes-supported OF-TYPE keyword IN-GROUP printer-attributes-tag
41-
EXPECT job-sheets-default OF-TYPE keyword|name IN-GROUP printer-attributes-tag
42-
EXPECT job-sheets-supported OF-TYPE keyword|name IN-GROUP printer-attributes-tag WITH-VALUE none
43-
EXPECT media-col-default OF-TYPE collection IN-GROUP printer-attributes-tag COUNT 1
44-
EXPECT media-col-supported OF-TYPE keyword IN-GROUP printer-attributes-tag
45-
EXPECT media-col-supported WITH-VALUE media-size
46-
EXPECT media-default OF-TYPE keyword|name IN-GROUP printer-attributes-tag COUNT 1
47-
EXPECT media-supported OF-TYPE keyword|name IN-GROUP printer-attributes-tag
48-
49-
# Subscription attributes
50-
EXPECT notify-events-default OF-TYPE keyword IN-GROUP printer-attributes-tag
51-
EXPECT notify-events-supported OF-TYPE keyword IN-GROUP printer-attributes-tag
52-
EXPECT notify-lease-duration-default OF-TYPE integer IN-GROUP printer-attributes-tag COUNT 1
53-
EXPECT notify-lease-duration-supported OF-TYPE integer|rangeOfInteger IN-GROUP printer-attributes-tag
54-
EXPECT notify-max-events-supported OF-TYPE integer IN-GROUP printer-attributes-tag COUNT 1 WITH-VALUE >1
55-
EXPECT notify-pull-method-supported OF-TYPE keyword IN-GROUP printer-attributes-tag WITH-VALUE ippget
56-
57-
# Printer description attributes
58-
EXPECT ippget-event-life OF-TYPE integer IN-GROUP printer-attributes-tag COUNT 1
59-
EXPECT multiple-operation-time-out OF-TYPE integer IN-GROUP printer-attributes-tag COUNT 1 WITH-VALUE >0
60-
61-
# Operations
62-
EXPECT operations-supported WITH-VALUE 0x0005 # Create-Job
63-
EXPECT operations-supported WITH-VALUE 0x0006 # Send-Document
64-
EXPECT operations-supported WITH-VALUE 0x000C # Hold-Job
65-
EXPECT operations-supported WITH-VALUE 0x000D # Release-Job
66-
EXPECT operations-supported WITH-VALUE 0x000E # Restart-Job
67-
EXPECT operations-supported WITH-VALUE 0x0010 # Pause-Printer
68-
EXPECT operations-supported WITH-VALUE 0x0011 # Resume-Printer
69-
EXPECT operations-supported WITH-VALUE 0x0012 # Purge-Jobs
70-
EXPECT operations-supported WITH-VALUE 0x0013 # Set-Printer-Attributes
71-
EXPECT operations-supported WITH-VALUE 0x0014 # Set-Job-Attributes
72-
EXPECT operations-supported WITH-VALUE 0x0015 # Get-Printer-Supported-Values
73-
EXPECT operations-supported WITH-VALUE 0x0016 # Create-Printer-Subscriptions
74-
EXPECT operations-supported WITH-VALUE 0x0018 # Get-Subscription-Attributes
75-
EXPECT operations-supported WITH-VALUE 0x0019 # Get-Subscriptions
76-
EXPECT operations-supported WITH-VALUE 0x001A # Renew-Subscription
77-
EXPECT operations-supported WITH-VALUE 0x001B # Cancel-Subscription
78-
EXPECT operations-supported WITH-VALUE 0x001C # Get-Notifications
79-
EXPECT operations-supported WITH-VALUE 0x0022 # Enable-Printer
80-
EXPECT operations-supported WITH-VALUE 0x0023 # Disable-Printer
81-
82-
EXPECT ?printer-alert OF-TYPE octetString IN-GROUP printer-attributes-tag
83-
EXPECT ?printer-alert-description OF-TYPE text IN-GROUP printer-attributes-tag SAME-COUNT-AS printer-alert
84-
EXPECT printer-settable-attributes-supported OF-TYPE keyword IN-GROUP printer-attributes-tag
85-
EXPECT printer-state-change-time OF-TYPE integer IN-GROUP printer-attributes-tag COUNT 1
86-
EXPECT printer-state-reasons OF-TYPE keyword IN-GROUP printer-attributes-tag
72+
NAME "PWG 5100.12-2024: Required Operations, Attributes, and Values"
73+
OPERATION Get-Printer-Attributes
74+
GROUP operation-attributes-tag
75+
ATTR charset attributes-charset utf-8
76+
ATTR naturalLanguage attributes-natural-language en
77+
ATTR uri printer-uri $uri
78+
ATTR name requesting-user-name $user
79+
ATTR mimeMediaType document-format application/octet-stream
80+
81+
STATUS successful-ok
82+
83+
# Baseline requirement/value
84+
EXPECT ipp-versions-supported OF-TYPE keyword IN-GROUP printer-attributes-tag WITH-VALUE "2.0"
85+
86+
# Figure out capabilities
87+
EXPECT color-supported OF-TYPE boolean IN-GROUP printer-attributes-tag COUNT 1 WITH-VALUE true DEFINE-MATCH PRINTER_IS_COLOR
88+
EXPECT job-hold-until-supported OF-TYPE keyword|name IN-GROUP printer-attributes-tag DEFINE-MATCH PRINTER_HAS_JOB_HOLD_UNTIL
89+
EXPECT job-priority-supported OF-TYPE integer IN-GROUP printer-attributes-tag DEFINE-MATCH PRINTER_HAS_JOB_PRIORITY
90+
EXPECT job-sheets-supported OF-TYPE keyword|name IN-GROUP printer-attributes-tag DEFINE-MATCH PRINTER_HAS_JOB_SHEETS
91+
EXPECT media-col-supported OF-TYPE keyword IN-GROUP printer-attributes-tag DEFINE-MATCH PRINTER_HAS_MEDIA_COL
92+
EXPECT output-bin-supported OF-TYPE keyword|name IN-GROUP printer-attributes-tag DEFINE-MATCH PRINTER_HAS_OUTPUT_BIN
93+
EXPECT print-content-optimize-supported OF-TYPE keyword|name IN-GROUP printer-attributes-tag DEFINE-MATCH PRINTER_HAS_PRINT_CONTENT_OPTIMIZE
94+
EXPECT sides-supported OF-TYPE keyword IN-GROUP printer-attributes-tag DEFINE-MATCH PRINTER_HAS_SIDES
95+
96+
# Table 2 - IPP Operations (IPP/2.0)
97+
EXPECT operations-supported OF-TYPE enum IN-GROUP printer-attributes-tag
98+
EXPECT operations-supported WITH-VALUE 0x002D # Cancel-Current-Job
99+
EXPECT operations-supported WITH-VALUE 0x0008 # Cancel-Job
100+
EXPECT operations-supported WITH-VALUE 0x0038 # Cancel-Jobs
101+
EXPECT operations-supported WITH-VALUE 0x0030 # Cancel-My-Jobs
102+
EXPECT operations-supported WITH-VALUE 0x003B # Close-Job
103+
EXPECT operations-supported WITH-VALUE 0x0005 # Create-Job
104+
EXPECT operations-supported WITH-VALUE 0x0016 # Create-Printer-Subscriptions
105+
EXPECT operations-supported WITH-VALUE 0x0023 # Disable-Printer
106+
EXPECT operations-supported WITH-VALUE 0x0022 # Enable-Printer
107+
EXPECT operations-supported WITH-VALUE 0x0009 # Get-Job-Attributes
108+
EXPECT operations-supported WITH-VALUE 0x000A # Get-Jobs
109+
EXPECT operations-supported WITH-VALUE 0x001C # Get-Notifications
110+
EXPECT operations-supported WITH-VALUE 0x000B # Get-Printer-Attributes
111+
EXPECT operations-supported WITH-VALUE 0x0015 # Get-Printer-Supported-Values
112+
EXPECT operations-supported WITH-VALUE 0x0018 # Get-Subscription-Attributes
113+
EXPECT operations-supported WITH-VALUE 0x0019 # Get-Subscriptions
114+
EXPECT operations-supported WITH-VALUE 0x0066 # Get-User-Printer-Attributes
115+
EXPECT operations-supported WITH-VALUE 0x000C # Hold-Job
116+
EXPECT operations-supported WITH-VALUE 0x0010 # Pause-Printer
117+
EXPECT operations-supported WITH-VALUE 0x0002 # Print-Job
118+
EXPECT operations-supported WITH-VALUE 0x000D # Release-Job
119+
EXPECT operations-supported WITH-VALUE 0x001A # Renew-Subscription
120+
EXPECT operations-supported WITH-VALUE 0x003A # Resubmit-Job
121+
EXPECT operations-supported WITH-VALUE 0x0011 # Resume-Printer
122+
EXPECT operations-supported WITH-VALUE 0x0006 # Send-Document
123+
EXPECT operations-supported WITH-VALUE 0x0014 # Set-Job-Attributes
124+
EXPECT operations-supported WITH-VALUE 0x0013 # Set-Printer-Attributes
125+
EXPECT operations-supported WITH-VALUE 0x0004 # Validate-Job
126+
127+
# Table 5 - Updated IPP Printer Description Attributes (IPP/2.0)
128+
EXPECT color-supported OF-TYPE boolean IN-GROUP printer-attributes-tag COUNT 1
129+
130+
EXPECT copies-default OF-TYPE integer IN-GROUP printer-attributes-tag COUNT 1 WITH-VALUE >0
131+
EXPECT copies-supported OF-TYPE rangeOfInteger IN-GROUP printer-attributes-tag
132+
133+
EXPECT job-hold-until-default OF-TYPE keyword|name IN-GROUP printer-attributes-tag COUNT 1 WITH-VALUE-FROM job-hold-until-supported
134+
EXPECT job-hold-until-supported OF-TYPE keyword|name IN-GROUP printer-attributes-tag
135+
EXPECT job-hold-until-supported WITH-VALUE indefinite
136+
EXPECT job-hold-until-supported WITH-VALUE no-hold
137+
138+
EXPECT job-priority-default OF-TYPE integer(1:100) COUNT 1 IN-GROUP printer-attributes-tag IF-DEFINED PRINTER_HAS_JOB_PRIORITY
139+
EXPECT job-priority-supported OF-TYPE integer(1:100) COUNT 1 IN-GROUP printer-attributes-tag IF-DEFINED PRINTER_HAS_JOB_PRIORITY
140+
141+
EXPECT job-sheets-default OF-TYPE keyword|name COUNT 1 IN-GROUP printer-attributes-tag WITH-VALUE-FROM job-sheets-supported IF-DEFINED PRINTER_HAS_JOB_SHEETS
142+
EXPECT job-sheets-supported OF-TYPE keyword|name IN-GROUP printer-attributes-tag IF-DEFINED PRINTER_HAS_JOB_SHEETS
143+
EXPECT job-sheets-supported WITH-VALUE none IF-DEFINED PRINTER_HAS_JOB_SHEETS
144+
145+
EXPECT media-default OF-TYPE no-value|keyword|name IN-GROUP printer-attributes-tag COUNT 1 WITH-VALUE "$MEDIA_REGEX"
146+
EXPECT ?media-ready OF-TYPE keyword|name IN-GROUP printer-attributes-tag WITH-ALL-VALUES "$MEDIA_REGEX"
147+
EXPECT media-supported OF-TYPE keyword|name IN-GROUP printer-attributes-tag WITH-ALL-VALUES "$MEDIA_REGEX"
148+
149+
EXPECT orientation-requested-default OF-TYPE no-value|enum IN-GROUP printer-attributes-tag COUNT 1 WITH-VALUE 3,4,5,6,7
150+
EXPECT orientation-requested-supported OF-TYPE enum IN-GROUP printer-attributes-tag WITH-VALUE 3,4,5,6,7
151+
152+
EXPECT output-bin-default OF-TYPE keyword|name IN-GROUP printer-attributes-tag COUNT 1 WITH-VALUE-FROM output-bin-supported
153+
EXPECT output-bin-supported OF-TYPE keyword|name IN-GROUP printer-attributes-tag
154+
155+
EXPECT pages-per-minute OF-TYPE integer IN-GROUP printer-attributes-tag COUNT 1 WITH-VALUE >-1
156+
EXPECT pages-per-minute-color OF-TYPE integer IN-GROUP printer-attributes-tag COUNT 1 WITH-VALUE >-1 IF-DEFINED PRINTER_IS_COLOR
157+
EXPECT !pages-per-minute-color IF-NOT-DEFINED PRINTER_IS_COLOR
158+
159+
EXPECT print-content-optimize-default OF-TYPE keyword COUNT 1 IN-GROUP printer-attributes-tag IF-DEFINED PRINTER_HAS_PRINT_CONTENT_OPTIMIZE WITH-VALUE-FROM print-content-optimize-supported
160+
EXPECT print-content-optimize-supported OF-TYPE keyword IN-GROUP printer-attributes-tag IF-DEFINED PRINTER_HAS_PRINT_CONTENT_OPTIMIZE WITH-ALL-VALUES "/^(auto|graphic|photo|text|text-and-graphic)$$/"
161+
162+
EXPECT print-quality-default OF-TYPE enum IN-GROUP printer-attributes-tag COUNT 1 WITH-VALUE-FROM print-quality-supported
163+
EXPECT print-quality-supported OF-TYPE enum IN-GROUP printer-attributes-tag WITH-VALUE 3,4,5
164+
165+
EXPECT printer-info OF-TYPE text(127) IN-GROUP printer-attributes-tag COUNT 1
166+
167+
EXPECT printer-location OF-TYPE text(127) IN-GROUP printer-attributes-tag COUNT 1
168+
169+
EXPECT printer-make-and-model OF-TYPE text(127) IN-GROUP printer-attributes-tag COUNT 1
170+
171+
EXPECT printer-more-info OF-TYPE uri IN-GROUP printer-attributes-tag COUNT 1
172+
173+
EXPECT printer-resolution-default OF-TYPE resolution IN-GROUP printer-attributes-tag COUNT 1 WITH-VALUE-FROM printer-resolution-supported
174+
EXPECT printer-resolution-supported OF-TYPE resolution IN-GROUP printer-attributes-tag
175+
176+
EXPECT sides-default OF-TYPE keyword IN-GROUP printer-attributes-tag COUNT 1 WITH-VALUE-FROM sides-supported IF-DEFINED PRINTER_HAS_SIDES
177+
EXPECT sides-supported OF-TYPE keyword IN-GROUP printer-attributes-tag WITH-ALL-VALUES "/^(one-sided|two-sided-long-edge|two-sided-short-edge)$$/" IF-DEFINED PRINTER_HAS_SIDES
87178
}

0 commit comments

Comments
 (0)