]> git.ipfire.org Git - thirdparty/cups.git/commitdiff
Merge ipptool fixes and improvements, update man pages.
authorMichael R Sweet <msweet@msweet.org>
Thu, 12 Sep 2024 17:23:50 +0000 (13:23 -0400)
committerMichael R Sweet <msweet@msweet.org>
Thu, 12 Sep 2024 17:23:50 +0000 (13:23 -0400)
doc/help/man-ipptool.html
doc/help/man-ipptoolfile.html
man/ipptool.1
man/ipptoolfile.5
tools/ipptool.c

index 6dcc34b07289e6fb6ba61e95badc4804e7e531d5..03503ed6e25092835fedbe95560764b16d53e8ba 100644 (file)
@@ -14,8 +14,8 @@
 [
 <strong>--help</strong>
 ] [
-<strong>--ippserver</strong>
-<em>filename</em>
+<strong>--ippfile</strong>
+<em>FILENAME</em>
 ] [
 <strong>--stop-after-include-error</strong>
 ] [
 ] [
 <strong>-6</strong>
 ] [
+<strong>-c</strong>
+] [
 <strong>-C</strong>
 ] [
-<strong>-E</strong>
+<strong>-d</strong>
+<em>NAME=VALUE</em>
 ] [
-<strong>-I</strong>
+<strong>-E</strong>
 ] [
-<strong>-L</strong>
+<strong>-f</strong>
+<em>FILENAME</em>
 ] [
-<strong>-P</strong>
-<em>filename.plist</em>
+<strong>-h</strong>
 ] [
-<strong>-S</strong>
+<strong>-i</strong>
+<em>SECONDS</em>
 ] [
-<strong>-T</strong>
-<em>seconds</em>
+<strong>-I</strong>
 ] [
-<strong>-V</strong>
-<em>version</em>
+<strong>-j</strong>
 ] [
-<strong>-X</strong>
+<strong>-L</strong>
 ] [
-<strong>-c</strong>
+<strong>-n</strong>
+<em>REPEAT-COUNT</em>
 ] [
-<strong>-d</strong>
-<em>name=value</em>
+<strong>-P</strong>
+<em>FILENAME.plist</em>
 ] [
-<strong>-f</strong>
-<em>filename</em>
+<strong>-q</strong>
 ] [
-<strong>-h</strong>
+<strong>-R</strong>
 ] [
-<strong>-i</strong>
-<em>seconds</em>
+<strong>-S</strong>
 ] [
-<strong>-j</strong>
+<strong>-t</strong>
 ] [
-<strong>-n</strong>
-<em>repeat-count</em>
+<strong>-T</strong>
+<em>SECONDS</em>
 ] [
-<strong>-q</strong>
+<strong>-v</strong>
 ] [
-<strong>-t</strong>
+<strong>-V</strong>
+<em>VERSION</em>
 ] [
-<strong>-v ]</strong>
-<em>printer-uri</em>
-<em>testfile</em>
+<strong>-X</strong>
+]
+<em>PRINTER-URI</em>
+<em>TESTFILE</em>
 [ ...
-<em>testfile</em>
+<em>TESTFILE</em>
 ]
 </p>
     <h2 id="ipptool-1.description">Description</h2>
@@ -83,7 +86,7 @@ and tests and/or displays the results.
 Each named
 <em>testfile</em>
 defines one or more requests, including the expected response status, attributes, and values.
-Output is either a plain text, formatted text, CSV, or XML report on the standard output, with a non-zero exit status indicating that one or more tests have failed.
+Output is either a plain text, formatted text, CSV, JSON, or XML report on the standard output, with a non-zero exit status indicating that one or more tests have failed.
 The
 <em>testfile</em>
 format is described in
@@ -97,10 +100,11 @@ format is described in
     <p style="margin-left: 2.5em; text-indent: -2.5em;"><strong>--help</strong><br>
 Shows program help.
 </p>
-    <p style="margin-left: 2.5em; text-indent: -2.5em;"><strong>--ippserver </strong><em>filename</em><br>
-Specifies that the test results should be written to the named
-<strong>ippserver</strong>
-attributes file.
+    <p style="margin-left: 2.5em; text-indent: -2.5em;"><strong>--ippfile </strong><em>FILENAME</em><br>
+Specifies that the test results should be written to the named IPP file.
+These files can be used with programs like
+<strong>ippeveprinter</strong>(1).
+
 </p>
     <p style="margin-left: 2.5em; text-indent: -2.5em;"><strong>--stop-after-include-error</strong><br>
 Tells
@@ -123,63 +127,39 @@ must connect to the printer or server using IPv4.
 Specifies that
 <strong>ipptool</strong>
 must connect to the printer or server using IPv6.
+</p>
+    <p style="margin-left: 2.5em; text-indent: -2.5em;"><strong>-c</strong><br>
+Specifies that CSV (comma-separated values) output is desired instead of the plain text output.
 </p>
     <p style="margin-left: 2.5em; text-indent: -2.5em;"><strong>-C</strong><br>
 Specifies that requests should be sent using the HTTP/1.1 &quot;Transfer-Encoding: chunked&quot; header, which is required for conformance by all versions of IPP.
 The default is to use &quot;Transfer-Encoding: chunked&quot; for requests with attached files and &quot;Content-Length:&quot; for requests without attached files.
 </p>
-    <p style="margin-left: 2.5em; text-indent: -2.5em;"><strong>-E</strong><br>
-Forces TLS encryption when connecting to the server using the HTTP &quot;Upgrade&quot; header.
-</p>
-    <p style="margin-left: 2.5em; text-indent: -2.5em;"><strong>-I</strong><br>
-Specifies that
-<strong>ipptool</strong>
-will continue past errors.
-</p>
-    <p style="margin-left: 2.5em; text-indent: -2.5em;"><strong>-L</strong><br>
-Specifies that requests should be sent using the HTTP/1.0 &quot;Content-Length:&quot; header, which is required for conformance by all versions of IPP.
-The default is to use &quot;Transfer-Encoding: chunked&quot; for requests with attached files and &quot;Content-Length:&quot; for requests without attached files.
-</p>
-    <p style="margin-left: 2.5em; text-indent: -2.5em;"><strong>-P</strong><em> filename.plist</em>
-<br>
-Specifies that the test results should be written to the named XML (Apple plist) file in addition to the regular test report (<strong>-t</strong>).
-This option is incompatible with the <strong>-i</strong> (interval) and <strong>-n</strong> (repeat-count) options.
-</p>
-    <p style="margin-left: 2.5em; text-indent: -2.5em;"><strong>-S</strong><br>
-Forces (dedicated) TLS encryption when connecting to the server.
-</p>
-    <p style="margin-left: 2.5em; text-indent: -2.5em;"><strong>-T</strong><em> seconds</em>
-<br>
-Specifies a timeout for IPP requests in seconds.
-</p>
-    <p style="margin-left: 2.5em; text-indent: -2.5em;"><strong>-V</strong><em> version</em>
-<br>
-Specifies the default IPP version to use: 1.0, 1.1, 2.0, 2.1, or 2.2. If not specified, version 1.1 is used.
-</p>
-    <p style="margin-left: 2.5em; text-indent: -2.5em;"><strong>-X</strong><br>
-Specifies that XML (Apple plist) output is desired instead of the plain text report.
-This option is incompatible with the <strong>-i</strong> (interval) and <strong>-n</strong> (repeat-count) options.
-</p>
-    <p style="margin-left: 2.5em; text-indent: -2.5em;"><strong>-c</strong><br>
-Specifies that CSV (comma-separated values) output is desired instead of the plain text output.
-</p>
-    <p style="margin-left: 2.5em; text-indent: -2.5em;"><strong>-d</strong><em> name=value</em>
+    <p style="margin-left: 2.5em; text-indent: -2.5em;"><strong>-d</strong><em> NAME=VALUE</em>
 <br>
 Defines the named variable.
 </p>
-    <p style="margin-left: 2.5em; text-indent: -2.5em;"><strong>-f</strong><em> filename</em>
+    <p style="margin-left: 2.5em; text-indent: -2.5em;"><strong>-E</strong><br>
+Forces TLS encryption when connecting to the server using the HTTP &quot;Upgrade&quot; header.
+</p>
+    <p style="margin-left: 2.5em; text-indent: -2.5em;"><strong>-f</strong><em> FILENAME</em>
 <br>
 Defines the default request filename for tests.
 </p>
     <p style="margin-left: 2.5em; text-indent: -2.5em;"><strong>-h</strong><br>
 Validate HTTP response headers.
 </p>
-    <p style="margin-left: 2.5em; text-indent: -2.5em;"><strong>-i</strong><em> seconds</em>
+    <p style="margin-left: 2.5em; text-indent: -2.5em;"><strong>-i</strong><em> SECONDS</em>
 <br>
 Specifies that the (last)
 <em>testfile</em>
 should be repeated at the specified interval.
-This option is incompatible with the <strong>-X</strong> (XML plist output) option.
+This option is incompatible with the <strong>--ippfile</strong> (IPP file output) and <em>-P</em> or <strong>-X</strong> (XML plist output) options.
+</p>
+    <p style="margin-left: 2.5em; text-indent: -2.5em;"><strong>-I</strong><br>
+Specifies that
+<strong>ipptool</strong>
+will continue past errors.
 </p>
     <p style="margin-left: 2.5em; text-indent: -2.5em;"><strong>-j</strong><br>
 Specifies that
@@ -189,22 +169,46 @@ will produce JSON output.
     <p style="margin-left: 2.5em; text-indent: -2.5em;"><strong>-l</strong><br>
 Specifies that plain text output is desired.
 </p>
-    <p style="margin-left: 2.5em; text-indent: -2.5em;"><strong>-n</strong><em> repeat-count</em>
+    <p style="margin-left: 2.5em; text-indent: -2.5em;"><strong>-L</strong><br>
+Specifies that requests should be sent using the HTTP/1.0 &quot;Content-Length:&quot; header, which is required for conformance by all versions of IPP.
+The default is to use &quot;Transfer-Encoding: chunked&quot; for requests with attached files and &quot;Content-Length:&quot; for requests without attached files.
+</p>
+    <p style="margin-left: 2.5em; text-indent: -2.5em;"><strong>-n</strong><em> REPEAT-COUNT</em>
 <br>
 Specifies that the (last)
 <em>testfile</em>
 should be repeated the specified number of times.
-This option is incompatible with the <em>-X</em> (XML plist output) option.
+This option is incompatible with the <em>--ippfile</em> (IPP file output) and <em>-P</em> or <em>-X</em> (XML plist output) options.
+</p>
+    <p style="margin-left: 2.5em; text-indent: -2.5em;"><strong>-P</strong><em> FILENAME.plist</em>
+<br>
+Specifies that the test results should be written to the named XML (Apple plist) file in addition to the regular test report (<strong>-t</strong>).
+This option is incompatible with the <strong>-i</strong> (interval) and <strong>-n</strong> (repeat-count) options.
 </p>
     <p style="margin-left: 2.5em; text-indent: -2.5em;"><strong>-q</strong><br>
 Be quiet and produce no output.
+</p>
+    <p style="margin-left: 2.5em; text-indent: -2.5em;"><strong>-S</strong><br>
+Forces (dedicated) TLS encryption when connecting to the server.
 </p>
     <p style="margin-left: 2.5em; text-indent: -2.5em;"><strong>-t</strong><br>
 Specifies that CUPS test report output is desired instead of the plain text output.
+</p>
+    <p style="margin-left: 2.5em; text-indent: -2.5em;"><strong>-T</strong><em> SECONDS</em>
+<br>
+Specifies a timeout for IPP requests in SECONDS.
 </p>
     <p style="margin-left: 2.5em; text-indent: -2.5em;"><strong>-v</strong><br>
 Specifies that all request and response attributes should be output in CUPS test mode (<strong>-t</strong>).
-This is the default for XML output.
+This is the default for CSV, JSON, and XML output.
+</p>
+    <p style="margin-left: 2.5em; text-indent: -2.5em;"><strong>-V</strong><em> VERSION</em>
+<br>
+Specifies the default IPP version to use: 1.0, 1.1, 2.0, 2.1, or 2.2. If not specified, version 1.1 is used.
+</p>
+    <p style="margin-left: 2.5em; text-indent: -2.5em;"><strong>-X</strong><br>
+Specifies that XML (Apple plist) output is desired instead of the plain text report.
+This option is incompatible with the <strong>-i</strong> (interval) and <strong>-n</strong> (repeat-count) options.
 </p>
     <h2 id="ipptool-1.exit-status">Exit Status</h2>
 <p>The
@@ -212,39 +216,66 @@ This is the default for XML output.
 program returns 0 if all tests were successful and 1 otherwise.
 </p>
     <h2 id="ipptool-1.files">Files</h2>
-<p>The following standard files are available:
+<p>The following standard test files are available:
+</p>
+    <pre>
+    cancel-current-job.test           - Cancel the current job
+    create-job.test                   - Create a job and send a document
+    create-job-sheets.test            - &quot;&quot; with banner
+    create-job-timeout.test           - &quot;&quot; with timeout
+    create-printer-subscription.test  - Create a printer subscription
+    cups-create-local-printer.test    - Create a local print queue
+    fax-job.test                      - Fax a file (for fax queues)
+    get-completed-jobs.test           - Get a list of completed jobs
+    get-job-attributes.test           - Get attributes for a job
+    get-job-template-attributes.test  - Get job ticket attributes for a printer
+    get-jobs.test                     - Get a list of not-completed jobs
+    get-notifications.test            - Get notifications for a subscription
+    get-printer-attributes.test       - Get attributes for a printer
+    get-printer-attributes-suite.test - Test Get-Printer-Attributes conformance
+    get-printers.test                 - Get a list of printers
+    get-subscriptions.test            - Get a list of subscriptions
+    identify-printer.test             - Identify a printer
+    identify-printer-display.test     - Identify a printer via the display
+    ipp-1.1.test                      - Run IPP/1.1 conformance tests
+    ipp-2.0.test                      - Run IPP/2.0 conformance tests
+    ipp-2.1.test                      - Run IPP/2.1 conformance tests
+    ipp-2.2.test                      - Run IPP/2.2 conformance tests
+    print-job.test                    - Print a file
+    print-job-and-wait.test           - Print a file and wait for completion
+    print-job-deflate.test            - Print a file with deflate compression
+    print-job-gzip.test               - Print a file with gzip compression
+    print-job-hold.test               - Print a file and hold
+    print-job-letter.test             - Print a file on US Letter media
+    print-job-manual.test             - Print a file with manual feed
+    print-job-media-col.test          - Print a file using &quot;media-col&quot;
+    print-job-media-needed.test       - Print a file and test for &quot;media-needed&quot;
+    print-job-password.test           - Print a file with a password/PIN
+    print-job-raster.test             - Print a generated raster file
+    print-uri.test                    - Print a URI/URL
+    set-attrs-hold.test               - Test setting job-hold-until to hold a job
+    validate-job.test                 - Validate a job ticket
+</pre>
+    <p>The following standard document files are available:
 </p>
     <pre>
-    color.jpg
-    create-printer-subscription.test
-    document-a4.pdf
-    document-a4.ps
-    document-letter.pdf
-    document-letter.ps
-    get-completed-jobs.test
-    get-jobs.test
-    get-notifications.test
-    get-printer-attributes.test
-    get-subscriptions.test
-    gray.jpg
-    ipp-1.1.test
-    ipp-2.0.test
-    ipp-2.1.test
-    ipp-2.2.test
-    ipp-everywhere.test
-    onepage-a4.pdf
-    onepage-a4.ps
-    onepage-letter.pdf
-    onepage-letter.ps
-    print-job.test
-    print-job-deflate.test
-    print-job-gzip.test
-    testfile.jpg
-    testfile.pcl
-    testfile.pdf
-    testfile.ps
-    testfile.txt
-    validate-job.test
+    color.jpg                         - A color photo of a flower
+    document-a4.pdf                   - A 4-page A4 PDF document
+    document-a4.ps                    - A 4-page A4 PostScript document
+    document-letter.pdf               - A 4-page US Letter PDF document
+    document-letter.ps                - A 4-page US Letter PostScript document
+    gray.jpg                          - A grayscale photo of an Alcatraz doorway
+    onepage-a4-300-black-1.pwg        - A one page A4 PWG Raster document
+    onepage-a4.pdf                    - A one page A4 PDF document
+    onepage-a4.ps                     - A one page A4 PostScript document
+    onepage-letter-300-black-1.pwg    - A one page US Letter PWG Raster document
+    onepage-letter.pdf                - A one page US Letter PDF document
+    onepage-letter.ps                 - A one page US Letter PostScript document
+    testfile.jpg                      - A color photo collage
+    testfile.pcl                      - A HP-PCL homage to &quot;The Shining&quot;
+    testfile.pdf                      - A historical CUPS PDF document
+    testfile.ps                       - A historical CUPS PostScript document
+    testfile.txt                      - A plain text homage to &quot;The Shining&quot;
 </pre>
     <h2 id="ipptool-1.conforming-to">Conforming To</h2>
 <p>The
@@ -267,10 +298,10 @@ program is unique to CUPS and conforms to the Internet Printing Protocol up to v
 <p><strong>ipptoolfile</strong>(5),
 
 IANA IPP Registry (<a href="https://www.iana.org/assignments/ipp-registrations">https://www.iana.org/assignments/ipp-registrations</a>),
-PWG Internet Printing Protocol Workgroup (<a href="https://www.pwg.org/ipp">https://www.pwg.org/ipp</a>)
-RFC 8011 (<a href="https://datatracker.ietf.org/doc/html/rfc8011">https://datatracker.ietf.org/doc/html/rfc8011</a>),
+PWG Internet Printing Protocol Workgroup (<a href="https://www.pwg.org/ipp">https://www.pwg.org/ipp</a>),
+RFC 8011 (<a href="https://datatracker.ietf.org/doc/html/rfc8011">https://datatracker.ietf.org/doc/html/rfc8011</a>)
 </p>
     <h2 id="ipptool-1.copyright">Copyright</h2>
-<p>Copyright &copy; 2020-2024 by OpenPrinting.
+<p>Copyright &copy; 2021-2024 by OpenPrinting.
   </body>
 </html>
index 5caaf56b9a80a4e92fa60ff89e39bf63e7250499..94b6f983bfec46b9400409f50290889eeee7e1c6 100644 (file)
@@ -172,7 +172,11 @@ Specifies the default IPP version number to use for the tests that follow.
 </p>
     <p style="margin-left: 2.5em; text-indent: -2.5em;"><strong>ATTR </strong><em>out-of-band-tag attribute-name</em><br>
 </p>
-    <p style="margin-left: 2.5em; text-indent: -2.5em;"><strong>ATTR </strong><em>tag attribute-name value(s)</em><br>
+    <p style="margin-left: 2.5em; text-indent: -2.5em;"><strong>ATTR </strong><em>tag attribute-name value[,...,value]</em><br>
+</p>
+    <p style="margin-left: 2.5em; text-indent: -2.5em;"><strong>ATTR </strong><em>tag attribute-name &quot;value&quot;[,...,&quot;value&quot;]</em><br>
+</p>
+    <p style="margin-left: 2.5em; text-indent: -2.5em;"><strong>ATTR </strong><em>tag attribute-name &lt;hex-value>[,...,&lt;hex-value>]</em><br>
 Adds an attribute to the test request.
 Out-of-band tags (admin-define, delete-attribute, no-value, not-settable, unknown, unsupported) have no value.
 Values for other tags are delimited by the comma (&quot;,&quot;) character - escape commas using the &quot;\&quot; character.
@@ -193,7 +197,6 @@ Uses the specified compression on the document data following the attributes in
     <p style="margin-left: 2.5em; text-indent: -2.5em;"><strong>DELAY </strong><em>seconds</em>[<em>,repeat-seconds</em>]<br>
 Specifies a delay in seconds before this test will be run.
 If two values are specified, the second value is used as the delay between repeated tests.
-A default repeat interval of 5 seconds is used if this directive is not provided.
 </p>
     <p style="margin-left: 2.5em; text-indent: -2.5em;"><strong>DISPLAY </strong><em>attribute-name</em><br>
 Specifies that value of the named attribute should be output as part of the
@@ -213,6 +216,12 @@ Specifies that the response must/may include the named attribute and that all oc
 </p>
     <p style="margin-left: 2.5em; text-indent: -2.5em;"><strong>FILE filename</strong><br>
 Specifies a file to include at the end of the request. This is typically used when sending a test print file.
+</p>
+    <p style="margin-left: 2.5em; text-indent: -2.5em;"><strong>GENERATE-FILE { </strong><em>parameters</em><strong> }</strong><br>
+Specifies that
+<strong>ipptool</strong>
+should generate PWG or Apple raster data for the printer.
+See the &quot;GENERATE-FILE PARAMETERS&quot; section for information on the parameters you can specify.
 </p>
     <p style="margin-left: 2.5em; text-indent: -2.5em;"><strong>GROUP tag</strong><br>
 Specifies the group tag for subsequent attributes in the request.
@@ -338,11 +347,48 @@ Specifies that the current test should be repeated when the <strong>EXPECT</stro
 </p>
     <p style="margin-left: 2.5em; text-indent: -2.5em;"><strong>SAME-COUNT-AS </strong><em>attribute-name</em><br>
 Requires the <strong>EXPECT</strong> attribute to have the same number of values as the specified parallel attribute.
+</p>
+    <p style="margin-left: 2.5em; text-indent: -2.5em;"><strong>SAVE-CONTENT </strong><em>filespec</em><br>
+</p>
+    <p style="margin-left: 2.5em; text-indent: -2.5em;"><strong>SAVE-ALL-CONTENT </strong><em>filespec</em><br>
+Saves all &quot;http&quot; or &quot;https&quot; URI values to the specified location.
+The filespec value is a filename or directory path and can contain the special strings &quot;%basename%&quot; to insert the base filename from the URI, &quot;%ext%&quot; to insert the extension from the URI, and &quot;%index%&quot; to insert the value number starting at 1.
+</p>
+    <p style="margin-left: 2.5em; text-indent: -2.5em;"><strong>WITH-ALL-CONTENT available</strong><br>
+</p>
+    <p style="margin-left: 2.5em; text-indent: -2.5em;"><strong>WITH-CONTENT available</strong><br>
+Requires that all URI values be accessible.
+A &quot;http&quot; or &quot;https&quot; URI must respond to a GET request while a &quot;ipp&quot; or &quot;ipps&quot; URI must respond to a HEAD request.
+</p>
+    <p style="margin-left: 2.5em; text-indent: -2.5em;"><strong>WITH-ALL-CONTENT valid</strong><br>
+</p>
+    <p style="margin-left: 2.5em; text-indent: -2.5em;"><strong>WITH-CONTENT valid</strong><br>
+Requires that all &quot;http&quot; and &quot;https&quot; URI values be accessible and provide valid content.
+Currently
+<strong>ipptool</strong>
+is able to validate CSS, HTML, ICC, IPP, JPEG, PDF, PNG, and Apple .strings files.
+</p>
+    <p style="margin-left: 2.5em; text-indent: -2.5em;"><strong>WITH-ALL-CONTENT valid-icon</strong><br>
+</p>
+    <p style="margin-left: 2.5em; text-indent: -2.5em;"><strong>WITH-CONTENT valid-icon</strong><br>
+Requires that all &quot;http&quot; and &quot;https&quot; URI values be accessible and provide valid PNG images for icons - 48x48, 128x128, or 512x512 in size with transparency.
 </p>
     <p style="margin-left: 2.5em; text-indent: -2.5em;"><strong>WITH-ALL-HOSTNAMES &quot;</strong><em>literal string</em><strong>&quot;</strong><br>
 </p>
     <p style="margin-left: 2.5em; text-indent: -2.5em;"><strong>WITH-ALL-HOSTNAMES &quot;/</strong><em>regular expression</em><strong>/&quot;</strong><br>
 Requires that all URI values contain a matching hostname.
+</p>
+    <p style="margin-left: 2.5em; text-indent: -2.5em;"><strong>WITH-ALL-MIME-TYPES </strong><em>mime/type[,...,mime/type]</em><br>
+</p>
+    <p style="margin-left: 2.5em; text-indent: -2.5em;"><strong>WITH-MIME-TYPES </strong><em>mime/type[,...,mime/type]</em><br>
+Requires that all URI values provide one of the listed MIME media types.
+For non-content tests, the target Printer must respond to HTTP HEAD requests with the MIME media type that would be returned by a GET or POST requests.
+For &quot;http&quot; and &quot;https&quot; content tests,
+<strong>ipptool</strong>
+sends a HTTP GET request.
+For &quot;ipp&quot; and &quot;ipps&quot; content tests,
+<strong>ipptool</strong>
+sends an IPP Get-Printer-Attributes request.
 </p>
     <p style="margin-left: 2.5em; text-indent: -2.5em;"><strong>WITH-ALL-RESOURCES &quot;</strong><em>literal string</em><strong>&quot;</strong><br>
 </p>
@@ -374,6 +420,10 @@ Requires that all values of the <strong>EXPECT</strong> attribute match the bool
     <p style="margin-left: 2.5em; text-indent: -2.5em;"><strong>WITH-ALL-VALUES &quot;/</strong><em>regular expression</em><strong>/&quot;</strong><br>
 Requires that all values of the <strong>EXPECT</strong> attribute match the regular expression, which must conform to the POSIX regular expression syntax.
 Comparisons are case-sensitive.
+</p>
+    <p style="margin-left: 2.5em; text-indent: -2.5em;"><strong>WITH-ALL-VALUES-FROM </strong><em>attribute-name</em><br>
+Requires that all value(s) of the <strong>EXPECT</strong> attribute matches the value(s) in the specified attribute.
+For example, &quot;EXPECT-ALL media-col-database/media-source WITH-ALL-VALUES-FROM media-source-supported&quot; requires that all the &quot;media-source&quot; values are listed as a value of the &quot;media-source-supported&quot; attribute.
 </p>
     <p style="margin-left: 2.5em; text-indent: -2.5em;"><strong>WITH-DISTINCT-VALUES</strong><br>
 Requires that all values of the <strong>EXPECT</strong> attribute are unique.
@@ -675,6 +725,12 @@ Inserts a single &quot;$&quot; character.
 </p>
     <p style="margin-left: 2.5em; text-indent: -2.5em;"><strong>$ENV[</strong><em>name</em><strong>]</strong><br>
 Inserts the value of the named environment variable, or an empty string if the environment variable is not defined.
+</p>
+    <p style="margin-left: 2.5em; text-indent: -2.5em;"><strong>$basename</strong><br>
+Inserts the base filename (without directory path) of the path provided to
+<strong>ipptool</strong>(8)
+
+with the <em>-f</em> option.
 </p>
     <p style="margin-left: 2.5em; text-indent: -2.5em;"><strong>$date-current</strong><br>
 Inserts the current date and time using the ISO-8601 format (&quot;yyyy-mm-ddThh:mm:ssZ&quot;).
@@ -737,14 +793,131 @@ if any.
     <p style="margin-left: 2.5em; text-indent: -2.5em;"><strong>$user</strong><br>
 Inserts the current user's login name.
 </p>
+    <h2 id="ipptoolfile-5.generate-file-parameters">Generate-File Parameters</h2>
+<p>The
+<strong>GENERATE-FILE</strong>
+directive dynamically generates raster pages for the destination printer.
+Each page consists of a black border and the text &quot;TEST-PAGE ####&quot; repeated in the interior in several shades of gray and colors.
+The following parameters are supported:
+</p>
+    <p style="margin-left: 2.5em; text-indent: -2.5em;"><strong>COLORSPACE auto</strong><br>
+</p>
+    <p style="margin-left: 2.5em; text-indent: -2.5em;"><strong>COLORSPACE bi-level</strong><br>
+</p>
+    <p style="margin-left: 2.5em; text-indent: -2.5em;"><strong>COLORSPACE color</strong><br>
+</p>
+    <p style="margin-left: 2.5em; text-indent: -2.5em;"><strong>COLORSPACE monochrome</strong><br>
+</p>
+    <p style="margin-left: 2.5em; text-indent: -2.5em;"><strong>COLORSPACE </strong><em>colorspace_bits</em><br>
+Specifies the output color space and bit depth.
+&quot;auto&quot; chooses an available combination with preference for full color, &quot;bi-level&quot; chooses a B&amp;W (bitmap) color space, &quot;color&quot; chooses a full color combination, and &quot;monochrome&quot; chooses a grayscale combination.
+Otherwise, the value must be one of the registered IPP &quot;pwg-raster-document-type-supported&quot; keywords.
+<em>NOTE:</em> The &quot;device N&quot; color spaces are not current supported.
+</p>
+    <p style="margin-left: 2.5em; text-indent: -2.5em;"><strong>FORMAT image/pwg-raster</strong><br>
+</p>
+    <p style="margin-left: 2.5em; text-indent: -2.5em;"><strong>FORMAT image/urf</strong><br>
+Specifies the raster format to use, either &quot;image/pwg-raster&quot; (PWG Raster) or &quot;image/urf&quot; (Apple Raster).
+The default is &quot;image/urf&quot; if supported, &quot;image/pwg-raster&quot; otherwise.
+</p>
+    <p style="margin-left: 2.5em; text-indent: -2.5em;"><strong>MEDIA default</strong><br>
+</p>
+    <p style="margin-left: 2.5em; text-indent: -2.5em;"><strong>MEDIA ready</strong><br>
+</p>
+    <p style="margin-left: 2.5em; text-indent: -2.5em;"><strong>MEDIA </strong><em>media-size-name</em><br>
+Specifies the output media size.
+&quot;default&quot; uses the printer's default media size while &quot;ready&quot; uses the first ready (loaded) media reported by the printer.
+Other media size names must conform the PWG self-describing media size format.
+</p>
+    <p style="margin-left: 2.5em; text-indent: -2.5em;"><strong>NUM-COPIES </strong><em>copies</em><br>
+Specifies the number of copies to produce.
+The default is 1 copy.
+</p>
+    <p style="margin-left: 2.5em; text-indent: -2.5em;"><strong>NUM-PAGES </strong><em>pages</em><br>
+Specifies the number of pages to produce.
+The default is 1 page for single-sided output and 2 pages for double-sided output.
+</p>
+    <p style="margin-left: 2.5em; text-indent: -2.5em;"><strong>ORIENTATION landscape</strong><br>
+</p>
+    <p style="margin-left: 2.5em; text-indent: -2.5em;"><strong>ORIENTATION portrait</strong><br>
+</p>
+    <p style="margin-left: 2.5em; text-indent: -2.5em;"><strong>ORIENTATION reverse-landscape</strong><br>
+</p>
+    <p style="margin-left: 2.5em; text-indent: -2.5em;"><strong>ORIENTATION reverse-portrait</strong><br>
+Specifies the orientation of the output.
+The default is &quot;portrait&quot;.
+</p>
+    <p style="margin-left: 2.5em; text-indent: -2.5em;"><strong>RESOLUTION default</strong><br>
+</p>
+    <p style="margin-left: 2.5em; text-indent: -2.5em;"><strong>RESOLUTION max</strong><br>
+</p>
+    <p style="margin-left: 2.5em; text-indent: -2.5em;"><strong>RESOLUTION min</strong><br>
+</p>
+    <p style="margin-left: 2.5em; text-indent: -2.5em;"><strong>RESOLUTION </strong><em>resolution</em><strong>dpcm</strong><br>
+</p>
+    <p style="margin-left: 2.5em; text-indent: -2.5em;"><strong>RESOLUTION </strong><em>horzontal</em><strong>x</strong><em>vertical</em><strong>dpcm</strong><br>
+</p>
+    <p style="margin-left: 2.5em; text-indent: -2.5em;"><strong>RESOLUTION </strong><em>resolution</em><strong>dpi</strong><br>
+</p>
+    <p style="margin-left: 2.5em; text-indent: -2.5em;"><strong>RESOLUTION </strong><em>horizontal</em><strong>x</strong><em>vertical</em><strong>dpi</strong><br>
+Specifies the output resolution using the printer's supported resolutions or as specified in dots per inch or dots per centimeter.
+&quot;default&quot; uses the median resolution of the printer and is the default, &quot;min&quot; uses the lowest resolution of the printer, and &quot;max&quot; uses the highest resolution of the printer.
+</p>
+    <p style="margin-left: 2.5em; text-indent: -2.5em;"><strong> SIDES one-sided</strong><br>
+</p>
+    <p style="margin-left: 2.5em; text-indent: -2.5em;"><strong> SIDES two-sided-long-edge</strong><br>
+</p>
+    <p style="margin-left: 2.5em; text-indent: -2.5em;"><strong> SIDES two-sided-short-edge</strong><br>
+Specifies whether to print on one or both sides of the media.
+The default is &quot;two-sided-long-edge&quot; for portrait output and &quot;two-sided-short-edge&quot; for landscape output when supported by the printer, otherwise &quot;one-sided&quot; is used.
+</p>
+    <h2 id="ipptoolfile-5.examples">Examples</h2>
+<p>Query the &quot;foo-default&quot; and &quot;foo-supported&quot; Printer Description attributes and validate that all of its values are 'bar', 'baz', or 'none':
+</p>
+    <pre>{
+  NAME &quot;Validate 'foo' Attribute&quot;
+  OPERATION Get-Printer-Attributes
+  GROUP operation-attributes-tag
+  ATTR charset attributes-charset utf-8
+  ATTR language attributes-natural-language en
+  ATTR uri printer-uri $uri
+  ATTR keyword requested-attributes foo-default,foo-supported
+  EXPECT foo-default OF-TYPE keyword IN-GROUP printer-attributes-tag
+      COUNT 1 WITH-VALUE &quot;/^(bar|baz|none)$$/&quot;
+  EXPECT foo-supported OF-TYPE keyword IN-GROUP printer-attributes-tag
+      WITH-ALL-VALUES &quot;/^(bar|baz|none)$$/&quot;
+}
+</pre>
+<p>Query the &quot;media-col-ready&quot; Printer Status attribute and validate that the collection values contain &quot;media-size&quot; and &quot;media-source&quot; member attributes:
+</p>
+    <pre>{
+  NAME &quot;Validate 'foo' Attribute&quot;
+  OPERATION Get-Printer-Attributes
+  GROUP operation-attributes-tag
+  ATTR charset attributes-charset utf-8
+  ATTR language attributes-natural-language en
+  ATTR uri printer-uri $uri
+  ATTR keyword requested-attributes media-col-ready
+  EXPECT media-col-ready OF-TYPE collection IN-GROUP printer-attributes-tag
+  EXPECT-ALL media-col-ready/media-size OF-TYPE collection COUNT 1
+  EXPECT-ALL media-col-ready/media-size/x-dimension OF-TYPE integer(1:MAX) COUNT 1
+  EXPECT-ALL media-col-ready/media-size/y-dimension OF-TYPE integer(0:MAX) COUNT 1
+  EXPECT-ALL media-col-ready/media-source OF-TYPE keyword|name COUNT 1
+}
+</pre>
     <h2 id="ipptoolfile-5.see-also">See Also</h2>
-<p><strong>ipptool</strong>(1),
+<p><strong>ipptool</strong>(1)
 
-IANA IPP Registry (<a href="https://www.iana.org/assignments/ipp-registrations">https://www.iana.org/assignments/ipp-registrations</a>),
-PWG Internet Printing Protocol Workgroup (<a href="https://www.pwg.org/ipp">https://www.pwg.org/ipp</a>),
-RFC 8011 (<a href="https://datatracker.ietf.org/doc/html/rfc8011">https://datatracker.ietf.org/doc/html/rfc8011</a>)
+</p>
+    <p>IANA IPP Registry (<a href="https://www.iana.org/assignments/ipp-registrations">https://www.iana.org/assignments/ipp-registrations</a>)
+</p>
+    <p>PWG Internet Printing Protocol Workgroup (<a href="https://www.pwg.org/ipp">https://www.pwg.org/ipp</a>)
+</p>
+    <p>PWG 5101.1-2023: PWG Media Standardized Names v2.1 (<a href="https://ftp.pwg.org/pub/pwg/candidates/cs-pwgmsn21-20230915-5101.1.pdf">https://ftp.pwg.org/pub/pwg/candidates/cs-pwgmsn21-20230915-5101.1.pdf</a>)
+</p>
+    <p>RFC 8011 (<a href="https://datatracker.ietf.org/doc/html/rfc8011">https://datatracker.ietf.org/doc/html/rfc8011</a>)
 </p>
     <h2 id="ipptoolfile-5.copyright">Copyright</h2>
-<p>Copyright &copy; 2020-2024 by OpenPrinting.
+<p>Copyright &copy; 2021-2024 by OpenPrinting.
   </body>
 </html>
index b0a751a253563f6d0bdac667fd62dad8e73b2e97..e46ecbc8d440948a7afa864287c23ab7d521edba 100644 (file)
@@ -1,13 +1,13 @@
 .\"
 .\" ipptool man page.
 .\"
-.\" Copyright © 2020-2024 by OpenPrinting.
+.\" Copyright © 2021-2024 by OpenPrinting.
 .\" Copyright © 2010-2019 by Apple Inc.
 .\"
 .\" Licensed under Apache License v2.0.  See the file "LICENSE" for more
 .\" information.
 .\"
-.TH ipptool 1 "CUPS" "2021-10-20" "OpenPrinting"
+.TH ipptool 1 "CUPS" "2024-09-12" "OpenPrinting"
 .SH NAME
 ipptool \- perform internet printing protocol requests
 .SH SYNOPSIS
@@ -15,8 +15,8 @@ ipptool \- perform internet printing protocol requests
 [
 .B \-\-help
 ] [
-.B \-\-ippserver
-.I filename
+.B \-\-ippfile
+.I FILENAME
 ] [
 .B \-\-stop\-after\-include\-error
 ] [
@@ -26,54 +26,57 @@ ipptool \- perform internet printing protocol requests
 ] [
 .B \-6
 ] [
+.B \-c
+] [
 .B \-C
 ] [
-.B \-E
+.B \-d
+.I NAME=VALUE
 ] [
-.B \-I
+.B \-E
 ] [
-.B \-L
+.B \-f
+.I FILENAME
 ] [
-.B \-P
-.I filename.plist
+.B \-h
 ] [
-.B \-S
+.B \-i
+.I SECONDS
 ] [
-.B \-T
-.I seconds
+.B \-I
 ] [
-.B \-V
-.I version
+.B \-j
 ] [
-.B \-X
+.B \-L
 ] [
-.B \-c
+.B \-n
+.I REPEAT-COUNT
 ] [
-.B \-d
-.I name=value
+.B \-P
+.I FILENAME.plist
 ] [
-.B \-f
-.I filename
+.B \-q
 ] [
-.B \-h
+.B \-R
 ] [
-.B \-i
-.I seconds
+.B \-S
 ] [
-.B \-j
+.B \-t
 ] [
-.B \-n
-.I repeat-count
+.B \-T
+.I SECONDS
 ] [
-.B \-q
+.B \-v
 ] [
-.B \-t
+.B \-V
+.I VERSION
 ] [
-.B \-v ]
-.I printer-uri
-.I testfile
+.B \-X
+]
+.I PRINTER-URI
+.I TESTFILE
 [ ...
-.I testfile
+.I TESTFILE
 ]
 .SH DESCRIPTION
 .B ipptool
@@ -83,7 +86,7 @@ and tests and/or displays the results.
 Each named
 .I testfile
 defines one or more requests, including the expected response status, attributes, and values.
-Output is either a plain text, formatted text, CSV, or XML report on the standard output, with a non-zero exit status indicating that one or more tests have failed.
+Output is either a plain text, formatted text, CSV, JSON, or XML report on the standard output, with a non-zero exit status indicating that one or more tests have failed.
 The
 .I testfile
 format is described in
@@ -95,10 +98,10 @@ The following options are recognized by
 .B \-\-help
 Shows program help.
 .TP 5
-\fB\-\-ippserver \fIfilename\fR
-Specifies that the test results should be written to the named
-.B ippserver
-attributes file.
+\fB\-\-ippfile \fIFILENAME\fR
+Specifies that the test results should be written to the named IPP file.
+These files can be used with programs like
+.BR ippeveprinter (1).
 .TP 5
 .B \-\-stop-after-include-error
 Tells
@@ -122,56 +125,35 @@ Specifies that
 .B ipptool
 must connect to the printer or server using IPv6.
 .TP 5
+.B \-c
+Specifies that CSV (comma\-separated values) output is desired instead of the plain text output.
+.TP 5
 .B \-C
 Specifies that requests should be sent using the HTTP/1.1 "Transfer\-Encoding: chunked" header, which is required for conformance by all versions of IPP.
 The default is to use "Transfer\-Encoding: chunked" for requests with attached files and "Content\-Length:" for requests without attached files.
 .TP 5
+.BI \-d \ NAME=VALUE
+Defines the named variable.
+.TP 5
 .B \-E
 Forces TLS encryption when connecting to the server using the HTTP "Upgrade" header.
 .TP 5
-.B \-I
-Specifies that
-.B ipptool
-will continue past errors.
-.TP 5
-.B \-L
-Specifies that requests should be sent using the HTTP/1.0 "Content\-Length:" header, which is required for conformance by all versions of IPP.
-The default is to use "Transfer\-Encoding: chunked" for requests with attached files and "Content\-Length:" for requests without attached files.
-.TP 5
-.BI \-P \ filename.plist
-Specifies that the test results should be written to the named XML (Apple plist) file in addition to the regular test report (\fB\-t\fR).
-This option is incompatible with the \fB\-i\fR (interval) and \fB\-n\fR (repeat\-count) options.
-.TP 5
-.B \-S
-Forces (dedicated) TLS encryption when connecting to the server.
-.TP 5
-.BI \-T \ seconds
-Specifies a timeout for IPP requests in seconds.
-.TP 5
-.BI \-V \ version
-Specifies the default IPP version to use: 1.0, 1.1, 2.0, 2.1, or 2.2. If not specified, version 1.1 is used.
-.TP 5
-.B \-X
-Specifies that XML (Apple plist) output is desired instead of the plain text report.
-This option is incompatible with the \fB\-i\fR (interval) and \fB\-n\fR (repeat\-count) options.
-.TP 5
-.B \-c
-Specifies that CSV (comma\-separated values) output is desired instead of the plain text output.
-.TP 5
-.BI \-d \ name=value
-Defines the named variable.
-.TP 5
-.BI \-f \ filename
+.BI \-f \ FILENAME
 Defines the default request filename for tests.
 .TP 5
 .B \-h
 Validate HTTP response headers.
 .TP 5
-.BI \-i \ seconds
+.BI \-i \ SECONDS
 Specifies that the (last)
 .I testfile
 should be repeated at the specified interval.
-This option is incompatible with the \fB\-X\fR (XML plist output) option.
+This option is incompatible with the \fB\-\-ippfile\fR (IPP file output) and \fI\-P\fR or \fB\-X\fR (XML plist output) options.
+.TP 5
+.B \-I
+Specifies that
+.B ipptool
+will continue past errors.
 .TP 5
 .B \-j
 Specifies that
@@ -181,59 +163,108 @@ will produce JSON output.
 .B \-l
 Specifies that plain text output is desired.
 .TP 5
-.BI \-n \ repeat\-count
+.B \-L
+Specifies that requests should be sent using the HTTP/1.0 "Content\-Length:" header, which is required for conformance by all versions of IPP.
+The default is to use "Transfer\-Encoding: chunked" for requests with attached files and "Content\-Length:" for requests without attached files.
+.TP 5
+.BI \-n \ REPEAT\-COUNT
 Specifies that the (last)
 .I testfile
 should be repeated the specified number of times.
-This option is incompatible with the \fI\-X\fR (XML plist output) option.
+This option is incompatible with the \fI\-\-ippfile\fR (IPP file output) and \fI\-P\fR or \fI\-X\fR (XML plist output) options.
+.TP 5
+.BI \-P \ FILENAME.plist
+Specifies that the test results should be written to the named XML (Apple plist) file in addition to the regular test report (\fB\-t\fR).
+This option is incompatible with the \fB\-i\fR (interval) and \fB\-n\fR (repeat-count) options.
 .TP 5
 .B \-q
 Be quiet and produce no output.
 .TP 5
+.B \-S
+Forces (dedicated) TLS encryption when connecting to the server.
+.TP 5
 .B \-t
 Specifies that CUPS test report output is desired instead of the plain text output.
 .TP 5
+.BI \-T \ SECONDS
+Specifies a timeout for IPP requests in SECONDS.
+.TP 5
 .B \-v
 Specifies that all request and response attributes should be output in CUPS test mode (\fB\-t\fR).
-This is the default for XML output.
+This is the default for CSV, JSON, and XML output.
+.TP 5
+.BI \-V \ VERSION
+Specifies the default IPP version to use: 1.0, 1.1, 2.0, 2.1, or 2.2. If not specified, version 1.1 is used.
+.TP 5
+.B \-X
+Specifies that XML (Apple plist) output is desired instead of the plain text report.
+This option is incompatible with the \fB\-i\fR (interval) and \fB\-n\fR (repeat\-count) options.
 .SH EXIT STATUS
 The
 .B ipptool
 program returns 0 if all tests were successful and 1 otherwise.
 .SH FILES
-The following standard files are available:
+The following standard test files are available:
+.nf
+
+    cancel\-current\-job.test           - Cancel the current job
+    create\-job.test                   - Create a job and send a document
+    create\-job\-sheets.test            - "" with banner
+    create\-job\-timeout.test           - "" with timeout
+    create\-printer\-subscription.test  - Create a printer subscription
+    cups\-create\-local\-printer.test    - Create a local print queue
+    fax\-job.test                      - Fax a file (for fax queues)
+    get\-completed\-jobs.test           - Get a list of completed jobs
+    get\-job\-attributes.test           - Get attributes for a job
+    get\-job\-template\-attributes.test  - Get job ticket attributes for a printer
+    get\-jobs.test                     - Get a list of not-completed jobs
+    get\-notifications.test            - Get notifications for a subscription
+    get\-printer\-attributes.test       - Get attributes for a printer
+    get\-printer\-attributes\-suite.test - Test Get-Printer-Attributes conformance
+    get\-printers.test                 - Get a list of printers
+    get\-subscriptions.test            - Get a list of subscriptions
+    identify\-printer.test             - Identify a printer
+    identify\-printer\-display.test     - Identify a printer via the display
+    ipp\-1.1.test                      - Run IPP/1.1 conformance tests
+    ipp\-2.0.test                      - Run IPP/2.0 conformance tests
+    ipp\-2.1.test                      - Run IPP/2.1 conformance tests
+    ipp\-2.2.test                      - Run IPP/2.2 conformance tests
+    print\-job.test                    - Print a file
+    print\-job\-and\-wait.test           - Print a file and wait for completion
+    print\-job\-deflate.test            - Print a file with deflate compression
+    print\-job\-gzip.test               - Print a file with gzip compression
+    print\-job\-hold.test               - Print a file and hold
+    print\-job\-letter.test             - Print a file on US Letter media
+    print\-job\-manual.test             - Print a file with manual feed
+    print\-job\-media\-col.test          - Print a file using "media-col"
+    print\-job\-media\-needed.test       - Print a file and test for "media-needed"
+    print\-job\-password.test           - Print a file with a password/PIN
+    print\-job\-raster.test             - Print a generated raster file
+    print\-uri.test                    - Print a URI/URL
+    set\-attrs\-hold.test               - Test setting job-hold-until to hold a job
+    validate\-job.test                 - Validate a job ticket
+.fi
+.PP
+The following standard document files are available:
 .nf
 
-    color.jpg
-    create\-printer\-subscription.test
-    document\-a4.pdf
-    document\-a4.ps
-    document\-letter.pdf
-    document\-letter.ps
-    get\-completed\-jobs.test
-    get\-jobs.test
-    get\-notifications.test
-    get\-printer\-attributes.test
-    get\-subscriptions.test
-    gray.jpg
-    ipp\-1.1.test
-    ipp\-2.0.test
-    ipp\-2.1.test
-    ipp\-2.2.test
-    ipp\-everywhere.test
-    onepage\-a4.pdf
-    onepage\-a4.ps
-    onepage\-letter.pdf
-    onepage\-letter.ps
-    print\-job.test
-    print\-job\-deflate.test
-    print\-job\-gzip.test
-    testfile.jpg
-    testfile.pcl
-    testfile.pdf
-    testfile.ps
-    testfile.txt
-    validate\-job.test
+    color.jpg                         - A color photo of a flower
+    document\-a4.pdf                   - A 4-page A4 PDF document
+    document\-a4.ps                    - A 4-page A4 PostScript document
+    document\-letter.pdf               - A 4-page US Letter PDF document
+    document\-letter.ps                - A 4-page US Letter PostScript document
+    gray.jpg                          - A grayscale photo of an Alcatraz doorway
+    onepage\-a4\-300\-black\-1.pwg        - A one page A4 PWG Raster document
+    onepage\-a4.pdf                    - A one page A4 PDF document
+    onepage\-a4.ps                     - A one page A4 PostScript document
+    onepage\-letter\-300\-black\-1.pwg    - A one page US Letter PWG Raster document
+    onepage\-letter.pdf                - A one page US Letter PDF document
+    onepage\-letter.ps                 - A one page US Letter PostScript document
+    testfile.jpg                      - A color photo collage
+    testfile.pcl                      - A HP-PCL homage to "The Shining"
+    testfile.pdf                      - A historical CUPS PDF document
+    testfile.ps                       - A historical CUPS PostScript document
+    testfile.txt                      - A plain text homage to "The Shining"
 .fi
 .SH CONFORMING TO
 The
@@ -255,7 +286,7 @@ Send email notifications to "user@example.com" when "myprinter" changes:
 .SH SEE ALSO
 .BR ipptoolfile (5),
 IANA IPP Registry (https://www.iana.org/assignments/ipp\-registrations),
-PWG Internet Printing Protocol Workgroup (https://www.pwg.org/ipp)
-RFC 8011 (https://datatracker.ietf.org/doc/html/rfc8011),
+PWG Internet Printing Protocol Workgroup (https://www.pwg.org/ipp),
+RFC 8011 (https://datatracker.ietf.org/doc/html/rfc8011)
 .SH COPYRIGHT
-Copyright \[co] 2020-2024 by OpenPrinting.
+Copyright \[co] 2021-2024 by OpenPrinting.
index 30ae527b5d3c6d901f19786627f0bfa7a64519dd..1bf9e018252558f0629f8a5ff338a435dbcc17ee 100644 (file)
@@ -1,13 +1,13 @@
 .\"
 .\" ipptoolfile man page.
 .\"
-.\" Copyright © 2020-2024 by OpenPrinting.
+.\" Copyright © 2021-2024 by OpenPrinting.
 .\" Copyright © 2010-2021 by Apple Inc.
 .\"
 .\" Licensed under Apache License v2.0.  See the file "LICENSE" for more
 .\" information.
 .\"
-.TH ipptoolfile 5 "CUPS" "2021-09-20" "OpenPrinting"
+.TH ipptoolfile 5 "CUPS" "2024-09-12" "OpenPrinting"
 .SH NAME
 ipptoolfile \- ipptool file format
 .SH DESCRIPTION
@@ -164,7 +164,11 @@ The following directives are understood within a \fItest\fR:
 .TP 5
 \fBATTR \fIout-of-band-tag attribute-name\fR
 .TP 5
-\fBATTR \fItag attribute-name value(s)\fR
+\fBATTR \fItag attribute-name value[,...,value]\fR
+.TP 5
+\fBATTR \fItag attribute-name "value"[,...,"value"]\fR
+.TP 5
+\fBATTR \fItag attribute-name <hex-value>[,...,<hex-value>]\fR
 Adds an attribute to the test request.
 Out-of-band tags (admin-define, delete-attribute, no-value, not-settable, unknown, unsupported) have no value.
 Values for other tags are delimited by the comma (",") character - escape commas using the "\\" character.
@@ -185,7 +189,6 @@ Uses the specified compression on the document data following the attributes in
 \fBDELAY \fIseconds\fR[\fI,repeat-seconds\fR]
 Specifies a delay in seconds before this test will be run.
 If two values are specified, the second value is used as the delay between repeated tests.
-A default repeat interval of 5 seconds is used if this directive is not provided.
 .TP 5
 \fBDISPLAY \fIattribute-name\fR
 Specifies that value of the named attribute should be output as part of the
@@ -206,6 +209,12 @@ Specifies that the response must/may include the named attribute and that all oc
 \fBFILE filename\fR
 Specifies a file to include at the end of the request. This is typically used when sending a test print file.
 .TP 5
+\fBGENERATE\-FILE { \fIparameters\fB }\fR
+Specifies that
+.B ipptool
+should generate PWG or Apple raster data for the printer.
+See the "GENERATE\-FILE PARAMETERS" section for information on the parameters you can specify.
+.TP 5
 \fBGROUP tag\fR
 Specifies the group tag for subsequent attributes in the request.
 .TP 5
@@ -327,11 +336,48 @@ Specifies that the current test should be repeated when the \fBEXPECT\fR conditi
 \fBSAME\-COUNT\-AS \fIattribute-name\fR
 Requires the \fBEXPECT\fR attribute to have the same number of values as the specified parallel attribute.
 .TP 5
+\fBSAVE\-CONTENT \fIfilespec\fR
+.TP 5
+\fBSAVE\-ALL\-CONTENT \fIfilespec\fR
+Saves all "http" or "https" URI values to the specified location.
+The filespec value is a filename or directory path and can contain the special strings "%basename%" to insert the base filename from the URI, "%ext%" to insert the extension from the URI, and "%index%" to insert the value number starting at 1.
+.TP 5
+\fBWITH\-ALL\-CONTENT available\fR
+.TP 5
+\fBWITH\-CONTENT available\fR
+Requires that all URI values be accessible.
+A "http" or "https" URI must respond to a GET request while a "ipp" or "ipps" URI must respond to a HEAD request.
+.TP 5
+\fBWITH\-ALL\-CONTENT valid\fR
+.TP 5
+\fBWITH\-CONTENT valid\fR
+Requires that all "http" and "https" URI values be accessible and provide valid content.
+Currently
+.B ipptool
+is able to validate CSS, HTML, ICC, IPP, JPEG, PDF, PNG, and Apple .strings files.
+.TP 5
+\fBWITH\-ALL\-CONTENT valid-icon\fR
+.TP 5
+\fBWITH\-CONTENT valid-icon\fR
+Requires that all "http" and "https" URI values be accessible and provide valid PNG images for icons - 48x48, 128x128, or 512x512 in size with transparency.
+.TP 5
 \fBWITH\-ALL\-HOSTNAMES "\fIliteral string\fB"\fR
 .TP 5
 \fBWITH\-ALL\-HOSTNAMES "/\fIregular expression\fB/"\fR
 Requires that all URI values contain a matching hostname.
 .TP 5
+\fBWITH\-ALL\-MIME\-TYPES \fImime/type[,...,mime/type]\fR
+.TP 5
+\fBWITH\-MIME\-TYPES \fImime/type[,...,mime/type]\fR
+Requires that all URI values provide one of the listed MIME media types.
+For non-content tests, the target Printer must respond to HTTP HEAD requests with the MIME media type that would be returned by a GET or POST requests.
+For "http" and "https" content tests,
+.B ipptool
+sends a HTTP GET request.
+For "ipp" and "ipps" content tests,
+.B ipptool
+sends an IPP Get-Printer-Attributes request.
+.TP 5
 \fBWITH\-ALL\-RESOURCES "\fIliteral string\fB"\fR
 .TP 5
 \fBWITH\-ALL\-RESOURCES "/\fIregular expression\fB/"\fR
@@ -339,7 +385,7 @@ Requires that all URI values contain a matching resource (including leading /).
 .TP 5
 \fBWITH\-ALL\-SCHEMES "\fIliteral string\fB"\fR
 .TP 5
-\fBWITH\-ALL-SCHEMES "/\fIregular expression\fB/"\fR
+\fBWITH\-ALL\-SCHEMES "/\fIregular expression\fB/"\fR
 Requires that all URI values contain a matching scheme.
 .TP 5
 \fBWITH\-ALL\-VALUES "\fIliteral string\fB"\fR
@@ -363,6 +409,10 @@ Requires that all values of the \fBEXPECT\fR attribute match the boolean value g
 Requires that all values of the \fBEXPECT\fR attribute match the regular expression, which must conform to the POSIX regular expression syntax.
 Comparisons are case-sensitive.
 .TP 5
+\fBWITH\-ALL\-VALUES\-FROM \fIattribute-name\fR
+Requires that all value(s) of the \fBEXPECT\fR attribute matches the value(s) in the specified attribute.
+For example, "EXPECT-ALL media\-col\-database/media\-source WITH\-ALL\-VALUES\-FROM media\-source\-supported" requires that all the "media\-source" values are listed as a value of the "media\-source\-supported" attribute.
+.TP 5
 \fBWITH\-DISTINCT\-VALUES\fR
 Requires that all values of the \fBEXPECT\fR attribute are unique.
 Comparisons are case-sensitive.
@@ -660,6 +710,11 @@ Inserts a single "$" character.
 \fB$ENV[\fIname\fB]\fR
 Inserts the value of the named environment variable, or an empty string if the environment variable is not defined.
 .TP 5
+\fB$basename\fR
+Inserts the base filename (without directory path) of the path provided to
+.BR ipptool (8)
+with the \fI-f\fR option.
+.TP 5
 \fB$date-current\fR
 Inserts the current date and time using the ISO-8601 format ("yyyy-mm-ddThh:mm:ssZ").
 .TP 5
@@ -712,10 +767,126 @@ if any.
 .TP 5
 \fB$user\fR
 Inserts the current user's login name.
+.SH GENERATE\-FILE PARAMETERS
+The
+.B GENERATE\-FILE
+directive dynamically generates raster pages for the destination printer.
+Each page consists of a black border and the text "TEST-PAGE ####" repeated in the interior in several shades of gray and colors.
+The following parameters are supported:
+.TP 5
+\fBCOLORSPACE auto\fR
+.TP 5
+\fBCOLORSPACE bi-level\fR
+.TP 5
+\fBCOLORSPACE color\fR
+.TP 5
+\fBCOLORSPACE monochrome\fR
+.TP 5
+\fBCOLORSPACE \fIcolorspace_bits\fR
+Specifies the output color space and bit depth.
+"auto" chooses an available combination with preference for full color, "bi-level" chooses a B&W (bitmap) color space, "color" chooses a full color combination, and "monochrome" chooses a grayscale combination.
+Otherwise, the value must be one of the registered IPP "pwg-raster-document-type-supported" keywords.
+\fINOTE:\fR The "device N" color spaces are not current supported.
+.TP 5
+\fBFORMAT image/pwg-raster\fR
+.TP 5
+\fBFORMAT image/urf\fR
+Specifies the raster format to use, either "image/pwg-raster" (PWG Raster) or "image/urf" (Apple Raster).
+The default is "image/urf" if supported, "image/pwg-raster" otherwise.
+.TP 5
+\fBMEDIA default\fR
+.TP 5
+\fBMEDIA ready\fR
+.TP 5
+\fBMEDIA \fImedia-size-name\fR
+Specifies the output media size.
+"default" uses the printer's default media size while "ready" uses the first ready (loaded) media reported by the printer.
+Other media size names must conform the PWG self-describing media size format.
+.TP 5
+\fBNUM\-COPIES \fIcopies\fR
+Specifies the number of copies to produce.
+The default is 1 copy.
+.TP 5
+\fBNUM\-PAGES \fIpages\fR
+Specifies the number of pages to produce.
+The default is 1 page for single-sided output and 2 pages for double-sided output.
+.TP 5
+\fBORIENTATION landscape\fR
+.TP 5
+\fBORIENTATION portrait\fR
+.TP 5
+\fBORIENTATION reverse-landscape\fR
+.TP 5
+\fBORIENTATION reverse-portrait\fR
+Specifies the orientation of the output.
+The default is "portrait".
+.TP 5
+\fBRESOLUTION default\fR
+.TP 5
+\fBRESOLUTION max\fR
+.TP 5
+\fBRESOLUTION min\fR
+.TP 5
+\fBRESOLUTION \fIresolution\fBdpcm\fR
+.TP 5
+\fBRESOLUTION \fIhorzontal\fBx\fIvertical\fBdpcm\fR
+.TP 5
+\fBRESOLUTION \fIresolution\fBdpi\fR
+.TP 5
+\fBRESOLUTION \fIhorizontal\fBx\fIvertical\fBdpi\fR
+Specifies the output resolution using the printer's supported resolutions or as specified in dots per inch or dots per centimeter.
+"default" uses the median resolution of the printer and is the default, "min" uses the lowest resolution of the printer, and "max" uses the highest resolution of the printer.
+.TP 5
+\fB SIDES one-sided\fR
+.TP 5
+\fB SIDES two-sided-long-edge\fR
+.TP 5
+\fB SIDES two-sided-short-edge\fR
+Specifies whether to print on one or both sides of the media.
+The default is "two-sided-long-edge" for portrait output and "two-sided-short-edge" for landscape output when supported by the printer, otherwise "one-sided" is used.
+.SH EXAMPLES
+Query the "foo-default" and "foo-supported" Printer Description attributes and validate that all of its values are 'bar', 'baz', or 'none':
+.nf
+{
+  NAME "Validate 'foo' Attribute"
+  OPERATION Get-Printer-Attributes
+  GROUP operation-attributes-tag
+  ATTR charset attributes-charset utf-8
+  ATTR language attributes-natural-language en
+  ATTR uri printer-uri $uri
+  ATTR keyword requested-attributes foo-default,foo-supported
+  EXPECT foo-default OF-TYPE keyword IN-GROUP printer-attributes-tag
+      COUNT 1 WITH-VALUE "/^(bar|baz|none)$$/"
+  EXPECT foo-supported OF-TYPE keyword IN-GROUP printer-attributes-tag
+      WITH-ALL-VALUES "/^(bar|baz|none)$$/"
+}
+.fi
+Query the "media-col-ready" Printer Status attribute and validate that the collection values contain "media-size" and "media-source" member attributes:
+.nf
+{
+  NAME "Validate 'foo' Attribute"
+  OPERATION Get-Printer-Attributes
+  GROUP operation-attributes-tag
+  ATTR charset attributes-charset utf-8
+  ATTR language attributes-natural-language en
+  ATTR uri printer-uri $uri
+  ATTR keyword requested-attributes media-col-ready
+  EXPECT media-col-ready OF-TYPE collection IN-GROUP printer-attributes-tag
+  EXPECT-ALL media-col-ready/media-size OF-TYPE collection COUNT 1
+  EXPECT-ALL media-col-ready/media-size/x-dimension OF-TYPE integer(1:MAX) COUNT 1
+  EXPECT-ALL media-col-ready/media-size/y-dimension OF-TYPE integer(0:MAX) COUNT 1
+  EXPECT-ALL media-col-ready/media-source OF-TYPE keyword|name COUNT 1
+}
+.fi
 .SH SEE ALSO
-.BR ipptool (1),
-IANA IPP Registry (https://www.iana.org/assignments/ipp-registrations),
-PWG Internet Printing Protocol Workgroup (https://www.pwg.org/ipp),
+.BR ipptool (1)
+.PP
+IANA IPP Registry (https://www.iana.org/assignments/ipp-registrations)
+.PP
+PWG Internet Printing Protocol Workgroup (https://www.pwg.org/ipp)
+.PP
+PWG 5101.1-2023: PWG Media Standardized Names v2.1 (https://ftp.pwg.org/pub/pwg/candidates/cs-pwgmsn21-20230915-5101.1.pdf)
+.PP
 RFC 8011 (https://datatracker.ietf.org/doc/html/rfc8011)
 .SH COPYRIGHT
-Copyright \[co] 2020-2024 by OpenPrinting.
+Copyright \[co] 2021-2024 by OpenPrinting.
index 918f162ce03909d2a76d6c1d2fc52804fb30baf0..932d6a3a3729264ee2920f3199f7a59be18282c4 100644 (file)
@@ -6632,7 +6632,8 @@ with_content(
   char         scheme[256],            // Scheme
                userpass[256],          // Username:password (not used)
                host[256],              // Hostname
-               resource[256];          // Resource path
+               resource[256],          // Resource path
+               *resptr;                // Pointer into resource
   int          port;                   // Port number
   http_encryption_t encryption;                // Encryption  mode
   http_uri_status_t uri_status;                // URI decoding status
@@ -6652,6 +6653,9 @@ with_content(
       continue;
     }
 
+    if ((resptr = strchr(resource, '#')) != NULL)
+      *resptr = '\0';                  // Strip HTML target ("...#target")
+
     if (strcmp(scheme, "http") && strcmp(scheme, "https") && strcmp(scheme, "ipp") && strcmp(scheme, "ipps"))
     {
       add_stringf(errors, "Unsupported URI scheme for '%s'.", uri);
@@ -6721,7 +6725,7 @@ with_content(
 
       if (status != HTTP_STATUS_OK)
       {
-        add_stringf(errors, "Got unexpected status %d for HEAD request to '%s'.", (int)status, uri);
+        add_stringf(errors, "Got unexpected status %d for GET request to '%s'.", (int)status, uri);
         ret = false;
         goto get_done;
       }
@@ -6765,14 +6769,38 @@ with_content(
       }
       else if (!_cups_strcasecmp(content_type, "image/jpeg") || !_cups_strcasecmp(content_type, "image/png"))
       {
+        // Validate image content
         if (!valid_image(filename, &width, &height, &depth))
         {
-         add_stringf(errors, "Unable to load image '%s'.", uri);
+         add_stringf(errors, "Unable to open image '%s'.", uri);
          ret = false;
          goto get_done;
         }
       }
-      else if (!_cups_strcasecmp(content_type, "application/pdf") || !_cups_strcasecmp(content_type, "application/ipp") || !_cups_strcasecmp(content_type, "application/vnd.iccprofile") || !_cups_strcasecmp(content_type, "text/css") || !_cups_strcasecmp(content_type, "text/html") || !_cups_strcasecmp(content_type, "text/strings"))
+      else if (!_cups_strcasecmp(content_type, "application/ipp"))
+      {
+        ipp_t  *ipp = ippNew();        // IPP message
+
+        if ((fd = open(filename, O_RDONLY | O_BINARY)) < 0)
+        {
+          add_stringf(errors, "Unable to open '%s': %s", uri, strerror(errno));
+          ippDelete(ipp);
+          ret = false;
+          goto get_done;
+        }
+        else if (ippReadFile(fd, ipp) != IPP_STATE_DATA)
+        {
+          add_stringf(errors, "Unable to read '%s': %s", uri, cupsGetErrorString());
+          ippDelete(ipp);
+          close(fd);
+          ret = false;
+          goto get_done;
+        }
+
+       ippDelete(ipp);
+       close(fd);
+      }
+      else if (!_cups_strcasecmp(content_type, "application/pdf") || !_cups_strcasecmp(content_type, "application/vnd.iccprofile") || !_cups_strcasecmp(content_type, "text/css") || !_cups_strcasecmp(content_type, "text/html") || !_cups_strncasecmp(content_type, "text/html;", 10) || !_cups_strcasecmp(content_type, "text/strings"))
       {
         // Just require these files to be non-empty for now, might add more checks in the future...
         if (fileinfo.st_size == 0)
@@ -6784,7 +6812,7 @@ with_content(
       }
       else
       {
-       add_stringf(errors, "Got unexpected Content-Type '%s' for HEAD request to '%s'.", content_type, uri);
+       add_stringf(errors, "Got unexpected Content-Type '%s' for GET request to '%s'.", content_type, uri);
        ret = false;
        goto get_done;
       }