]> git.ipfire.org Git - thirdparty/cups.git/blame - doc/help/man-ipptoolfile.html
Merge changes from CUPS 1.7svn-r10755.
[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>
417<dt>IF-DEFINED variable-name
418</dt>
419<dd>Makes the STATUS apply only if the specified variable is defined.
420</dd>
421<dt>IF-NOT-DEFINED variable-name
422</dt>
423<dd>Makes the STATUS apply only if the specified variable is not defined.
424</dd>
a29fd7dd
MS
425<dt>REPEAT-LIMIT number
426</dt>
427<dd></dd>
428<dd>Specifies the maximum number of times to repeat. The default value is 1000.
429</dd>
a2326b5b
MS
430<dt>REPEAT-MATCH
431</dt>
432<dd></dd>
433<dt>REPEAT-NO-MATCH
434</dt>
435<dd>Specifies that the current test should be repeated when the response status-code
436matches or does not match the value specified by the STATUS directive.
437
438</dd>
439</dl>
440<h2 class="title"><a name="OPERATION_CODES">Operation Codes</a></h2>
441Operation codes correspond to the hexadecimal numbers (0xHHHH) and names from
442RFC 2911 and other IPP extension specifications. Here is a complete list:
443<pre>
444 Activate-Printer
445 CUPS-Accept-Jobs
446 CUPS-Add-Modify-Class
447 CUPS-Add-Modify-Printer
448 CUPS-Authenticate-Job
449 CUPS-Delete-Class
450 CUPS-Delete-Printer
451 CUPS-Get-Classes
452 CUPS-Get-Default
453 CUPS-Get-Devices
454 CUPS-Get-Document
455 CUPS-Get-PPD
456 CUPS-Get-PPDs
457 CUPS-Get-Printers
458 CUPS-Move-Job
459 CUPS-Reject-Jobs
460 CUPS-Set-Default
461 Cancel-Current-Job
462 Cancel-Job
463 Cancel-Jobs
464 Cancel-My-Jobs
465 Cancel-Subscription
466 Close-Job
467 Create-Job
468 Create-Job-Subscription
469 Create-Printer-Subscription
470 Deactivate-Printer
471 Disable-Printer
472 Enable-Printer
473 Get-Job-Attributes
474 Get-Jobs
475 Get-Notifications
476 Get-Printer-Attributes
477 Get-Printer-Support-Files
478 Get-Printer-Supported-Values
479 Get-Subscription-Attributes
480 Get-Subscriptions
481 Hold-Job
482 Hold-New-Jobs
82cc1f9a 483 Identify-Printer
a2326b5b
MS
484 Pause-Printer
485 Pause-Printer-After-Current-Job
486 Print-Job
487 Print-URI
488 Promote-Job
489 Purge-Jobs
490 Release-Held-New-Jobs
491 Release-Job
492 Renew-Subscription
493 Reprocess-Job
494 Restart-Job
495 Restart-Printer
496 Resubmit-Job
497 Resume-Job
498 Resume-Printer
499 Schedule-Job-After
500 Send-Document
501 Send-Notifications
502 Send-URI
503 Set-Job-Attributes
504 Set-Printer-Attributes
505 Shutdown-Printer
506 Startup-Printer
507 Suspend-Current-Job
82cc1f9a 508 Validate-Document
a2326b5b
MS
509 Validate-Job
510</pre>
511
512<h2 class="title"><a name="STATUS_CODES">Status Codes</a></h2>
513Status codes correspond to the hexadecimal numbers (0xHHHH) and names from RFC
5142911 and other IPP extension specifications. Here is a complete list:
515<pre>
516 client-error-attributes-not-settable
517 client-error-attributes-or-values-not-supported
518 client-error-bad-request
519 client-error-charset-not-supported
520 client-error-compression-error
521 client-error-compression-not-supported
522 client-error-conflicting-attributes
523 client-error-document-access-error
524 client-error-document-format-error
525 client-error-document-format-not-supported
82cc1f9a
MS
526 client-error-document-password-error
527 client-error-document-permission-error
528 client-error-document-security-error
529 client-error-document-unprintable-error
a2326b5b
MS
530 client-error-forbidden
531 client-error-gone
532 client-error-ignored-all-notifications
533 client-error-ignored-all-subscriptions
534 client-error-not-authenticated
535 client-error-not-authorized
536 client-error-not-found
537 client-error-not-possible
538 client-error-print-support-file-not-found
539 client-error-request-entity-too-large
540 client-error-request-value-too-long
541 client-error-timeout
542 client-error-too-many-subscriptions
543 client-error-uri-scheme-not-supported
544 cups-see-other
545 redirection-other-site
546 server-error-busy
547 server-error-device-error
548 server-error-internal-error
549 server-error-job-canceled
550 server-error-multiple-document-jobs-not-supported
551 server-error-not-accepting-jobs
552 server-error-operation-not-supported
553 server-error-printer-is-deactivated
554 server-error-service-unavailable
555 server-error-temporary-error
556 server-error-version-not-supported
557 successful-ok
558 successful-ok-but-cancel-subscription
559 successful-ok-conflicting-attributes
560 successful-ok-events-complete
561 successful-ok-ignored-notifications
562 successful-ok-ignored-or-substituted-attributes
563 successful-ok-ignored-subscriptions
564 successful-ok-too-many-events
565</pre>
566
567<h2 class="title"><a name="TAGS">Tags</a></h2>
568Value and group tags correspond to the names from RFC 2911 and other IPP
569extension specifications. Here are the group tags:
570<pre>
571 event-notification-attributes-tag
572 job-attributes-tag
573 operation-attributes-tag
574 printer-attributes-tag
575 subscription-attributes-tag
576 unsupported-attributes-tag
577</pre>
578<p>Here are the value tags:
579<pre>
580 admin-define
581 boolean
582 charset
583 collection
584 dateTime
585 default
586 delete-attribute
587 enum
588 integer
589 keyword
590 mimeMediaType
591 nameWithLanguage
592 nameWithoutLanguage
593 naturalLanguage
594 no-value
595 not-settable
596 octetString
597 rangeOfInteger
598 resolution
599 textWithLanguage
600 textWithoutLanguage
601 unknown
602 unsupported
603 uri
604 uriScheme
605</pre>
606
607<h2 class="title"><a name="VARIABLES">Variables</a></h2>
608The <i>ipptool</i> program maintains a list of variables that can be used in any
609literal string or attribute value by specifying "$variable-name". Aside from
610variables defined using the "-d" option or "DEFINE" directive, the following
611pre-defined variables are available:
612<dl>
613<dt>$$
614</dt>
615<dd>Inserts a single "$" character.
616</dd>
617<dt>$ENV[name]
618</dt>
619<dd>Inserts the value of the named environment variable, or an empty string if the
620environment variable is not defined.
621</dd>
622<dt>$filename
623</dt>
624<dd>Inserts the filename provided to <i>ipptool</i> with the "-f" option.
625</dd>
626<dt>$hostname
627</dt>
628<dd>Inserts the hostname from the URI provided to <i>ipptool</i>.
629</dd>
630<dt>$job-id
631</dt>
632<dd>Inserts the last job-id value returned in a test response or 0 if no job-id has
633been seen.
634</dd>
635<dt>$job-uri
636</dt>
637<dd>Inserts the last job-uri value returned in a test response or an empty string if
638no job-uri has been seen.
639</dd>
640<dt>$scheme
641</dt>
642<dd>Inserts the scheme from the URI provided to <i>ipptool</i>.
643</dd>
644<dt>$notify-subscription-id
645</dt>
c1420c87 646<dd>Inserts the last notify-subscription-id value returned in a test response or 0 if
a2326b5b
MS
647no notify-subscription-id has been seen.
648</dd>
649<dt>$port
650</dt>
651<dd>Inserts the port number from the URI provided to <i>ipptool</i>.
652</dd>
653<dt>$resource
654</dt>
655<dd>Inserts the resource path from the URI provided to <i>ipptool</i>.
656</dd>
657<dt>$uri
658</dt>
659<dd>Inserts the URI provided to <i>ipptool</i>.
660</dd>
661<dt>$user
662</dt>
663<dd>Inserts the current user's login name.
664</dd>
665<dt>$username
666</dt>
667<dd>Inserts the username from the URI provided to <i>ipptool</i>, if any.
668
669</dd>
670</dl>
671<h2 class="title"><a name="SEE_ALSO">See Also</a></h2>
672<a href='man-ipptool.html?TOPIC=Man+Pages'>ipptool(1)</a>,
673<br>
674<a href='http://localhost:631/help'>http://localhost:631/help</a>
675
676<h2 class="title"><a name="COPYRIGHT">Copyright</a></h2>
82cc1f9a 677Copyright 2007-2012 by Apple Inc.
a2326b5b
MS
678
679</body>
680</html>