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