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