2 .\" ipptoolfile man page for CUPS.
4 .\" Copyright 2010-2014 by Apple Inc.
6 .\" These coded instructions, statements, and computer programs are the
7 .\" property of Apple Inc. and are protected by Federal copyright
8 .\" law. Distribution and use rights are outlined in the file "LICENSE.txt"
9 .\" which should have been included with this file. If this file is
10 .\" file is missing or damaged, see the license at "http://www.cups.org/".
12 .TH ipptoolfile 5 "CUPS" "4 February 2015" "Apple Inc."
14 ipptoolfile \- ipptool file format
18 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 curly braces, for example:
23 # The name of the test
24 NAME "Print PostScript File"
28 GROUP operation\-attributes\-tag
29 ATTR charset attributes\-charset utf\-8
30 ATTR language attributes\-natural\-language en
31 ATTR uri printer\-uri $uri
32 ATTR name requesting\-user\-name $user
35 # The response to expect
37 EXPECT job\-id OF\-TYPE integer WITH\-VALUE >0
38 EXPECT job\-uri OF\-TYPE uri
41 # The name of the test
42 NAME "Get Attributes of PostScript Job"
45 OPERATION Get\-Job\-Attributes
46 GROUP operation\-attributes\-tag
47 ATTR charset attributes\-charset utf\-8
48 ATTR language attributes\-natural\-language en
49 ATTR uri printer\-uri $uri
50 ATTR integer job\-id $job\-id
51 ATTR name requesting\-user\-name $user
53 # The response to expect
55 EXPECT job\-id OF\-TYPE integer WITH\-VALUE $job\-id
56 EXPECT job\-uri OF\-TYPE uri
57 EXPECT job\-state OF\-TYPE enum WITH\-VALUE 3,4,5,6,7,8,9
58 EXPECT job\-originating\-user\-name OF\-TYPE name WITH\-VALUE "$user"
61 .SS TOP-LEVEL DIRECTIVES
62 The following directives can be used outside of a \fItest\fR:
67 \fBDEFINE \fIvariable-name value\fR
68 Defines the named variable to the given value. This is equivalent to specifying \fI\-d variable-name=value\fR on the
72 \fBDEFINE\-DEFAULT \fIvariable-name value\fR
73 Defines the named variable to the given value if it does not already have a value.
75 \fBFILE\-ID "\fIidentifier\fB"\fR
76 Specifies an identifier string for the current file.
78 \fBIGNORE\-ERRORS yes\fR
80 \fBIGNORE\-ERRORS no\fR
81 Specifies whether, by default,
83 will ignore errors and continue with subsequent tests.
85 \fBINCLUDE "\fIfilename\fB"\fR
87 \fBINCLUDE <\fIfilename\fB>\fR
88 Includes another test file. The first form includes a file relative to the current test file, while the second form includes a file from the
92 \fBINCLUDE\-IF\-DEFINED \fIname \fB"\fIfilename\fB"\fR
94 \fBINCLUDE\-IF\-DEFINED \fIname \fB<\fIfilename\fB>\fR
95 Includes another test file if the named variable is defined. The first form includes a file relative to the current test file, while the second form includes a file from the
99 \fBINCLUDE\-IF\-NOT\-DEFINED \fIname \fB"\fIfilename\fB"\fR
101 \fBINCLUDE\-IF\-NOT\-DEFINED \fIname \fB<\fIfilename\fB>\fR
102 Includes another test file if the named variable is not defined. The first form includes a file relative to the current test file, while the second form includes a file from the
106 \fBSKIP\-IF\-DEFINED \fIvariable-name\fR
108 \fBSKIP\-IF\-NOT\-DEFINED \fIvariable-name\fR
109 Specifies that the remainder of the test file should be skipped when the variable is or is not defined.
111 \fBSTOP\-AFTER\-INCLUDE\-ERROR no\fR
113 \fBSTOP\-AFTER\-INCLUDE\-ERROR yes\fR
114 Specifies whether tests will be stopped after an error in an included file.
117 Specifies that tests will, by default, use "Transfer-Encoding: chunked" for requests with attached files and "Content-Length:" for requests without attached files.
119 \fBTRANSFER chunked\fR
120 Specifies that tests will, by default, use the HTTP/1.1 "Transfer-Encoding: chunked" header. This is the default and is equivalent to specifying \fI\-c\fR on the
122 command-line. Support for chunked requests is required for conformance with all versions of IPP.
124 \fBTRANSFER length\fR
125 Specifies that tests will, by default, use the HTTP/1.0 "Content-Length:" header. This is equivalent to specifying \fI\-l\fR on the
127 command-line. Support for content length requests is required for conformance with all versions of IPP.
138 Specifies the default IPP version number to use for the tests that follow.
140 The following directives are understood within a \fItest\fR:
142 \fBATTR \fItag attribute-name value(s)\fR
143 Adds an attribute to the test request. Values are separated by the comma (",") character - escape commas using the "\" character. Common attributes and values are listed in the IANA IPP registry - see references below.
145 \fBATTR collection \fIattribute-name \fB{ MEMBER \fItag member-name value(s) ... \fB}\fR [ \fI... \fB,{ \fI... \fB} \fR]
146 Adds a collection attribute to the test request. Member attributes follow the same syntax as regular attributes and can themselves be nested collections. Multiple collection values can be supplied as needed, separated by commas.
148 \fBCOMPRESSION deflate\fR
150 \fBCOMPRESSION gzip\fR
152 \fBCOMPRESSION none\fR
153 Uses the specified compression on the document data following the attributes in a Print-Job or Send-Document request.
155 \fBDELAY \fIseconds\fR
156 Specifies a delay before this test will be run.
158 \fBDISPLAY \fIattribute-name\fR
159 Specifies that value of the named attribute should be output as part of the
162 \fBEXPECT \fIattribute-name \fR[ \fIpredicate(s) \fR]
164 \fBEXPECT ?\fIattribute-name predicate(s)\fR
166 \fBEXPECT !\fIattribute-name\fR
167 Specifies that the response must/may/must not include the named attribute. Additional requirements can be added as predicates - see the "EXPECT PREDICATES" section for more information on predicates. Attribute names can specify member attributes by separating the attribute and member names with the forward slash, for example "media\-col/media\-size/x\-dimension".
169 \fBEXPECT-ALL \fIattribute-name \fR[ \fIpredicate(s) \fR]
171 \fBEXPECT-ALL ?\fIattribute-name predicate(s)\fR
172 Specifies that the response must/may include the named attribute and that all occurrences of that attribute must match the given predicates.
175 Specifies a file to include at the end of the request. This is typically used when sending a test print file.
178 Specifies the group tag for subsequent attributes in the request.
180 \fBIGNORE\-ERRORS yes\fR
182 \fBIGNORE\-ERRORS no\fR
185 will ignore errors and continue with subsequent tests.
187 \fBNAME "\fIliteral string\fB"\fR
188 Specifies the human-readable name of the test.
190 \fBOPERATION \fIoperation-code\fR
191 Specifies the operation to be performed.
193 \fBPAUSE "\fImessage\fB"\fR
194 Displays the provided message and waits for the user to press a key to continue.
196 \fBREQUEST\-ID \fInumber\fR\fR
198 \fBREQUEST\-ID random\fR
199 Specifies the request-id value to use in the request, either an integer or the word "random" to use a randomly generated value (the default).
201 \fBRESOURCE \fIpath\fR
202 Specifies an alternate resource path that is used for the HTTP POST request. The default is the resource from the URI provided to the
206 \fBSKIP\-IF\-DEFINED \fIvariable-name\fR
208 \fBSKIP\-IF\-NOT\-DEFINED \fIvariable-name\fR
209 Specifies that the current test should be skipped when the variable is or is not defined.
211 \fBSKIP\-PREVIOUS\-ERROR yes\fR
213 \fBSKIP\-PREVIOUS\-ERROR no\fR
216 will skip the current test if the previous test resulted in an error/failure.
218 \fBSTATUS \fIstatus-code \fR[ \fIpredicate\fR ]
219 Specifies an expected response status-code value. Additional requirements can be added as predicates - see the "STATUS PREDICATES" section for more information on predicates.
221 \fBTEST\-ID "\fIidentifier\fR"
222 Specifies an identifier string for the current test.
225 Specifies that this test will use "Transfer-Encoding: chunked" if it has an attached file or "Content-Length:" otherwise.
227 \fBTRANSFER chunked\fR
228 Specifies that this test will use the HTTP/1.1 "Transfer-Encoding: chunked" header.
230 \fBTRANSFER length\fR
231 Specifies that this test will use the HTTP/1.0 "Content-Length:" header.
242 Specifies the IPP version number to use for this test.
243 .SS EXPECT PREDICATES
244 The following predicates are understood following the \fBEXPECT\fR test directive:
246 \fBCOUNT \fInumber\fR
247 Requires the \fBEXPECT\fR attribute to have the specified number of values.
249 \fBDEFINE\-MATCH \fIvariable-name\fR
250 Defines the variable to "1" when the \fBEXPECT\fR condition matches. A side-effect of this predicate is that this \fBEXPECT\fR will never fail a test.
252 \fBDEFINE\-NO\-MATCH \fIvariable-name\fR
253 Defines the variable to "1" when the \fBEXPECT\fR condition does not match. A side-effect of this predicate is that this \fBEXPECT\fR will never fail a test.
255 \fBDEFINE\-VALUE \fIvariable-name\fR
256 Defines the variable to the value of the attribute when the \fBEXPECT\fR condition matches. A side-effect of this predicate is that this \fBEXPECT\fR will never fail a test.
258 \fBIF\-DEFINED \fIvariable-name\fR
259 Makes the \fBEXPECT\fR conditions apply only if the specified variable is defined.
261 \fBIF\-NOT\-DEFINED \fIvariable-name\fR
262 Makes the \fBEXPECT\fR conditions apply only if the specified variable is not defined.
264 \fBIN\-GROUP \fItag\fR
265 Requires the \fBEXPECT\fR attribute to be in the specified group tag.
267 \fBOF\-TYPE \fItag[,tag,...]\fR
268 Requires the \fBEXPECT\fR attribute to use one of the specified value tag(s).
270 \fBREPEAT\-LIMIT \fInumber\fR
272 Specifies the maximum number of times to repeat if the \fBREPEAT-MATCH\fR or \fBREPEAT-NO-MATCH\fR predicate is specified. The default value is 1000.
276 \fBREPEAT\-NO\-MATCH\fR
277 Specifies that the current test should be repeated when the \fBEXPECT\fR condition matches or does not match.
279 \fBSAME\-COUNT\-AS \fIattribute-name\fR
280 Requires the \fBEXPECT\fR attribute to have the same number of values as the specified parallel attribute.
282 \fBWITH\-ALL\-HOSTNAMES "\fIliteral string\fB"\fR
284 \fBWITH\-ALL\-HOSTNAMES "/\fIregular expression\fB/"\fR
285 Requires that all URI values contain a matching hostname.
287 \fBWITH\-ALL\-RESOURCES "\fIliteral string\fB"\fR
289 \fBWITH\-ALL\-RESOURCES "/\fIregular expression\fB/"\fR
290 Requires that all URI values contain a matching resource (including leading /).
292 \fBWITH\-ALL\-SCHEMES "\fIliteral string\fB"\fR
294 \fBWITH\-ALL-SCHEMES "/\fIregular expression\fB/"\fR
295 Requires that all URI values contain a matching scheme.
297 \fBWITH\-ALL\-VALUES "\fIliteral string\fB"\fR
298 Requires that all values of the \fBEXPECT\fR attribute match the literal string. Comparisons are case-sensitive.
300 \fBWITH\-ALL\-VALUES <\fInumber\fR
302 \fBWITH\-ALL\-VALUES =\fInumber\fR
304 \fBWITH\-ALL\-VALUES >\fInumber\fR
306 \fBWITH\-ALL\-VALUES \fInumber\fR[\fI,...,number\fR]
307 Requires that all values of the \fBEXPECT\fR attribute match the number(s) or numeric comparison. When comparing rangeOfInteger values, the "<" and ">" operators only check the upper bound of the range.
309 \fBWITH\-ALL\-VALUES "false"\fR
311 \fBWITH\-ALL\-VALUES "true"\fR
312 Requires that all values of the \fBEXPECT\fR attribute match the boolean value given.
314 \fBWITH\-ALL\-VALUES "/\fIregular expression\fB/"\fR
315 Requires that all values of the \fBEXPECT\fR attribute match the regular expression, which must conform to the POSIX regular expression syntax. Comparisons are case-sensitive.
317 \fBWITH\-HOSTNAME "\fIliteral string\fB"\fR
319 \fBWITH\-HOSTNAME "/\fIregular expression\fB/"\fR
320 Requires that at least one URI value contains a matching hostname.
322 \fBWITH\-RESOURCE "\fIliteral string\fB"\fR
324 \fBWITH\-RESOURCE "/\fIregular expression\fB/"\fR
325 Requires that at least one URI value contains a matching resource (including leading /).
327 \fBWITH\-SCHEME "\fIliteral string\fB"\fR
329 \fBWITH\-SCHEME "/\fIregular expression\fB/"\fR
330 Requires that at least one URI value contains a matching scheme.
332 \fBWITH\-VALUE "\fIliteral string\fB"\fR
333 Requires that at least one value of the \fBEXPECT\fR attribute matches the literal string. Comparisons are case-sensitive.
335 \fBWITH\-VALUE <\fInumber\fR
337 \fBWITH\-VALUE =\fInumber\fR
339 \fBWITH\-VALUE >\fInumber\fR
341 \fBWITH\-VALUE \fInumber\fR[\fI,...,number\fR]
342 Requires that at least one value of the \fBEXPECT\fR attribute matches the number(s) or numeric comparison. When comparing rangeOfInteger values, the "<" and ">" operators only check the upper bound of the range.
344 \fBWITH\-VALUE "false"\fR
346 \fBWITH\-VALUE "true"\fR
347 Requires that at least one value of the \fBEXPECT\fR attribute matches the boolean value given.
349 \fBWITH\-VALUE "/\fIregular expression\fB/"\fR
350 Requires that at least one value of the \fBEXPECT\fR attribute matches the regular expression, which must conform to the POSIX regular expression syntax. Comparisons are case-sensitive.
352 \fBWITH\-VALUE\-FROM \fIattribute-name\fR
353 Requires that the value(s) of the \fBEXPECT\fR attribute matches the value(s) in the specified attribute.
354 For example, "EXPECT job\-sheets WITH\-VALUE\-FROM job\-sheets\-supported" requires that the "job\-sheets" value is listed as a value of the "job\-sheets\-supported" attribute.
355 .SS STATUS PREDICATES
356 The following predicates are understood following the \fBSTATUS\fR test directive:
358 \fBDEFINE\-MATCH \fIvariable-name\fR
359 Defines the variable to "1" when the \fBSTATUS\fR matches. A side-effect of this predicate is that this \fBSTATUS\fR will never fail a test.
361 \fBDEFINE\-NO\-MATCH \fIvariable-name\fR
362 Defines the variable to "1" when the \fBSTATUS\fR does not match. A side-effect of this predicate is that this \fBSTATUS\fR will never fail a test.
364 \fBIF\-DEFINED \fIvariable-name\fR
365 Makes the \fBSTATUS\fR apply only if the specified variable is defined.
367 \fBIF\-NOT\-DEFINED \fIvariable-name\fR
368 Makes the \fBSTATUS\fR apply only if the specified variable is not defined.
370 \fBREPEAT\-LIMIT \fInumber\fR
372 Specifies the maximum number of times to repeat. The default value is 1000.
376 \fBREPEAT\-NO\-MATCH\fR
377 Specifies that the current test should be repeated when the response status-code matches or does not match the value specified by the STATUS directive.
379 Operation codes correspond to the hexadecimal numbers (0xHHHH) and names from RFC 2911 and other IPP extension specifications. Here is a complete list of names supported by
385 CUPS\-Add\-Modify\-Class
386 CUPS\-Add\-Modify\-Printer
387 CUPS\-Authenticate\-Job
389 CUPS\-Delete\-Printer
407 Create\-Job\-Subscriptions
408 Create\-Printer\-Subscriptions
415 Get\-Printer\-Attributes
416 Get\-Printer\-Support\-Files
417 Get\-Printer\-Supported\-Values
418 Get\-Subscription\-Attributes
424 Pause\-Printer\-After\-Current\-Job
429 Release\-Held\-New\-Jobs
440 Send\-Hardcopy\-Document
444 Set\-Printer\-Attributes
447 Suspend\-Current\-Job
452 Status codes correspond to the hexadecimal numbers (0xHHHH) and names from RFC 2911 and other IPP extension specifications. Here is a complete list of the names supported by
456 client\-error\-account\-authorization\-failed
457 client\-error\-account\-closed
458 client\-error\-account\-info\-needed
459 client\-error\-account\-limit\-reached
460 client\-error\-attributes\-not\-settable
461 client\-error\-attributes\-or\-values\-not\-supported
462 client\-error\-bad\-request
463 client\-error\-charset\-not\-supported
464 client\-error\-compression\-error
465 client\-error\-compression\-not\-supported
466 client\-error\-conflicting\-attributes
467 client\-error\-document\-access\-error
468 client\-error\-document\-format\-error
469 client\-error\-document\-format\-not\-supported
470 client\-error\-document\-password\-error
471 client\-error\-document\-permission\-error
472 client\-error\-document\-security\-error
473 client\-error\-document\-unprintable\-error
474 client\-error\-forbidden
476 client\-error\-ignored\-all\-notifications
477 client\-error\-ignored\-all\-subscriptions
478 client\-error\-not\-authenticated
479 client\-error\-not\-authorized
480 client\-error\-not\-found
481 client\-error\-not\-possible
482 client\-error\-print\-support\-file\-not\-found
483 client\-error\-request\-entity\-too\-large
484 client\-error\-request\-value\-too\-long
485 client\-error\-timeout
486 client\-error\-too\-many\-subscriptions
487 client\-error\-uri\-scheme\-not\-supported
488 cups\-error\-account\-authorization\-failed
489 cups\-error\-account\-closed
490 cups\-error\-account\-info\-needed
491 cups\-error\-account\-limit\-reached
493 redirection\-other\-site
495 server\-error\-device\-error
496 server\-error\-internal\-error
497 server\-error\-job\-canceled
498 server\-error\-multiple\-document\-jobs\-not\-supported
499 server\-error\-not\-accepting\-jobs
500 server\-error\-operation\-not\-supported
501 server\-error\-printer\-is\-deactivated
502 server\-error\-service\-unavailable
503 server\-error\-temporary\-error
504 server\-error\-version\-not\-supported
506 successful\-ok\-but\-cancel\-subscription
507 successful\-ok\-conflicting\-attributes
508 successful\-ok\-events\-complete
509 successful\-ok\-ignored\-notifications
510 successful\-ok\-ignored\-or\-substituted\-attributes
511 successful\-ok\-ignored\-subscriptions
512 successful\-ok\-too\-many\-events
515 Value and group tags correspond to the names from RFC 2911 and other IPP extension specifications. Here are the group tags:
518 document\-attributes\-tag
519 event\-notification\-attributes\-tag
521 operation\-attributes\-tag
522 printer\-attributes\-tag
523 subscription\-attributes\-tag
524 unsupported\-attributes\-tag
527 Here are the value tags:
559 program maintains a list of variables that can be used in any literal string or attribute value by specifying "\fI$variable-name\fR". Aside from variables defined using the \fI-d\fR option or \fBDEFINE\fR directive, the following pre-defined variables are available:
562 Inserts a single "$" character.
564 \fB$ENV[\fIname\fB]\fR
565 Inserts the value of the named environment variable, or an empty string if the environment variable is not defined.
568 Inserts the filename provided to
570 with the \fI-f\fR option.
573 Inserts the MIME media type for the filename provided to
575 with the \fI-f\fR option.
578 Inserts the hostname from the URI provided to
582 Inserts the last "job\-id" attribute value returned in a test response or 0 if no "job\-id" attribute has been seen.
585 Inserts the last "job\-uri" attribute value returned in a test response or an empty string if no "job\-uri" attribute has been seen.
587 \fB$notify\-subscription\-id\fR
588 Inserts the last "notify\-subscription\-id" attribute value returned in a test response or 0 if no "notify\-subscription\-id" attribute has been seen.
591 Inserts the port number from the URI provided to
595 Inserts the resource path from the URI provided to
599 Inserts the scheme from the URI provided to
603 Inserts the URI provided to
607 Inserts the username from the URI provided to
612 Inserts the current user's login name.
615 CUPS Online Help (http://localhost:631/help),
616 IANA IPP Registry (http://www.iana.org/assignments/ipp-registrations),
617 PWG Internet Printing Protocol Workgroup (http://www.pwg.org/ipp),
618 RFC 2911 (http://tools.ietf.org/html/rfc3911)
620 Copyright \[co] 2007-2015 by Apple Inc.