]> git.ipfire.org Git - thirdparty/cups.git/blame - man/ipptoolfile.man
Import CUPS v1.7.1
[thirdparty/cups.git] / man / ipptoolfile.man
CommitLineData
f8b3a85b 1.\"
61515785 2.\" "$Id: ipptoolfile.man 11022 2013-06-06 22:14:09Z msweet $"
f8b3a85b 3.\"
aaf19ab0 4.\" ipptoolfile man page for CUPS.
f8b3a85b 5.\"
0fa6c7fa 6.\" Copyright 2010-2013 by Apple Inc.
f8b3a85b
MS
7.\"
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/".
13.\"
9475ec92 14.TH ipptoolfile 5 "CUPS" "13 May 2013" "Apple Inc."
f8b3a85b 15.SH NAME
aaf19ab0 16ipptoolfile \- ipptool file format
f8b3a85b
MS
17
18.SH DESCRIPTION
c1420c87 19The \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 curly braces, for example:
f8b3a85b
MS
20.nf
21
22 # This is a comment
23 {
24 # The name of the test
25 NAME "Print PostScript Job"
26
27 # The request to send
28 OPERATION Print-Job
aaf19ab0 29 GROUP operation-attributes-tag
f8b3a85b
MS
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
34 FILE testfile.ps
35
36 # The response to expect
37 STATUS successful-ok
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
42 }
43 {
44 # The name of the test
45 NAME "Get Attributes of PostScript Job"
46
47 # The request to send
48 OPERATION Get-Job-Attributes
aaf19ab0 49 GROUP operation-attributes-tag
f8b3a85b
MS
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
55
56 # The response to expect
57 STATUS successful-ok
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"
64 }
65.fi
66
67.SH TOP-LEVEL DIRECTIVES
68The following directives can be used outside of a test:
69.TP 5
70{ test }
71Defines a test.
72.TP 5
73DEFINE variable-name value
74Defines the named variable to the given value. This is equivalent to specifying
aaf19ab0 75"-d variable-name=value" on the \fIipptool\fR command-line.
f8b3a85b 76.TP 5
321d8d57
MS
77DEFINE-DEFAULT variable-name value
78Defines the named variable to the given value if it does not already have a
79value.
80.TP 5
1d47b929
MS
81FILE-ID "identifier"
82Specifies an identifier string for the current file.
83.TP 5
030ae6a1
MS
84IGNORE-ERRORS yes
85.TP 5
86IGNORE-ERRORS no
87Specifies whether, by default, \fIipptool\fR will ignore errors and continue with
88subsequent tests.
89.TP 5
f8b3a85b
MS
90INCLUDE "filename"
91.TP 5
92INCLUDE <filename>
93Includes another test file. The first form includes a file relative to the
aaf19ab0 94current test file, while the second form includes a file from the \fIipptool\fR
f8b3a85b
MS
95include directory.
96.TP 5
321d8d57
MS
97INCLUDE-IF-DEFINED name "filename"
98.TP 5
99INCLUDE-IF-DEFINED name <filename>
100Includes another test file if the named variable is defined. The first form
101includes a file relative to the current test file, while the second form
102includes a file from the \fIipptool\fR include directory.
103.TP 5
104INCLUDE-IF-NOT-DEFINED name "filename"
105.TP 5
106INCLUDE-IF-NOT-DEFINED name <filename>
107Includes another test file if the named variable is not defined. The first form
108includes a file relative to the current test file, while the second form
109includes a file from the \fIipptool\fR include directory.
110.TP 5
030ae6a1
MS
111SKIP-IF-DEFINED variable-name
112.TP 5
113SKIP-IF-NOT-DEFINED variable-name
114Specifies that the remainder of the test file should be skipped when the
115variable is or is not defined.
116.TP 5
9475ec92
MS
117STOP-AFTER-INCLUDE-ERROR no
118.TP 5
119STOP-AFTER-INCLUDE-ERROR yes
120Specifies whether tests will be stopped after an error in an included file.
121.TP 5
f8b3a85b
MS
122TRANSFER auto
123Specifies that tests will, by default, use "Transfer-Encoding: chunked" for
124requests with attached files and "Content-Length:" for requests without attached
125files.
126.TP 5
127TRANSFER chunked
128Specifies that tests will, by default, use the HTTP/1.1 "Transfer-Encoding:
129chunked" header. This is the default and is equivalent to specifying "-c" on the
aaf19ab0 130\fIipptool\fR command-line. Support for chunked requests is required for
f8b3a85b
MS
131conformance with all versions of IPP.
132.TP 5
133TRANSFER length
134Specifies that tests will, by default, use the HTTP/1.0 "Content-Length:"
aaf19ab0 135header. This is equivalent to specifying "-l" on the \fIipptool\fR command-line.
f8b3a85b
MS
136Support for content length requests is required for conformance with all
137versions of IPP.
138.TP 5
139VERSION 1.0
140.TP 5
141VERSION 1.1
142.TP 5
143VERSION 2.0
144.TP 5
145VERSION 2.1
146.TP 5
147VERSION 2.2
148Specifies the default IPP version number to use for the tests that follow.
149
150.SH TEST DIRECTIVES
151The following directives are understood in a test:
152.TP 5
153ATTR tag attribute-name value(s)
154Adds an attribute to the test request. Values are separated by the comma (",")
155character - escape commas using the "\" character.
156.TP 5
157ATTR collection attribute-name { MEMBER tag member-name value(s) ... } [ ... { ... } ]
158Adds a collection attribute to the test request. Member attributes follow the
159same syntax as regular attributes and can themselves be nested collections.
160Multiple collection values can be supplied as needed.
161.TP 5
c41769ff
MS
162COMPRESSION deflate
163.TP 5
164COMPRESSION gzip
165.TP 5
166COMPRESSION none
167.br
168Uses the specified compression on the document data following the attributes in
169a Print-Job or Send-Document request.
170.TP 5
f8b3a85b
MS
171DELAY seconds
172Specifies a delay before this test will be run.
173.TP 5
174DISPLAY attribute-name
175Specifies that value of the named attribute should be output as part of the
176test report.
177.TP 5
178EXPECT attribute-name [ predicate(s) ]
179.TP 5
180EXPECT ?attribute-name predicate(s)
181.TP 5
182EXPECT !attribute-name
183Specifies that the response must/may/must not include the named attribute.
184Additional requirements can be added as predicates - see the "EXPECT PREDICATES"
185section for more information on predicates.
186.TP 5
187FILE filename
188Specifies a file to include at the end of the request. This is typically used
189when sending a test print file.
190.TP 5
191GROUP tag
192Specifies the group tag for subsequent attributes in the request.
193.TP 5
030ae6a1
MS
194IGNORE-ERRORS yes
195.TP 5
196IGNORE-ERRORS no
197Specifies whether \fIipptool\fR will ignore errors and continue with subsequent
198tests.
199.TP 5
f8b3a85b
MS
200NAME "literal string"
201Specifies the human-readable name of the test.
202.TP 5
203OPERATION operation-code
204Specifies the operation to be performed.
205.TP 5
206REQUEST-ID number
207.TP 5
208REQUEST-ID random
209Specifies the request-id value to use in the request, either an integer or the
210word "random" to use a randomly generated value (the default).
211.TP 5
212RESOURCE path
213Specifies an alternate resource path that is used for the HTTP POST request.
aaf19ab0 214The default is the resource from the URI provided to the \fIipptool\fR program.
f8b3a85b 215.TP 5
030ae6a1
MS
216SKIP-IF-DEFINED variable-name
217.TP 5
218SKIP-IF-NOT-DEFINED variable-name
219Specifies that the current test should be skipped when the variable is or is not
220defined.
221.TP 5
222SKIP-PREVIOUS-ERROR yes
223.TP 5
224SKIP-PREVIOUS-ERROR no
225Specifies whether \fIipptool\fR will skip the current test if the previous test
226resulted in an error/failure.
227.TP 5
f8b3a85b
MS
228STATUS status-code [ predicate ]
229Specifies an expected response status-code value. Additional requirements can be
230added as predicates - see the "STATUS PREDICATES" section for more information
231on predicates.
232.TP 5
1d47b929
MS
233TEST-ID "identifier"
234Specifies an identifier string for the current test.
235.TP 5
f8b3a85b
MS
236TRANSFER auto
237Specifies that this test will use "Transfer-Encoding: chunked" if it has an
238attached file or "Content-Length:" otherwise.
239.TP 5
240TRANSFER chunked
241Specifies that this test will use the HTTP/1.1 "Transfer-Encoding: chunked"
242header.
243.TP 5
244TRANSFER length
245Specifies that this test will use the HTTP/1.0 "Content-Length:" header.
246.TP 5
247VERSION 1.0
248.TP 5
249VERSION 1.1
250.TP 5
251VERSION 2.0
252.TP 5
253VERSION 2.1
254.TP 5
255VERSION 2.2
256Specifies the IPP version number to use for this test.
257
258.SH EXPECT PREDICATES
259The following predicates are understood following the EXPECT test directive:
260.TP 5
261COUNT number
262Requires the EXPECT attribute to have the specified number of values.
263.TP 5
030ae6a1
MS
264DEFINE-MATCH variable-name
265Defines the variable to "1" when the EXPECT condition matches. A side-effect of
266this predicate is that this EXPECT will never fail a test.
267.TP 5
268DEFINE-NO-MATCH variable-name
269Defines the variable to "1" when the EXPECT condition does not match. A side-
270effect of this predicate is that this EXPECT will never fail a test.
271.TP 5
272DEFINE-VALUE variable-name
273Defines the variable to the value of the attribute when the EXPECT condition
9b66acc5 274matches. A side-effect of this predicate is that this EXPECT will never fail a test.
030ae6a1 275.TP 5
f8b3a85b
MS
276IF-DEFINED variable-name
277Makes the EXPECT conditions apply only if the specified variable is defined.
278.TP 5
7cf5915e 279IF-NOT-DEFINED variable-name
f8b3a85b
MS
280Makes the EXPECT conditions apply only if the specified variable is not
281defined.
282.TP 5
283IN-GROUP tag
284Requires the EXPECT attribute to be in the specified group tag.
285.TP 5
286OF-TYPE tag[,tag,...]
287Requires the EXPECT attribute to use the specified value tag(s).
288.TP 5
a29fd7dd
MS
289REPEAT-LIMIT number
290.br
291Specifies the maximum number of times to repeat. The default value is 1000.
292.TP 5
83e08001
MS
293REPEAT-MATCH
294.TP 5
295REPEAT-NO-MATCH
296Specifies that the current test should be repeated when the EXPECT condition
297matches or does not match.
298.TP 5
f8b3a85b
MS
299SAME-COUNT-AS attribute-name
300Requires the EXPECT attribute to have the same number of values as the specified
301parallel attribute.
302.TP 5
890a10b7
MS
303WITH-ALL-HOSTNAMES "literal string"
304.TP 5
305WITH-ALL-HOSTNAMES "/regular expression/"
306Requires that all URI values contain a matching hostname.
307.TP 5
308WITH-ALL-RESOURCES "literal string"
309.TP 5
310WITH-ALL-RESOURCES "/regular expression/"
311Requires that all URI values contain a matching resource (including leading /).
312.TP 5
313WITH-ALL-SCHEMES "literal string"
314.TP 5
315WITH-ALL-SCHEMES "/regular expression/"
316Requires that all URI values contain a matching scheme.
317.TP 5
82cc1f9a
MS
318WITH-ALL-VALUES "literal string"
319Requires that all values of the EXPECT attribute match the literal string. Comparisons are case-sensitive.
320.TP 5
321WITH-ALL-VALUES <number
322.TP 5
323WITH-ALL-VALUES =number
324.TP 5
325WITH-ALL-VALUES >number
326.TP 5
327WITH-ALL-VALUES number[,number,...]
328Requires 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.
329.TP 5
330WITH-ALL-VALUES "false"
331.TP 5
332WITH-ALL-VALUES "true"
333Requires that all values of the EXPECT attribute match the boolean value given.
334.TP 5
335WITH-ALL-VALUES "/regular expression/"
336Requires that all values of the EXPECT attribute match the regular expression, which must conform to the POSIX regular expression syntax. Comparisons are case-sensitive.
337.TP 5
890a10b7
MS
338WITH-HOSTNAME "literal string"
339.TP 5
340WITH-HOSTNAME "/regular expression/"
341Requires that at least one URI value contains a matching hostname.
342.TP 5
343WITH-RESOURCE "literal string"
344.TP 5
345WITH-RESOURCE "/regular expression/"
346Requires that at least one URI value contains a matching resource (including leading /).
347.TP 5
348WITH-SCHEME "literal string"
349.TP 5
350WITH-SCHEME "/regular expression/"
351Requires that at least one URI value contains a matching scheme.
352.TP 5
f8b3a85b 353WITH-VALUE "literal string"
82cc1f9a
MS
354Requires that at least one value of the EXPECT attribute matches the literal string. Comparisons are case-sensitive.
355.TP 5
356WITH-VALUE <number
357.TP 5
358WITH-VALUE =number
359.TP 5
360WITH-VALUE >number
361.TP 5
362WITH-VALUE number[,number,...]
363Requires 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.
364.TP 5
365WITH-VALUE "false"
366.TP 5
367WITH-VALUE "true"
368Requires that at least one value of the EXPECT attribute matches the boolean value given.
f8b3a85b
MS
369.TP 5
370WITH-VALUE "/regular expression/"
82cc1f9a 371Requires 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.
f8b3a85b
MS
372
373.SH STATUS PREDICATES
374The following predicates are understood following the STATUS test directive:
375.TP 5
0fa6c7fa
MS
376DEFINE-MATCH variable-name
377Defines the variable to "1" when the STATUS matches. A side-effect of this predicate is that this STATUS will never fail a test.
378.TP 5
379DEFINE-NO-MATCH variable-name
380Defines 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.
381.TP 5
f8b3a85b
MS
382IF-DEFINED variable-name
383Makes the STATUS apply only if the specified variable is defined.
384.TP 5
7cf5915e 385IF-NOT-DEFINED variable-name
f8b3a85b 386Makes the STATUS apply only if the specified variable is not defined.
83e08001 387.TP 5
a29fd7dd
MS
388REPEAT-LIMIT number
389.br
390Specifies the maximum number of times to repeat. The default value is 1000.
391.TP 5
83e08001
MS
392REPEAT-MATCH
393.TP 5
394REPEAT-NO-MATCH
395Specifies that the current test should be repeated when the response status-code
396matches or does not match the value specified by the STATUS directive.
f8b3a85b
MS
397
398.SH OPERATION CODES
aaf19ab0
MS
399Operation codes correspond to the hexadecimal numbers (0xHHHH) and names from
400RFC 2911 and other IPP extension specifications. Here is a complete list:
f8b3a85b
MS
401.nf
402 Activate-Printer
403 CUPS-Accept-Jobs
404 CUPS-Add-Modify-Class
405 CUPS-Add-Modify-Printer
406 CUPS-Authenticate-Job
407 CUPS-Delete-Class
408 CUPS-Delete-Printer
409 CUPS-Get-Classes
410 CUPS-Get-Default
411 CUPS-Get-Devices
412 CUPS-Get-Document
413 CUPS-Get-PPD
414 CUPS-Get-PPDs
415 CUPS-Get-Printers
416 CUPS-Move-Job
417 CUPS-Reject-Jobs
418 CUPS-Set-Default
419 Cancel-Current-Job
420 Cancel-Job
aaf19ab0
MS
421 Cancel-Jobs
422 Cancel-My-Jobs
f8b3a85b 423 Cancel-Subscription
aaf19ab0 424 Close-Job
f8b3a85b
MS
425 Create-Job
426 Create-Job-Subscription
427 Create-Printer-Subscription
428 Deactivate-Printer
429 Disable-Printer
430 Enable-Printer
431 Get-Job-Attributes
432 Get-Jobs
433 Get-Notifications
434 Get-Printer-Attributes
435 Get-Printer-Support-Files
436 Get-Printer-Supported-Values
437 Get-Subscription-Attributes
438 Get-Subscriptions
439 Hold-Job
440 Hold-New-Jobs
82cc1f9a 441 Identify-Printer
f8b3a85b
MS
442 Pause-Printer
443 Pause-Printer-After-Current-Job
444 Print-Job
445 Print-URI
446 Promote-Job
447 Purge-Jobs
448 Release-Held-New-Jobs
449 Release-Job
450 Renew-Subscription
451 Reprocess-Job
452 Restart-Job
453 Restart-Printer
aaf19ab0 454 Resubmit-Job
f8b3a85b
MS
455 Resume-Job
456 Resume-Printer
457 Schedule-Job-After
458 Send-Document
9475ec92 459 Send-Hardcopy-Document
f8b3a85b
MS
460 Send-Notifications
461 Send-URI
462 Set-Job-Attributes
463 Set-Printer-Attributes
464 Shutdown-Printer
465 Startup-Printer
466 Suspend-Current-Job
82cc1f9a 467 Validate-Document
f8b3a85b
MS
468 Validate-Job
469.fi
470
471.SH STATUS CODES
030ae6a1
MS
472Status codes correspond to the hexadecimal numbers (0xHHHH) and names from RFC
4732911 and other IPP extension specifications. Here is a complete list:
f8b3a85b
MS
474.nf
475 client-error-attributes-not-settable
476 client-error-attributes-or-values-not-supported
477 client-error-bad-request
478 client-error-charset-not-supported
479 client-error-compression-error
480 client-error-compression-not-supported
481 client-error-conflicting-attributes
482 client-error-document-access-error
483 client-error-document-format-error
484 client-error-document-format-not-supported
82cc1f9a
MS
485 client-error-document-password-error
486 client-error-document-permission-error
487 client-error-document-security-error
488 client-error-document-unprintable-error
f8b3a85b
MS
489 client-error-forbidden
490 client-error-gone
491 client-error-ignored-all-notifications
492 client-error-ignored-all-subscriptions
493 client-error-not-authenticated
494 client-error-not-authorized
495 client-error-not-found
496 client-error-not-possible
497 client-error-print-support-file-not-found
498 client-error-request-entity-too-large
499 client-error-request-value-too-long
500 client-error-timeout
501 client-error-too-many-subscriptions
502 client-error-uri-scheme-not-supported
503 cups-see-other
504 redirection-other-site
505 server-error-busy
506 server-error-device-error
507 server-error-internal-error
508 server-error-job-canceled
509 server-error-multiple-document-jobs-not-supported
510 server-error-not-accepting-jobs
511 server-error-operation-not-supported
512 server-error-printer-is-deactivated
513 server-error-service-unavailable
514 server-error-temporary-error
515 server-error-version-not-supported
516 successful-ok
517 successful-ok-but-cancel-subscription
518 successful-ok-conflicting-attributes
519 successful-ok-events-complete
520 successful-ok-ignored-notifications
521 successful-ok-ignored-or-substituted-attributes
522 successful-ok-ignored-subscriptions
523 successful-ok-too-many-events
524.fi
525
526.SH TAGS
527Value and group tags correspond to the names from RFC 2911 and other IPP
528extension specifications. Here are the group tags:
529.nf
530 event-notification-attributes-tag
531 job-attributes-tag
532 operation-attributes-tag
533 printer-attributes-tag
534 subscription-attributes-tag
535 unsupported-attributes-tag
536.fi
537.LP
538Here are the value tags:
539.nf
540 admin-define
541 boolean
542 charset
543 collection
544 dateTime
545 default
546 delete-attribute
547 enum
548 integer
549 keyword
550 mimeMediaType
551 nameWithLanguage
552 nameWithoutLanguage
553 naturalLanguage
554 no-value
555 not-settable
556 octetString
557 rangeOfInteger
558 resolution
559 textWithLanguage
560 textWithoutLanguage
561 unknown
562 unsupported
563 uri
564 uriScheme
565.fi
566
567.SH VARIABLES
aaf19ab0 568The \fIipptool\fR program maintains a list of variables that can be used in any
f8b3a85b
MS
569literal string or attribute value by specifying "$variable-name". Aside from
570variables defined using the "-d" option or "DEFINE" directive, the following
571pre-defined variables are available:
572.TP 5
573$$
574Inserts a single "$" character.
575.TP 5
576$ENV[name]
577Inserts the value of the named environment variable, or an empty string if the
578environment variable is not defined.
579.TP 5
580$filename
aaf19ab0 581Inserts the filename provided to \fIipptool\fR with the "-f" option.
f8b3a85b
MS
582.TP 5
583$hostname
aaf19ab0 584Inserts the hostname from the URI provided to \fIipptool\fR.
f8b3a85b
MS
585.TP 5
586$job-id
587Inserts the last job-id value returned in a test response or 0 if no job-id has
588been seen.
589.TP 5
590$job-uri
591Inserts the last job-uri value returned in a test response or an empty string if
592no job-uri has been seen.
593.TP 5
594$scheme
aaf19ab0 595Inserts the scheme from the URI provided to \fIipptool\fR.
f8b3a85b
MS
596.TP 5
597$notify-subscription-id
c1420c87 598Inserts the last notify-subscription-id value returned in a test response or 0 if
f8b3a85b
MS
599no notify-subscription-id has been seen.
600.TP 5
601$port
aaf19ab0 602Inserts the port number from the URI provided to \fIipptool\fR.
f8b3a85b
MS
603.TP 5
604$resource
aaf19ab0 605Inserts the resource path from the URI provided to \fIipptool\fR.
f8b3a85b
MS
606.TP 5
607$uri
aaf19ab0 608Inserts the URI provided to \fIipptool\fR.
f8b3a85b
MS
609.TP 5
610$user
611Inserts the current user's login name.
612.TP 5
613$username
aaf19ab0 614Inserts the username from the URI provided to \fIipptool\fR, if any.
f8b3a85b
MS
615
616.SH SEE ALSO
aaf19ab0 617\fIipptool(1)\fR,
f8b3a85b
MS
618.br
619http://localhost:631/help
620
621.SH COPYRIGHT
0fa6c7fa 622Copyright 2007-2013 by Apple Inc.
f8b3a85b 623.\"
61515785 624.\" End of "$Id: ipptoolfile.man 11022 2013-06-06 22:14:09Z msweet $".
f8b3a85b 625.\"