]> git.ipfire.org Git - thirdparty/cups.git/blame - man/ipptoolfile.man
Merge changes from CUPS 1.6svn-r10006.
[thirdparty/cups.git] / man / ipptoolfile.man
CommitLineData
f8b3a85b
MS
1.\"
2.\" "$Id$"
3.\"
aaf19ab0 4.\" ipptoolfile man page for CUPS.
f8b3a85b 5.\"
321d8d57 6.\" Copyright 2010-2011 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.\"
83e08001 14.TH ipptoolfile 5 "CUPS" "13 September 2011" "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
154DELAY seconds
155Specifies a delay before this test will be run.
156.TP 5
157DISPLAY attribute-name
158Specifies that value of the named attribute should be output as part of the
159test report.
160.TP 5
161EXPECT attribute-name [ predicate(s) ]
162.TP 5
163EXPECT ?attribute-name predicate(s)
164.TP 5
165EXPECT !attribute-name
166Specifies that the response must/may/must not include the named attribute.
167Additional requirements can be added as predicates - see the "EXPECT PREDICATES"
168section for more information on predicates.
169.TP 5
170FILE filename
171Specifies a file to include at the end of the request. This is typically used
172when sending a test print file.
173.TP 5
174GROUP tag
175Specifies the group tag for subsequent attributes in the request.
176.TP 5
030ae6a1
MS
177IGNORE-ERRORS yes
178.TP 5
179IGNORE-ERRORS no
180Specifies whether \fIipptool\fR will ignore errors and continue with subsequent
181tests.
182.TP 5
f8b3a85b
MS
183NAME "literal string"
184Specifies the human-readable name of the test.
185.TP 5
186OPERATION operation-code
187Specifies the operation to be performed.
188.TP 5
189REQUEST-ID number
190.TP 5
191REQUEST-ID random
192Specifies the request-id value to use in the request, either an integer or the
193word "random" to use a randomly generated value (the default).
194.TP 5
195RESOURCE path
196Specifies an alternate resource path that is used for the HTTP POST request.
aaf19ab0 197The default is the resource from the URI provided to the \fIipptool\fR program.
f8b3a85b 198.TP 5
030ae6a1
MS
199SKIP-IF-DEFINED variable-name
200.TP 5
201SKIP-IF-NOT-DEFINED variable-name
202Specifies that the current test should be skipped when the variable is or is not
203defined.
204.TP 5
205SKIP-PREVIOUS-ERROR yes
206.TP 5
207SKIP-PREVIOUS-ERROR no
208Specifies whether \fIipptool\fR will skip the current test if the previous test
209resulted in an error/failure.
210.TP 5
f8b3a85b
MS
211STATUS status-code [ predicate ]
212Specifies an expected response status-code value. Additional requirements can be
213added as predicates - see the "STATUS PREDICATES" section for more information
214on predicates.
215.TP 5
216TRANSFER auto
217Specifies that this test will use "Transfer-Encoding: chunked" if it has an
218attached file or "Content-Length:" otherwise.
219.TP 5
220TRANSFER chunked
221Specifies that this test will use the HTTP/1.1 "Transfer-Encoding: chunked"
222header.
223.TP 5
224TRANSFER length
225Specifies that this test will use the HTTP/1.0 "Content-Length:" header.
226.TP 5
227VERSION 1.0
228.TP 5
229VERSION 1.1
230.TP 5
231VERSION 2.0
232.TP 5
233VERSION 2.1
234.TP 5
235VERSION 2.2
236Specifies the IPP version number to use for this test.
237
238.SH EXPECT PREDICATES
239The following predicates are understood following the EXPECT test directive:
240.TP 5
241COUNT number
242Requires the EXPECT attribute to have the specified number of values.
243.TP 5
030ae6a1
MS
244DEFINE-MATCH variable-name
245Defines the variable to "1" when the EXPECT condition matches. A side-effect of
246this predicate is that this EXPECT will never fail a test.
247.TP 5
248DEFINE-NO-MATCH variable-name
249Defines the variable to "1" when the EXPECT condition does not match. A side-
250effect of this predicate is that this EXPECT will never fail a test.
251.TP 5
252DEFINE-VALUE variable-name
253Defines the variable to the value of the attribute when the EXPECT condition
254matches.
255.TP 5
f8b3a85b
MS
256IF-DEFINED variable-name
257Makes the EXPECT conditions apply only if the specified variable is defined.
258.TP 5
7cf5915e 259IF-NOT-DEFINED variable-name
f8b3a85b
MS
260Makes the EXPECT conditions apply only if the specified variable is not
261defined.
262.TP 5
263IN-GROUP tag
264Requires the EXPECT attribute to be in the specified group tag.
265.TP 5
266OF-TYPE tag[,tag,...]
267Requires the EXPECT attribute to use the specified value tag(s).
268.TP 5
83e08001
MS
269REPEAT-MATCH
270.TP 5
271REPEAT-NO-MATCH
272Specifies that the current test should be repeated when the EXPECT condition
273matches or does not match.
274.TP 5
f8b3a85b
MS
275SAME-COUNT-AS attribute-name
276Requires the EXPECT attribute to have the same number of values as the specified
277parallel attribute.
278.TP 5
279WITH-VALUE "literal string"
280Requires at least one value of the EXPECT attribute to match the literal string.
281Comparisons are case-sensitive.
282.TP 5
283WITH-VALUE "/regular expression/"
284Requires that all values of the EXPECT attribute match the regular expression,
285which must conform to the POSIX regular expression syntax.
286Comparisons are case-sensitive.
287
288.SH STATUS PREDICATES
289The following predicates are understood following the STATUS test directive:
290.TP 5
291IF-DEFINED variable-name
292Makes the STATUS apply only if the specified variable is defined.
293.TP 5
7cf5915e 294IF-NOT-DEFINED variable-name
f8b3a85b 295Makes the STATUS apply only if the specified variable is not defined.
83e08001
MS
296.TP 5
297REPEAT-MATCH
298.TP 5
299REPEAT-NO-MATCH
300Specifies that the current test should be repeated when the response status-code
301matches or does not match the value specified by the STATUS directive.
f8b3a85b
MS
302
303.SH OPERATION CODES
aaf19ab0
MS
304Operation codes correspond to the hexadecimal numbers (0xHHHH) and names from
305RFC 2911 and other IPP extension specifications. Here is a complete list:
f8b3a85b
MS
306.nf
307 Activate-Printer
308 CUPS-Accept-Jobs
309 CUPS-Add-Modify-Class
310 CUPS-Add-Modify-Printer
311 CUPS-Authenticate-Job
312 CUPS-Delete-Class
313 CUPS-Delete-Printer
314 CUPS-Get-Classes
315 CUPS-Get-Default
316 CUPS-Get-Devices
317 CUPS-Get-Document
318 CUPS-Get-PPD
319 CUPS-Get-PPDs
320 CUPS-Get-Printers
321 CUPS-Move-Job
322 CUPS-Reject-Jobs
323 CUPS-Set-Default
324 Cancel-Current-Job
325 Cancel-Job
aaf19ab0
MS
326 Cancel-Jobs
327 Cancel-My-Jobs
f8b3a85b 328 Cancel-Subscription
aaf19ab0 329 Close-Job
f8b3a85b
MS
330 Create-Job
331 Create-Job-Subscription
332 Create-Printer-Subscription
333 Deactivate-Printer
334 Disable-Printer
335 Enable-Printer
336 Get-Job-Attributes
337 Get-Jobs
338 Get-Notifications
339 Get-Printer-Attributes
340 Get-Printer-Support-Files
341 Get-Printer-Supported-Values
342 Get-Subscription-Attributes
343 Get-Subscriptions
344 Hold-Job
345 Hold-New-Jobs
346 Pause-Printer
347 Pause-Printer-After-Current-Job
348 Print-Job
349 Print-URI
350 Promote-Job
351 Purge-Jobs
352 Release-Held-New-Jobs
353 Release-Job
354 Renew-Subscription
355 Reprocess-Job
356 Restart-Job
357 Restart-Printer
aaf19ab0 358 Resubmit-Job
f8b3a85b
MS
359 Resume-Job
360 Resume-Printer
361 Schedule-Job-After
362 Send-Document
363 Send-Notifications
364 Send-URI
365 Set-Job-Attributes
366 Set-Printer-Attributes
367 Shutdown-Printer
368 Startup-Printer
369 Suspend-Current-Job
370 Validate-Job
371.fi
372
373.SH STATUS CODES
030ae6a1
MS
374Status codes correspond to the hexadecimal numbers (0xHHHH) and names from RFC
3752911 and other IPP extension specifications. Here is a complete list:
f8b3a85b
MS
376.nf
377 client-error-attributes-not-settable
378 client-error-attributes-or-values-not-supported
379 client-error-bad-request
380 client-error-charset-not-supported
381 client-error-compression-error
382 client-error-compression-not-supported
383 client-error-conflicting-attributes
384 client-error-document-access-error
385 client-error-document-format-error
386 client-error-document-format-not-supported
387 client-error-forbidden
388 client-error-gone
389 client-error-ignored-all-notifications
390 client-error-ignored-all-subscriptions
391 client-error-not-authenticated
392 client-error-not-authorized
393 client-error-not-found
394 client-error-not-possible
395 client-error-print-support-file-not-found
396 client-error-request-entity-too-large
397 client-error-request-value-too-long
398 client-error-timeout
399 client-error-too-many-subscriptions
400 client-error-uri-scheme-not-supported
401 cups-see-other
402 redirection-other-site
403 server-error-busy
404 server-error-device-error
405 server-error-internal-error
406 server-error-job-canceled
407 server-error-multiple-document-jobs-not-supported
408 server-error-not-accepting-jobs
409 server-error-operation-not-supported
410 server-error-printer-is-deactivated
411 server-error-service-unavailable
412 server-error-temporary-error
413 server-error-version-not-supported
414 successful-ok
415 successful-ok-but-cancel-subscription
416 successful-ok-conflicting-attributes
417 successful-ok-events-complete
418 successful-ok-ignored-notifications
419 successful-ok-ignored-or-substituted-attributes
420 successful-ok-ignored-subscriptions
421 successful-ok-too-many-events
422.fi
423
424.SH TAGS
425Value and group tags correspond to the names from RFC 2911 and other IPP
426extension specifications. Here are the group tags:
427.nf
428 event-notification-attributes-tag
429 job-attributes-tag
430 operation-attributes-tag
431 printer-attributes-tag
432 subscription-attributes-tag
433 unsupported-attributes-tag
434.fi
435.LP
436Here are the value tags:
437.nf
438 admin-define
439 boolean
440 charset
441 collection
442 dateTime
443 default
444 delete-attribute
445 enum
446 integer
447 keyword
448 mimeMediaType
449 nameWithLanguage
450 nameWithoutLanguage
451 naturalLanguage
452 no-value
453 not-settable
454 octetString
455 rangeOfInteger
456 resolution
457 textWithLanguage
458 textWithoutLanguage
459 unknown
460 unsupported
461 uri
462 uriScheme
463.fi
464
465.SH VARIABLES
aaf19ab0 466The \fIipptool\fR program maintains a list of variables that can be used in any
f8b3a85b
MS
467literal string or attribute value by specifying "$variable-name". Aside from
468variables defined using the "-d" option or "DEFINE" directive, the following
469pre-defined variables are available:
470.TP 5
471$$
472Inserts a single "$" character.
473.TP 5
474$ENV[name]
475Inserts the value of the named environment variable, or an empty string if the
476environment variable is not defined.
477.TP 5
478$filename
aaf19ab0 479Inserts the filename provided to \fIipptool\fR with the "-f" option.
f8b3a85b
MS
480.TP 5
481$hostname
aaf19ab0 482Inserts the hostname from the URI provided to \fIipptool\fR.
f8b3a85b
MS
483.TP 5
484$job-id
485Inserts the last job-id value returned in a test response or 0 if no job-id has
486been seen.
487.TP 5
488$job-uri
489Inserts the last job-uri value returned in a test response or an empty string if
490no job-uri has been seen.
491.TP 5
492$scheme
aaf19ab0 493Inserts the scheme from the URI provided to \fIipptool\fR.
f8b3a85b
MS
494.TP 5
495$notify-subscription-id
496Inserts the last notify-subscription-id value returnd in a test response or 0 if
497no notify-subscription-id has been seen.
498.TP 5
499$port
aaf19ab0 500Inserts the port number from the URI provided to \fIipptool\fR.
f8b3a85b
MS
501.TP 5
502$resource
aaf19ab0 503Inserts the resource path from the URI provided to \fIipptool\fR.
f8b3a85b
MS
504.TP 5
505$uri
aaf19ab0 506Inserts the URI provided to \fIipptool\fR.
f8b3a85b
MS
507.TP 5
508$user
509Inserts the current user's login name.
510.TP 5
511$username
aaf19ab0 512Inserts the username from the URI provided to \fIipptool\fR, if any.
f8b3a85b
MS
513
514.SH SEE ALSO
aaf19ab0 515\fIipptool(1)\fR,
f8b3a85b
MS
516.br
517http://localhost:631/help
518
519.SH COPYRIGHT
321d8d57 520Copyright 2007-2011 by Apple Inc.
f8b3a85b
MS
521.\"
522.\" End of "$Id$".
523.\"