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