1 <!DOCTYPE HTML PUBLIC
"-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
3 <!-- SECTION: Man Pages -->
5 <link rel=
"stylesheet" type=
"text/css" href=
"../cups-printable.css">
6 <title>ipptoolfile(
5)
</title>
9 <h1 class=
"title">ipptoolfile(
5)
</h1>
10 <h2 class=
"title"><a name=
"NAME">Name
</a></h2>
11 ipptoolfile - ipptool file format
13 <h2 class=
"title"><a name=
"DESCRIPTION">Description
</a></h2>
14 The
<a href='man-ipptool.html?TOPIC=Man+Pages'
>ipptool(
1)
</a> 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:
19 # The name of the test
20 NAME
"Print PostScript Job"
24 GROUP operation-attributes-tag
25 ATTR charset attributes-charset utf-
8
26 ATTR language attributes-natural-language en
27 ATTR uri printer-uri $uri
28 ATTR name requesting-user-name $user
31 # The response to expect
33 EXPECT attributes-charset OF-TYPE charset
34 EXPECT attributes-natural-language OF-TYPE naturalLanguage
35 EXPECT job-id OF-TYPE integer
36 EXPECT job-uri OF-TYPE uri
39 # The name of the test
40 NAME
"Get Attributes of PostScript Job"
43 OPERATION Get-Job-Attributes
44 GROUP operation-attributes-tag
45 ATTR charset attributes-charset utf-
8
46 ATTR language attributes-natural-language en
47 ATTR uri printer-uri $uri
48 ATTR integer job-id $job-id
49 ATTR name requesting-user-name $user
51 # The response to expect
53 EXPECT attributes-charset OF-TYPE charset
54 EXPECT attributes-natural-language OF-TYPE naturalLanguage
55 EXPECT job-id OF-TYPE integer
56 EXPECT job-uri OF-TYPE uri
57 EXPECT job-state OF-TYPE enum
58 EXPECT job-originating-user-name OF-TYPE name WITH-VALUE
"$user"
62 <h2 class=
"title"><a name=
"TOP-LEVEL_DIRECTIVES">Top-level Directives
</a></h2>
63 The following directives can be used outside of a test:
69 <dt>DEFINE variable-name value
71 <dd>Defines the named variable to the given value. This is equivalent to specifying
72 "-d variable-name=value" on the
<i>ipptool
</i> command-line.
74 <dt>DEFINE-DEFAULT variable-name value
76 <dd>Defines the named variable to the given value if it does not already have a
79 <dt>FILE-ID
"identifier"
81 <dd>Specifies an identifier string for the current file.
88 <dd>Specifies whether, by default,
<i>ipptool
</i> will ignore errors and continue with
91 <dt>INCLUDE
"filename"
94 <dt>INCLUDE
<filename
>
96 <dd>Includes another test file. The first form includes a file relative to the
97 current test file, while the second form includes a file from the
<i>ipptool
</i>
100 <dt>INCLUDE-IF-DEFINED name
"filename"
103 <dt>INCLUDE-IF-DEFINED name
<filename
>
105 <dd>Includes another test file if the named variable is defined. The first form
106 includes a file relative to the current test file, while the second form
107 includes a file from the
<i>ipptool
</i> include directory.
109 <dt>INCLUDE-IF-NOT-DEFINED name
"filename"
112 <dt>INCLUDE-IF-NOT-DEFINED name
<filename
>
114 <dd>Includes another test file if the named variable is not defined. The first form
115 includes a file relative to the current test file, while the second form
116 includes a file from the
<i>ipptool
</i> include directory.
118 <dt>SKIP-IF-DEFINED variable-name
121 <dt>SKIP-IF-NOT-DEFINED variable-name
123 <dd>Specifies that the remainder of the test file should be skipped when the
124 variable is or is not defined.
126 <dt>STOP-AFTER-INCLUDE-ERROR no
129 <dt>STOP-AFTER-INCLUDE-ERROR yes
131 <dd>Specifies whether tests will be stopped after an error in an included file.
135 <dd>Specifies that tests will, by default, use
"Transfer-Encoding: chunked" for
136 requests with attached files and
"Content-Length:" for requests without attached
141 <dd>Specifies that tests will, by default, use the HTTP/
1.1 "Transfer-Encoding:
142 chunked" header. This is the default and is equivalent to specifying
"-c" on the
143 <i>ipptool
</i> command-line. Support for chunked requests is required for
144 conformance with all versions of IPP.
148 <dd>Specifies that tests will, by default, use the HTTP/
1.0 "Content-Length:"
149 header. This is equivalent to specifying
"-l" on the
<i>ipptool
</i> command-line.
150 Support for content length requests is required for conformance with all
167 <dd>Specifies the default IPP version number to use for the tests that follow.
171 <h2 class=
"title"><a name=
"TEST_DIRECTIVES">Test Directives
</a></h2>
172 The following directives are understood in a test:
174 <dt>ATTR tag attribute-name value(s)
176 <dd>Adds an attribute to the test request. Values are separated by the comma (
",")
177 character - escape commas using the
"" character.
179 <dt>ATTR collection attribute-name { MEMBER tag member-name value(s) ... } [ ... { ... } ]
181 <dd>Adds a collection attribute to the test request. Member attributes follow the
182 same syntax as regular attributes and can themselves be nested collections.
183 Multiple collection values can be supplied as needed.
185 <dt>COMPRESSION deflate
194 <dd>Uses the specified compression on the document data following the attributes in
195 a Print-Job or Send-Document request.
199 <dd>Specifies a delay before this test will be run.
201 <dt>DISPLAY attribute-name
203 <dd>Specifies that value of the named attribute should be output as part of the
206 <dt>EXPECT attribute-name [ predicate(s) ]
209 <dt>EXPECT ?attribute-name predicate(s)
212 <dt>EXPECT !attribute-name
214 <dd>Specifies that the response must/may/must not include the named attribute.
215 Additional requirements can be added as predicates - see the
"EXPECT PREDICATES"
216 section for more information on predicates.
220 <dd>Specifies a file to include at the end of the request. This is typically used
221 when sending a test print file.
225 <dd>Specifies the group tag for subsequent attributes in the request.
227 <dt>IGNORE-ERRORS yes
232 <dd>Specifies whether
<i>ipptool
</i> will ignore errors and continue with subsequent
235 <dt>NAME
"literal string"
237 <dd>Specifies the human-readable name of the test.
239 <dt>OPERATION operation-code
241 <dd>Specifies the operation to be performed.
243 <dt>REQUEST-ID number
246 <dt>REQUEST-ID random
248 <dd>Specifies the request-id value to use in the request, either an integer or the
249 word
"random" to use a randomly generated value (the default).
253 <dd>Specifies an alternate resource path that is used for the HTTP POST request.
254 The default is the resource from the URI provided to the
<i>ipptool
</i> program.
256 <dt>SKIP-IF-DEFINED variable-name
259 <dt>SKIP-IF-NOT-DEFINED variable-name
261 <dd>Specifies that the current test should be skipped when the variable is or is not
264 <dt>SKIP-PREVIOUS-ERROR yes
267 <dt>SKIP-PREVIOUS-ERROR no
269 <dd>Specifies whether
<i>ipptool
</i> will skip the current test if the previous test
270 resulted in an error/failure.
272 <dt>STATUS status-code [ predicate ]
274 <dd>Specifies an expected response status-code value. Additional requirements can be
275 added as predicates - see the
"STATUS PREDICATES" section for more information
278 <dt>TEST-ID
"identifier"
280 <dd>Specifies an identifier string for the current test.
284 <dd>Specifies that this test will use
"Transfer-Encoding: chunked" if it has an
285 attached file or
"Content-Length:" otherwise.
289 <dd>Specifies that this test will use the HTTP/
1.1 "Transfer-Encoding: chunked"
294 <dd>Specifies that this test will use the HTTP/
1.0 "Content-Length:" header.
310 <dd>Specifies the IPP version number to use for this test.
314 <h2 class=
"title"><a name=
"EXPECT_PREDICATES">Expect Predicates
</a></h2>
315 The following predicates are understood following the EXPECT test directive:
319 <dd>Requires the EXPECT attribute to have the specified number of values.
321 <dt>DEFINE-MATCH variable-name
323 <dd>Defines the variable to
"1" when the EXPECT condition matches. A side-effect of
324 this predicate is that this EXPECT will never fail a test.
326 <dt>DEFINE-NO-MATCH variable-name
328 <dd>Defines the variable to
"1" when the EXPECT condition does not match. A side-
329 effect of this predicate is that this EXPECT will never fail a test.
331 <dt>DEFINE-VALUE variable-name
333 <dd>Defines the variable to the value of the attribute when the EXPECT condition
334 matches. A side-effect of this predicate is that this EXPECT will never fail a test.
336 <dt>IF-DEFINED variable-name
338 <dd>Makes the EXPECT conditions apply only if the specified variable is defined.
340 <dt>IF-NOT-DEFINED variable-name
342 <dd>Makes the EXPECT conditions apply only if the specified variable is not
347 <dd>Requires the EXPECT attribute to be in the specified group tag.
349 <dt>OF-TYPE tag[,tag,...]
351 <dd>Requires the EXPECT attribute to use the specified value tag(s).
353 <dt>REPEAT-LIMIT number
356 <dd>Specifies the maximum number of times to repeat. The default value is
1000.
363 <dd>Specifies that the current test should be repeated when the EXPECT condition
364 matches or does not match.
366 <dt>SAME-COUNT-AS attribute-name
368 <dd>Requires the EXPECT attribute to have the same number of values as the specified
371 <dt>WITH-ALL-HOSTNAMES
"literal string"
374 <dt>WITH-ALL-HOSTNAMES
"/regular expression/"
376 <dd>Requires that all URI values contain a matching hostname.
378 <dt>WITH-ALL-RESOURCES
"literal string"
381 <dt>WITH-ALL-RESOURCES
"/regular expression/"
383 <dd>Requires that all URI values contain a matching resource (including leading /).
385 <dt>WITH-ALL-SCHEMES
"literal string"
388 <dt>WITH-ALL-SCHEMES
"/regular expression/"
390 <dd>Requires that all URI values contain a matching scheme.
392 <dt>WITH-ALL-VALUES
"literal string"
394 <dd>Requires that all values of the EXPECT attribute match the literal string. Comparisons are case-sensitive.
396 <dt>WITH-ALL-VALUES
<number
399 <dt>WITH-ALL-VALUES =number
402 <dt>WITH-ALL-VALUES
>number
405 <dt>WITH-ALL-VALUES number[,number,...]
407 <dd>Requires that all values of the EXPECT attribute match the number(s) or numeric comparison. When comparing rangeOfInteger values, the
"<" and
">" operators only check the upper bound of the range.
409 <dt>WITH-ALL-VALUES
"false"
412 <dt>WITH-ALL-VALUES
"true"
414 <dd>Requires that all values of the EXPECT attribute match the boolean value given.
416 <dt>WITH-ALL-VALUES
"/regular expression/"
418 <dd>Requires that all values of the EXPECT attribute match the regular expression, which must conform to the POSIX regular expression syntax. Comparisons are case-sensitive.
420 <dt>WITH-HOSTNAME
"literal string"
423 <dt>WITH-HOSTNAME
"/regular expression/"
425 <dd>Requires that at least one URI value contains a matching hostname.
427 <dt>WITH-RESOURCE
"literal string"
430 <dt>WITH-RESOURCE
"/regular expression/"
432 <dd>Requires that at least one URI value contains a matching resource (including leading /).
434 <dt>WITH-SCHEME
"literal string"
437 <dt>WITH-SCHEME
"/regular expression/"
439 <dd>Requires that at least one URI value contains a matching scheme.
441 <dt>WITH-VALUE
"literal string"
443 <dd>Requires that at least one value of the EXPECT attribute matches the literal string. Comparisons are case-sensitive.
445 <dt>WITH-VALUE
<number
448 <dt>WITH-VALUE =number
451 <dt>WITH-VALUE
>number
454 <dt>WITH-VALUE number[,number,...]
456 <dd>Requires that at least one value of the EXPECT attribute matches the number(s) or numeric comparison. When comparing rangeOfInteger values, the
"<" and
">" operators only check the upper bound of the range.
458 <dt>WITH-VALUE
"false"
461 <dt>WITH-VALUE
"true"
463 <dd>Requires that at least one value of the EXPECT attribute matches the boolean value given.
465 <dt>WITH-VALUE
"/regular expression/"
467 <dd>Requires that at least one value of the EXPECT attribute matches the regular expression, which must conform to the POSIX regular expression syntax. Comparisons are case-sensitive.
471 <h2 class=
"title"><a name=
"STATUS_PREDICATES">Status Predicates
</a></h2>
472 The following predicates are understood following the STATUS test directive:
474 <dt>DEFINE-MATCH variable-name
476 <dd>Defines the variable to
"1" when the STATUS matches. A side-effect of this predicate is that this STATUS will never fail a test.
478 <dt>DEFINE-NO-MATCH variable-name
480 <dd>Defines the variable to
"1" when the STATUS does not match. A side-effect of this predicate is that this STATUS will never fail a test.
482 <dt>IF-DEFINED variable-name
484 <dd>Makes the STATUS apply only if the specified variable is defined.
486 <dt>IF-NOT-DEFINED variable-name
488 <dd>Makes the STATUS apply only if the specified variable is not defined.
490 <dt>REPEAT-LIMIT number
493 <dd>Specifies the maximum number of times to repeat. The default value is
1000.
500 <dd>Specifies that the current test should be repeated when the response status-code
501 matches or does not match the value specified by the STATUS directive.
505 <h2 class=
"title"><a name=
"OPERATION_CODES">Operation Codes
</a></h2>
506 Operation codes correspond to the hexadecimal numbers (
0xHHHH) and names from
507 RFC
2911 and other IPP extension specifications. Here is a complete list:
511 CUPS-Add-Modify-Class
512 CUPS-Add-Modify-Printer
513 CUPS-Authenticate-Job
533 Create-Job-Subscription
534 Create-Printer-Subscription
541 Get-Printer-Attributes
542 Get-Printer-Support-Files
543 Get-Printer-Supported-Values
544 Get-Subscription-Attributes
550 Pause-Printer-After-Current-Job
555 Release-Held-New-Jobs
566 Send-Hardcopy-Document
570 Set-Printer-Attributes
578 <h2 class=
"title"><a name=
"STATUS_CODES">Status Codes
</a></h2>
579 Status codes correspond to the hexadecimal numbers (
0xHHHH) and names from RFC
580 2911 and other IPP extension specifications. Here is a complete list:
582 client-error-attributes-not-settable
583 client-error-attributes-or-values-not-supported
584 client-error-bad-request
585 client-error-charset-not-supported
586 client-error-compression-error
587 client-error-compression-not-supported
588 client-error-conflicting-attributes
589 client-error-document-access-error
590 client-error-document-format-error
591 client-error-document-format-not-supported
592 client-error-document-password-error
593 client-error-document-permission-error
594 client-error-document-security-error
595 client-error-document-unprintable-error
596 client-error-forbidden
598 client-error-ignored-all-notifications
599 client-error-ignored-all-subscriptions
600 client-error-not-authenticated
601 client-error-not-authorized
602 client-error-not-found
603 client-error-not-possible
604 client-error-print-support-file-not-found
605 client-error-request-entity-too-large
606 client-error-request-value-too-long
608 client-error-too-many-subscriptions
609 client-error-uri-scheme-not-supported
611 redirection-other-site
613 server-error-device-error
614 server-error-internal-error
615 server-error-job-canceled
616 server-error-multiple-document-jobs-not-supported
617 server-error-not-accepting-jobs
618 server-error-operation-not-supported
619 server-error-printer-is-deactivated
620 server-error-service-unavailable
621 server-error-temporary-error
622 server-error-version-not-supported
624 successful-ok-but-cancel-subscription
625 successful-ok-conflicting-attributes
626 successful-ok-events-complete
627 successful-ok-ignored-notifications
628 successful-ok-ignored-or-substituted-attributes
629 successful-ok-ignored-subscriptions
630 successful-ok-too-many-events
633 <h2 class=
"title"><a name=
"TAGS">Tags
</a></h2>
634 Value and group tags correspond to the names from RFC
2911 and other IPP
635 extension specifications. Here are the group tags:
637 event-notification-attributes-tag
639 operation-attributes-tag
640 printer-attributes-tag
641 subscription-attributes-tag
642 unsupported-attributes-tag
644 <p>Here are the value tags:
673 <h2 class=
"title"><a name=
"VARIABLES">Variables
</a></h2>
674 The
<i>ipptool
</i> program maintains a list of variables that can be used in any
675 literal string or attribute value by specifying
"$variable-name". Aside from
676 variables defined using the
"-d" option or
"DEFINE" directive, the following
677 pre-defined variables are available:
681 <dd>Inserts a single
"$" character.
685 <dd>Inserts the value of the named environment variable, or an empty string if the
686 environment variable is not defined.
690 <dd>Inserts the filename provided to
<i>ipptool
</i> with the
"-f" option.
694 <dd>Inserts the hostname from the URI provided to
<i>ipptool
</i>.
698 <dd>Inserts the last job-id value returned in a test response or
0 if no job-id has
703 <dd>Inserts the last job-uri value returned in a test response or an empty string if
704 no job-uri has been seen.
708 <dd>Inserts the scheme from the URI provided to
<i>ipptool
</i>.
710 <dt>$notify-subscription-id
712 <dd>Inserts the last notify-subscription-id value returned in a test response or
0 if
713 no notify-subscription-id has been seen.
717 <dd>Inserts the port number from the URI provided to
<i>ipptool
</i>.
721 <dd>Inserts the resource path from the URI provided to
<i>ipptool
</i>.
725 <dd>Inserts the URI provided to
<i>ipptool
</i>.
729 <dd>Inserts the current user's login name.
733 <dd>Inserts the username from the URI provided to
<i>ipptool
</i>, if any.
737 <h2 class=
"title"><a name=
"SEE_ALSO">See Also
</a></h2>
738 <a href='man-ipptool.html?TOPIC=Man+Pages'
>ipptool(
1)
</a>,
740 <a href='http://localhost:
631/help'
>http://localhost:
631/help
</a>
742 <h2 class=
"title"><a name=
"COPYRIGHT">Copyright
</a></h2>
743 Copyright
2007-
2013 by Apple Inc.