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
84 <dd>Specifies whether, by default,
<i>ipptool
</i> will ignore errors and continue with
87 <dt>INCLUDE
"filename"
90 <dt>INCLUDE
<filename
>
92 <dd>Includes another test file. The first form includes a file relative to the
93 current test file, while the second form includes a file from the
<i>ipptool
</i>
96 <dt>INCLUDE-IF-DEFINED name
"filename"
99 <dt>INCLUDE-IF-DEFINED name
<filename
>
101 <dd>Includes another test file if the named variable is defined. The first form
102 includes a file relative to the current test file, while the second form
103 includes a file from the
<i>ipptool
</i> include directory.
105 <dt>INCLUDE-IF-NOT-DEFINED name
"filename"
108 <dt>INCLUDE-IF-NOT-DEFINED name
<filename
>
110 <dd>Includes another test file if the named variable is not defined. The first form
111 includes a file relative to the current test file, while the second form
112 includes a file from the
<i>ipptool
</i> include directory.
114 <dt>SKIP-IF-DEFINED variable-name
117 <dt>SKIP-IF-NOT-DEFINED variable-name
119 <dd>Specifies that the remainder of the test file should be skipped when the
120 variable is or is not defined.
124 <dd>Specifies that tests will, by default, use
"Transfer-Encoding: chunked" for
125 requests with attached files and
"Content-Length:" for requests without attached
130 <dd>Specifies that tests will, by default, use the HTTP/
1.1 "Transfer-Encoding:
131 chunked" header. This is the default and is equivalent to specifying
"-c" on the
132 <i>ipptool
</i> command-line. Support for chunked requests is required for
133 conformance with all versions of IPP.
137 <dd>Specifies that tests will, by default, use the HTTP/
1.0 "Content-Length:"
138 header. This is equivalent to specifying
"-l" on the
<i>ipptool
</i> command-line.
139 Support for content length requests is required for conformance with all
156 <dd>Specifies the default IPP version number to use for the tests that follow.
160 <h2 class=
"title"><a name=
"TEST_DIRECTIVES">Test Directives
</a></h2>
161 The following directives are understood in a test:
163 <dt>ATTR tag attribute-name value(s)
165 <dd>Adds an attribute to the test request. Values are separated by the comma (
",")
166 character - escape commas using the
"" character.
168 <dt>ATTR collection attribute-name { MEMBER tag member-name value(s) ... } [ ... { ... } ]
170 <dd>Adds a collection attribute to the test request. Member attributes follow the
171 same syntax as regular attributes and can themselves be nested collections.
172 Multiple collection values can be supplied as needed.
174 <dt>COMPRESSION deflate
183 <dd>Uses the specified compression on the document data following the attributes in
184 a Print-Job or Send-Document request.
188 <dd>Specifies a delay before this test will be run.
190 <dt>DISPLAY attribute-name
192 <dd>Specifies that value of the named attribute should be output as part of the
195 <dt>EXPECT attribute-name [ predicate(s) ]
198 <dt>EXPECT ?attribute-name predicate(s)
201 <dt>EXPECT !attribute-name
203 <dd>Specifies that the response must/may/must not include the named attribute.
204 Additional requirements can be added as predicates - see the
"EXPECT PREDICATES"
205 section for more information on predicates.
209 <dd>Specifies a file to include at the end of the request. This is typically used
210 when sending a test print file.
214 <dd>Specifies the group tag for subsequent attributes in the request.
216 <dt>IGNORE-ERRORS yes
221 <dd>Specifies whether
<i>ipptool
</i> will ignore errors and continue with subsequent
224 <dt>NAME
"literal string"
226 <dd>Specifies the human-readable name of the test.
228 <dt>OPERATION operation-code
230 <dd>Specifies the operation to be performed.
232 <dt>REQUEST-ID number
235 <dt>REQUEST-ID random
237 <dd>Specifies the request-id value to use in the request, either an integer or the
238 word
"random" to use a randomly generated value (the default).
242 <dd>Specifies an alternate resource path that is used for the HTTP POST request.
243 The default is the resource from the URI provided to the
<i>ipptool
</i> program.
245 <dt>SKIP-IF-DEFINED variable-name
248 <dt>SKIP-IF-NOT-DEFINED variable-name
250 <dd>Specifies that the current test should be skipped when the variable is or is not
253 <dt>SKIP-PREVIOUS-ERROR yes
256 <dt>SKIP-PREVIOUS-ERROR no
258 <dd>Specifies whether
<i>ipptool
</i> will skip the current test if the previous test
259 resulted in an error/failure.
261 <dt>STATUS status-code [ predicate ]
263 <dd>Specifies an expected response status-code value. Additional requirements can be
264 added as predicates - see the
"STATUS PREDICATES" section for more information
269 <dd>Specifies that this test will use
"Transfer-Encoding: chunked" if it has an
270 attached file or
"Content-Length:" otherwise.
274 <dd>Specifies that this test will use the HTTP/
1.1 "Transfer-Encoding: chunked"
279 <dd>Specifies that this test will use the HTTP/
1.0 "Content-Length:" header.
295 <dd>Specifies the IPP version number to use for this test.
299 <h2 class=
"title"><a name=
"EXPECT_PREDICATES">Expect Predicates
</a></h2>
300 The following predicates are understood following the EXPECT test directive:
304 <dd>Requires the EXPECT attribute to have the specified number of values.
306 <dt>DEFINE-MATCH variable-name
308 <dd>Defines the variable to
"1" when the EXPECT condition matches. A side-effect of
309 this predicate is that this EXPECT will never fail a test.
311 <dt>DEFINE-NO-MATCH variable-name
313 <dd>Defines the variable to
"1" when the EXPECT condition does not match. A side-
314 effect of this predicate is that this EXPECT will never fail a test.
316 <dt>DEFINE-VALUE variable-name
318 <dd>Defines the variable to the value of the attribute when the EXPECT condition
319 matches. A side-effect of this predicate is that this EXPECT will never fail a test.
321 <dt>IF-DEFINED variable-name
323 <dd>Makes the EXPECT conditions apply only if the specified variable is defined.
325 <dt>IF-NOT-DEFINED variable-name
327 <dd>Makes the EXPECT conditions apply only if the specified variable is not
332 <dd>Requires the EXPECT attribute to be in the specified group tag.
334 <dt>OF-TYPE tag[,tag,...]
336 <dd>Requires the EXPECT attribute to use the specified value tag(s).
338 <dt>REPEAT-LIMIT number
341 <dd>Specifies the maximum number of times to repeat. The default value is
1000.
348 <dd>Specifies that the current test should be repeated when the EXPECT condition
349 matches or does not match.
351 <dt>SAME-COUNT-AS attribute-name
353 <dd>Requires the EXPECT attribute to have the same number of values as the specified
356 <dt>WITH-ALL-VALUES
"literal string"
358 <dd>Requires that all values of the EXPECT attribute match the literal string. Comparisons are case-sensitive.
360 <dt>WITH-ALL-VALUES
<number
363 <dt>WITH-ALL-VALUES =number
366 <dt>WITH-ALL-VALUES
>number
369 <dt>WITH-ALL-VALUES number[,number,...]
371 <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.
373 <dt>WITH-ALL-VALUES
"false"
376 <dt>WITH-ALL-VALUES
"true"
378 <dd>Requires that all values of the EXPECT attribute match the boolean value given.
380 <dt>WITH-ALL-VALUES
"/regular expression/"
382 <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.
384 <dt>WITH-VALUE
"literal string"
386 <dd>Requires that at least one value of the EXPECT attribute matches the literal string. Comparisons are case-sensitive.
388 <dt>WITH-VALUE
<number
391 <dt>WITH-VALUE =number
394 <dt>WITH-VALUE
>number
397 <dt>WITH-VALUE number[,number,...]
399 <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.
401 <dt>WITH-VALUE
"false"
404 <dt>WITH-VALUE
"true"
406 <dd>Requires that at least one value of the EXPECT attribute matches the boolean value given.
408 <dt>WITH-VALUE
"/regular expression/"
410 <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.
414 <h2 class=
"title"><a name=
"STATUS_PREDICATES">Status Predicates
</a></h2>
415 The following predicates are understood following the STATUS test directive:
417 <dt>DEFINE-MATCH variable-name
419 <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.
421 <dt>DEFINE-NO-MATCH variable-name
423 <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.
425 <dt>IF-DEFINED variable-name
427 <dd>Makes the STATUS apply only if the specified variable is defined.
429 <dt>IF-NOT-DEFINED variable-name
431 <dd>Makes the STATUS apply only if the specified variable is not defined.
433 <dt>REPEAT-LIMIT number
436 <dd>Specifies the maximum number of times to repeat. The default value is
1000.
443 <dd>Specifies that the current test should be repeated when the response status-code
444 matches or does not match the value specified by the STATUS directive.
448 <h2 class=
"title"><a name=
"OPERATION_CODES">Operation Codes
</a></h2>
449 Operation codes correspond to the hexadecimal numbers (
0xHHHH) and names from
450 RFC
2911 and other IPP extension specifications. Here is a complete list:
454 CUPS-Add-Modify-Class
455 CUPS-Add-Modify-Printer
456 CUPS-Authenticate-Job
476 Create-Job-Subscription
477 Create-Printer-Subscription
484 Get-Printer-Attributes
485 Get-Printer-Support-Files
486 Get-Printer-Supported-Values
487 Get-Subscription-Attributes
493 Pause-Printer-After-Current-Job
498 Release-Held-New-Jobs
512 Set-Printer-Attributes
520 <h2 class=
"title"><a name=
"STATUS_CODES">Status Codes
</a></h2>
521 Status codes correspond to the hexadecimal numbers (
0xHHHH) and names from RFC
522 2911 and other IPP extension specifications. Here is a complete list:
524 client-error-attributes-not-settable
525 client-error-attributes-or-values-not-supported
526 client-error-bad-request
527 client-error-charset-not-supported
528 client-error-compression-error
529 client-error-compression-not-supported
530 client-error-conflicting-attributes
531 client-error-document-access-error
532 client-error-document-format-error
533 client-error-document-format-not-supported
534 client-error-document-password-error
535 client-error-document-permission-error
536 client-error-document-security-error
537 client-error-document-unprintable-error
538 client-error-forbidden
540 client-error-ignored-all-notifications
541 client-error-ignored-all-subscriptions
542 client-error-not-authenticated
543 client-error-not-authorized
544 client-error-not-found
545 client-error-not-possible
546 client-error-print-support-file-not-found
547 client-error-request-entity-too-large
548 client-error-request-value-too-long
550 client-error-too-many-subscriptions
551 client-error-uri-scheme-not-supported
553 redirection-other-site
555 server-error-device-error
556 server-error-internal-error
557 server-error-job-canceled
558 server-error-multiple-document-jobs-not-supported
559 server-error-not-accepting-jobs
560 server-error-operation-not-supported
561 server-error-printer-is-deactivated
562 server-error-service-unavailable
563 server-error-temporary-error
564 server-error-version-not-supported
566 successful-ok-but-cancel-subscription
567 successful-ok-conflicting-attributes
568 successful-ok-events-complete
569 successful-ok-ignored-notifications
570 successful-ok-ignored-or-substituted-attributes
571 successful-ok-ignored-subscriptions
572 successful-ok-too-many-events
575 <h2 class=
"title"><a name=
"TAGS">Tags
</a></h2>
576 Value and group tags correspond to the names from RFC
2911 and other IPP
577 extension specifications. Here are the group tags:
579 event-notification-attributes-tag
581 operation-attributes-tag
582 printer-attributes-tag
583 subscription-attributes-tag
584 unsupported-attributes-tag
586 <p>Here are the value tags:
615 <h2 class=
"title"><a name=
"VARIABLES">Variables
</a></h2>
616 The
<i>ipptool
</i> program maintains a list of variables that can be used in any
617 literal string or attribute value by specifying
"$variable-name". Aside from
618 variables defined using the
"-d" option or
"DEFINE" directive, the following
619 pre-defined variables are available:
623 <dd>Inserts a single
"$" character.
627 <dd>Inserts the value of the named environment variable, or an empty string if the
628 environment variable is not defined.
632 <dd>Inserts the filename provided to
<i>ipptool
</i> with the
"-f" option.
636 <dd>Inserts the hostname from the URI provided to
<i>ipptool
</i>.
640 <dd>Inserts the last job-id value returned in a test response or
0 if no job-id has
645 <dd>Inserts the last job-uri value returned in a test response or an empty string if
646 no job-uri has been seen.
650 <dd>Inserts the scheme from the URI provided to
<i>ipptool
</i>.
652 <dt>$notify-subscription-id
654 <dd>Inserts the last notify-subscription-id value returned in a test response or
0 if
655 no notify-subscription-id has been seen.
659 <dd>Inserts the port number from the URI provided to
<i>ipptool
</i>.
663 <dd>Inserts the resource path from the URI provided to
<i>ipptool
</i>.
667 <dd>Inserts the URI provided to
<i>ipptool
</i>.
671 <dd>Inserts the current user's login name.
675 <dd>Inserts the username from the URI provided to
<i>ipptool
</i>, if any.
679 <h2 class=
"title"><a name=
"SEE_ALSO">See Also
</a></h2>
680 <a href='man-ipptool.html?TOPIC=Man+Pages'
>ipptool(
1)
</a>,
682 <a href='http://localhost:
631/help'
>http://localhost:
631/help
</a>
684 <h2 class=
"title"><a name=
"COPYRIGHT">Copyright
</a></h2>
685 Copyright
2007-
2013 by Apple Inc.