ipptool
Test and debug IPP printers
TLDR
Get all attributes and their values supported by a printer
Get the list of completed jobs of a printer
Send an email notification when a printer changes
SYNOPSIS
ipptool [ OPTIONS ] URI [ TESTFILE.test ... ]
URI: Specifies the IPP resource to connect to (e.g., ipp://localhost:631/printers/myprinter or ipps://192.168.1.100:443/ipp/print).
TESTFILE.test: One or more IPP test files containing directives for requests and expected responses. If no test files are specified, ipptool reads from standard input.
PARAMETERS
-E
Enables TLS encryption for the connection. For ipps:// URIs, TLS is enabled by default.
-I
Don't pretty-print requests sent to the server. By default, ipptool pretty-prints requests for readability.
-P
Don't pretty-print responses received from the server. By default, responses are pretty-printed.
-V version
Specifies the IPP protocol version to use for requests. Common values include 1.0, 1.1, and 2.0.
-X
Don't exit on the first error. Continue processing subsequent requests in the test file even if an error occurs.
-c client-name
Sets the 'client-name' attribute in requests, identifying the client to the server.
-d name=value
Defines a variable for use within the test file. Variables can be referenced using ${name}.
-f filename
Specifies a file whose contents will be sent as the document data with the IPP request.
-i iteration-count
Specifies the number of times to iterate or repeat the tests in the given test files.
-l
Lists all recognized IPP operations, attributes, and values. This can be helpful for understanding IPP syntax.
-m max-requests
Specifies the maximum number of requests to send before exiting. Useful for limiting test execution time.
-o filename
Saves the raw IPP request and response data to the specified file.
-q
Be quiet; don't display status messages or progress. Only errors and critical information will be shown.
-r
Do not retry failed requests. By default, ipptool might retry some requests.
-s
Show status messages after each request, including the HTTP and IPP status codes.
-t
Show timing information for each request, indicating how long it took to send and receive data.
-v
Be verbose; display additional debugging and informational messages during execution.
-x
Exit on the first error encountered during test execution. This is the default behavior.
DESCRIPTION
ipptool is a command-line utility used to test and debug Internet Printing Protocol (IPP) servers and clients. It allows users to send specific IPP requests, defined in `.test` files, to a target IPP server (printer, print server, etc.) and then analyze or validate the server's responses. This tool is invaluable for developers creating IPP-compliant devices or software, as well as for system administrators troubleshooting printing issues.
It supports various IPP versions (1.0, 1.1, 2.0), different authentication methods, and secure communication via TLS. Users can define a sequence of IPP operations, expected status codes, and attribute values within the test files, making ipptool a powerful tool for automated compliance testing and regression testing of IPP implementations.
CAVEATS
Understanding and writing ipptool test files requires a good grasp of the IPP specification. Debugging complex IPP interactions can be challenging without proper knowledge of the protocol's intricacies. Network connectivity, firewall rules, and the target IPP server's configuration directly impact ipptool's ability to communicate successfully.
TEST FILE STRUCTURE
ipptool uses specially formatted `.test` files to define test scenarios. These files contain directives that specify IPP operations (e.g., Get-Printer-Attributes, Print-Job), attributes to include in requests, and expected attributes or status codes in responses. Key directives include REQUEST (to define the outgoing request), EXPECT (to define expected response attributes), STATUS (to expect specific IPP status codes), and ATTR (to add attributes to requests).
IPP EVERYWHERE™ TESTING
ipptool is widely used for testing compliance with the IPP Everywhere™ standard, which aims to simplify printing across various devices and operating systems by relying solely on IPP. Test files for IPP Everywhere™ validation are often provided by standards bodies to ensure interoperability.
HISTORY
ipptool is a core component of the Common Unix Printing System (CUPS), which was originally developed by Easy Software Products and later acquired by Apple Inc. It emerged as a vital utility for testing and validating IPP implementations, particularly in the context of IPP Everywhere™ and other IPP-based printing standards. Its development is intertwined with the evolution of CUPS and the broader adoption of IPP as the standard protocol for printing on Unix-like systems.