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