LinuxCommandLibrary

ipptool

Test and debug IPP printers

TLDR

Get all attributes and their values supported by a printer

$ ipptool ipp://[printer_uri] get-completed-jobs.test
copy

Get the list of completed jobs of a printer
$ ipptool ipp://[printer_uri] get-completed-jobs.test
copy

Send an email notification when a printer changes
$ ipptool -d recipient=mailto:[email] ipp://[printer_uri] create-printer-subscription.test
copy

SYNOPSIS

ipptool [-4 | -6] [-X] [-c] [-C] [-d device-id] [-f filename] [-i count] [-I count] [-m] [-n count] [-t] [-T] [-v] [-1] uri testfile

PARAMETERS

-4
    Use IPv4 addresses when possible

-6
    Use IPv6 addresses when possible

-X
    Do not use SSL/TLS

-c
    Do not verify certificates (deprecated)

-C
    Verify top-level certificates

-d device-id
    Specify device ID to send with requests

-f filename
    Read document data from file

-i count
    Repeat last test count times

-I count
    Repeat document count generations

-m
    List supported MIME media types

-n count
    Repeat all tests count times

-t
    Print test coverage information

-T
    Print whitespace-delimited results

-v
    Be verbose (repeat for more detail)

-1
    Stop after first error

uri
    Target IPP printer/server URI (e.g., ipp://printer)

testfile
    File containing IPP test definitions

DESCRIPTION

ipptool is a command-line utility for testing IPP (Internet Printing Protocol) printers, servers, and clients. It reads a test file specifying IPP requests, attributes, and expected responses, then sends them to a target URI (printer or server address). Results include pass/fail status for each test, making it ideal for verifying IPP standard compliance, debugging implementations, and automating quality assurance.

Key features include support for all standard IPP operations like Print-Job, Get-Printer-Attributes, Validate-Job, Create-Job, Send-Document, Pause-Printer, and more. Users define tests using a simple declarative syntax in plain text files, with variables, loops, and conditional logic. ipptool handles document data from files, multiple test iterations, IPv4/IPv6, TLS/SSL (with certificate options), timeouts, and verbose logging.

Common use cases: printer manufacturers certify devices; developers test IPP stacks; admins validate network printers. Part of CUPS (Common UNIX Printing System), it requires libcups2 and is available on most Linux distros via cups package. Output can be tabular or whitespace-delimited for scripting. Comprehensive coverage reports aid in standards testing.

CAVEATS

Requires CUPS libraries; test files must follow ipptoolfile(7) syntax exactly. TLS issues common without proper certs. High-volume tests may overload printers. Not for production printing.

TEST FILE BASICS

Tests use syntax like:
{
OPERATION Print-Job
ATTR charset name-requesting-user-name "test"
}
EXPECT status-code == successful-ok

EXIT CODES

0: all tests passed; 1: some failed; 2: fatal error (syntax, network)

HISTORY

Introduced in CUPS 1.7 (2014) by Michael Sweet for IPP Everywhere certification. Enhanced in CUPS 2.x for PWG standards, IPv6, TLS 1.3 support. Maintained by OpenPrinting project.

SEE ALSO

ippfind(1), lp(1), lpadmin(8), lpstat(1), ipptoolfile(7)

Copied to clipboard