4 .\" ipptoolfile man page for CUPS.
6 .\" Copyright 2010 by Apple Inc.
8 .\" These coded instructions, statements, and computer programs are the
9 .\" property of Apple Inc. and are protected by Federal copyright
10 .\" law. Distribution and use rights are outlined in the file "LICENSE.txt"
11 .\" which should have been included with this file. If this file is
12 .\" file is missing or damaged, see the license at "http://www.cups.org/".
14 .TH ipptoolfile 5 "CUPS" "6 August 2010" "Apple Inc."
16 ipptoolfile \- ipptool file format
19 The \fIipptool(1)\fR program accepts free-form plain text files that describe one or more IPP requests. Comments start with the "#" character and continue to the end of the line. Each request is enclosed by curley braces, for example:
24 # The name of the test
25 NAME "Print PostScript Job"
29 GROUP operation-attributes-tag
30 ATTR charset attributes-charset utf-8
31 ATTR language attributes-natural-language en
32 ATTR uri printer-uri $uri
33 ATTR name requesting-user-name $user
36 # The response to expect
38 EXPECT attributes-charset OF-TYPE charset
39 EXPECT attributes-natural-language OF-TYPE naturalLanguage
40 EXPECT job-id OF-TYPE integer
41 EXPECT job-uri OF-TYPE uri
44 # The name of the test
45 NAME "Get Attributes of PostScript Job"
48 OPERATION Get-Job-Attributes
49 GROUP operation-attributes-tag
50 ATTR charset attributes-charset utf-8
51 ATTR language attributes-natural-language en
52 ATTR uri printer-uri $uri
53 ATTR integer job-id $job-id
54 ATTR name requesting-user-name $user
56 # The response to expect
58 EXPECT attributes-charset OF-TYPE charset
59 EXPECT attributes-natural-language OF-TYPE naturalLanguage
60 EXPECT job-id OF-TYPE integer
61 EXPECT job-uri OF-TYPE uri
62 EXPECT job-state OF-TYPE enum
63 EXPECT job-originating-user-name OF-TYPE name WITH-VALUE "$user"
67 .SH TOP-LEVEL DIRECTIVES
68 The following directives can be used outside of a test:
73 DEFINE variable-name value
74 Defines the named variable to the given value. This is equivalent to specifying
75 "-d variable-name=value" on the \fIipptool\fR command-line.
80 Specifies whether, by default, \fIipptool\fR will ignore errors and continue with
86 Includes another test file. The first form includes a file relative to the
87 current test file, while the second form includes a file from the \fIipptool\fR
90 SKIP-IF-DEFINED variable-name
92 SKIP-IF-NOT-DEFINED variable-name
93 Specifies that the remainder of the test file should be skipped when the
94 variable is or is not defined.
97 Specifies that tests will, by default, use "Transfer-Encoding: chunked" for
98 requests with attached files and "Content-Length:" for requests without attached
102 Specifies that tests will, by default, use the HTTP/1.1 "Transfer-Encoding:
103 chunked" header. This is the default and is equivalent to specifying "-c" on the
104 \fIipptool\fR command-line. Support for chunked requests is required for
105 conformance with all versions of IPP.
108 Specifies that tests will, by default, use the HTTP/1.0 "Content-Length:"
109 header. This is equivalent to specifying "-l" on the \fIipptool\fR command-line.
110 Support for content length requests is required for conformance with all
122 Specifies the default IPP version number to use for the tests that follow.
125 The following directives are understood in a test:
127 ATTR tag attribute-name value(s)
128 Adds an attribute to the test request. Values are separated by the comma (",")
129 character - escape commas using the "\" character.
131 ATTR collection attribute-name { MEMBER tag member-name value(s) ... } [ ... { ... } ]
132 Adds a collection attribute to the test request. Member attributes follow the
133 same syntax as regular attributes and can themselves be nested collections.
134 Multiple collection values can be supplied as needed.
137 Specifies a delay before this test will be run.
139 DISPLAY attribute-name
140 Specifies that value of the named attribute should be output as part of the
143 EXPECT attribute-name [ predicate(s) ]
145 EXPECT ?attribute-name predicate(s)
147 EXPECT !attribute-name
148 Specifies that the response must/may/must not include the named attribute.
149 Additional requirements can be added as predicates - see the "EXPECT PREDICATES"
150 section for more information on predicates.
153 Specifies a file to include at the end of the request. This is typically used
154 when sending a test print file.
157 Specifies the group tag for subsequent attributes in the request.
162 Specifies whether \fIipptool\fR will ignore errors and continue with subsequent
165 NAME "literal string"
166 Specifies the human-readable name of the test.
168 OPERATION operation-code
169 Specifies the operation to be performed.
174 Specifies the request-id value to use in the request, either an integer or the
175 word "random" to use a randomly generated value (the default).
178 Specifies an alternate resource path that is used for the HTTP POST request.
179 The default is the resource from the URI provided to the \fIipptool\fR program.
181 SKIP-IF-DEFINED variable-name
183 SKIP-IF-NOT-DEFINED variable-name
184 Specifies that the current test should be skipped when the variable is or is not
187 SKIP-PREVIOUS-ERROR yes
189 SKIP-PREVIOUS-ERROR no
190 Specifies whether \fIipptool\fR will skip the current test if the previous test
191 resulted in an error/failure.
193 STATUS status-code [ predicate ]
194 Specifies an expected response status-code value. Additional requirements can be
195 added as predicates - see the "STATUS PREDICATES" section for more information
199 Specifies that this test will use "Transfer-Encoding: chunked" if it has an
200 attached file or "Content-Length:" otherwise.
203 Specifies that this test will use the HTTP/1.1 "Transfer-Encoding: chunked"
207 Specifies that this test will use the HTTP/1.0 "Content-Length:" header.
218 Specifies the IPP version number to use for this test.
220 .SH EXPECT PREDICATES
221 The following predicates are understood following the EXPECT test directive:
224 Requires the EXPECT attribute to have the specified number of values.
226 DEFINE-MATCH variable-name
227 Defines the variable to "1" when the EXPECT condition matches. A side-effect of
228 this predicate is that this EXPECT will never fail a test.
230 DEFINE-NO-MATCH variable-name
231 Defines the variable to "1" when the EXPECT condition does not match. A side-
232 effect of this predicate is that this EXPECT will never fail a test.
234 DEFINE-VALUE variable-name
235 Defines the variable to the value of the attribute when the EXPECT condition
238 IF-DEFINED variable-name
239 Makes the EXPECT conditions apply only if the specified variable is defined.
241 IF-UNDEFINED variable-name
242 Makes the EXPECT conditions apply only if the specified variable is not
246 Requires the EXPECT attribute to be in the specified group tag.
248 OF-TYPE tag[,tag,...]
249 Requires the EXPECT attribute to use the specified value tag(s).
251 SAME-COUNT-AS attribute-name
252 Requires the EXPECT attribute to have the same number of values as the specified
255 WITH-VALUE "literal string"
256 Requires at least one value of the EXPECT attribute to match the literal string.
257 Comparisons are case-sensitive.
259 WITH-VALUE "/regular expression/"
260 Requires that all values of the EXPECT attribute match the regular expression,
261 which must conform to the POSIX regular expression syntax.
262 Comparisons are case-sensitive.
264 .SH STATUS PREDICATES
265 The following predicates are understood following the STATUS test directive:
267 IF-DEFINED variable-name
268 Makes the STATUS apply only if the specified variable is defined.
270 IF-UNDEFINED variable-name
271 Makes the STATUS apply only if the specified variable is not defined.
274 Operation codes correspond to the hexadecimal numbers (0xHHHH) and names from
275 RFC 2911 and other IPP extension specifications. Here is a complete list:
279 CUPS-Add-Modify-Class
280 CUPS-Add-Modify-Printer
281 CUPS-Authenticate-Job
301 Create-Job-Subscription
302 Create-Printer-Subscription
309 Get-Printer-Attributes
310 Get-Printer-Support-Files
311 Get-Printer-Supported-Values
312 Get-Subscription-Attributes
317 Pause-Printer-After-Current-Job
322 Release-Held-New-Jobs
336 Set-Printer-Attributes
344 Status codes correspond to the hexadecimal numbers (0xHHHH) and names from RFC
345 2911 and other IPP extension specifications. Here is a complete list:
347 client-error-attributes-not-settable
348 client-error-attributes-or-values-not-supported
349 client-error-bad-request
350 client-error-charset-not-supported
351 client-error-compression-error
352 client-error-compression-not-supported
353 client-error-conflicting-attributes
354 client-error-document-access-error
355 client-error-document-format-error
356 client-error-document-format-not-supported
357 client-error-forbidden
359 client-error-ignored-all-notifications
360 client-error-ignored-all-subscriptions
361 client-error-not-authenticated
362 client-error-not-authorized
363 client-error-not-found
364 client-error-not-possible
365 client-error-print-support-file-not-found
366 client-error-request-entity-too-large
367 client-error-request-value-too-long
369 client-error-too-many-subscriptions
370 client-error-uri-scheme-not-supported
372 redirection-other-site
374 server-error-device-error
375 server-error-internal-error
376 server-error-job-canceled
377 server-error-multiple-document-jobs-not-supported
378 server-error-not-accepting-jobs
379 server-error-operation-not-supported
380 server-error-printer-is-deactivated
381 server-error-service-unavailable
382 server-error-temporary-error
383 server-error-version-not-supported
385 successful-ok-but-cancel-subscription
386 successful-ok-conflicting-attributes
387 successful-ok-events-complete
388 successful-ok-ignored-notifications
389 successful-ok-ignored-or-substituted-attributes
390 successful-ok-ignored-subscriptions
391 successful-ok-too-many-events
395 Value and group tags correspond to the names from RFC 2911 and other IPP
396 extension specifications. Here are the group tags:
398 event-notification-attributes-tag
400 operation-attributes-tag
401 printer-attributes-tag
402 subscription-attributes-tag
403 unsupported-attributes-tag
406 Here are the value tags:
436 The \fIipptool\fR program maintains a list of variables that can be used in any
437 literal string or attribute value by specifying "$variable-name". Aside from
438 variables defined using the "-d" option or "DEFINE" directive, the following
439 pre-defined variables are available:
442 Inserts a single "$" character.
445 Inserts the value of the named environment variable, or an empty string if the
446 environment variable is not defined.
449 Inserts the filename provided to \fIipptool\fR with the "-f" option.
452 Inserts the hostname from the URI provided to \fIipptool\fR.
455 Inserts the last job-id value returned in a test response or 0 if no job-id has
459 Inserts the last job-uri value returned in a test response or an empty string if
460 no job-uri has been seen.
463 Inserts the scheme from the URI provided to \fIipptool\fR.
465 $notify-subscription-id
466 Inserts the last notify-subscription-id value returnd in a test response or 0 if
467 no notify-subscription-id has been seen.
470 Inserts the port number from the URI provided to \fIipptool\fR.
473 Inserts the resource path from the URI provided to \fIipptool\fR.
476 Inserts the URI provided to \fIipptool\fR.
479 Inserts the current user's login name.
482 Inserts the username from the URI provided to \fIipptool\fR, if any.
487 http://localhost:631/help
490 Copyright 2007-2010 by Apple Inc.