A vendor hands you a PPD file that is years old, and cupstestppd will tell you whether it actually conforms before it nears a print queue. You will check one or more PostScript Printer Description files for CUPS format and conformance errors, then use the exit status in a script or build check. Allow about ten minutes for one file, longer for a directory of vendor files.
cups-client package and a readable .ppd or .ppd.gz file.cups-client 2.4.7-1.2ubuntu7.14, with cupstestppd at /usr/bin/cupstestppd.Confirm the executable and the file you intend to read:
$ command -v cupstestppd
/usr/bin/cupstestppd
$ ls -l /path/to/driver.ppd
-rw-r--r-- 1 you you 12345 Sep 22 10:00 /path/to/driver.ppd
Swap in your real path for /path/to/driver.ppd. The command reads the PPD and writes test output to standard output; it does not install the file, touch a printer queue, or restart CUPS. Reading a file in your own home or project directory needs no elevated privileges.
Checkpoint: if command -v prints nothing, install or repair the package through your normal process. Do not reach for sudo just to validate a file you can already read.
Use -q when the exit status is the answer you actually want:
$ cupstestppd -q /path/to/driver.ppd
$ printf '%s\n' "$?"
0
Zero means the test passed. Non-zero means the file failed the test, or the command could not even read it. The quiet option suppresses everything else, so capture the status immediately after the command; running anything else first overwrites it.
For a whole batch of files, let the shell print only the failures:
$ find /path/to/ppd-tree -type f -name '*.ppd' \
! -exec cupstestppd -q '{}' \; -print
/path/to/ppd-tree/vendor-broken.ppd
This only tests names ending in .ppd. If the archive also has compressed files, test those explicitly or add a matching pattern for *.ppd.gz, which cupstestppd accepts directly. Check the directory before running a batch command, so a typo in the starting path does not quietly produce an empty, misleadingly clean result.
When a file fails, rerun that exact path with -v:
$ cupstestppd -v /path/to/vendor-broken.ppd
FAIL
... detailed conformance results ...
The actual lines depend on the PPD. Verbose mode gives you the detailed conformance results instead of the bare status; -vv adds the PPD contents as well and can produce a lot of output, so use it only when you need that. The three modes, -q, -v and -vv, are mutually exclusive.
Capture a report without overwriting anything already there:
$ cupstestppd -v /path/to/vendor-broken.ppd \
> /tmp/vendor-broken-cupstestppd.txt
$ sed -n '1,120p' /tmp/vendor-broken-cupstestppd.txt
Writing to /tmp is fine for this diagnostic. If the report contains sensitive vendor paths or printer details, treat it as operational data and clear it out through your normal retention process once you are done with it.
The documented exit statuses make the next step more precise:
This read-only check shows a missing path is an input problem, not a conformance result:
$ cupstestppd -q /tmp/cupstestppd-no-such-file.ppd
$ printf '%s\n' "$?"
2
Get status 2 for a file you know exists, and check the path and permissions before blaming the PPD:
$ test -r /path/to/driver.ppd && echo readable
readable
$ file /path/to/driver.ppd
Do not label every non-zero result a broken PPD. Fix the access problem first, then rerun the test; status 3 or 4 is where the verbose report actually earns its keep.
Some checks can be downgraded to warnings with -W. -W constraints treats UIConstraint errors as warnings; -W filters and -W profiles do the same for their own categories. -W all applies that to every documented category, and -W none restores them to errors.
$ cupstestppd -W constraints -v /path/to/driver.ppd
... detailed results, with constraint errors reported as warnings ...
Tip: do not add -W all just to make an automated check pass. It changes the severity of what is reported, not the PPD itself. Record why an exception exists and keep a strict run as your baseline. The -I option similarly ignores chosen categories such as filename, filters and profiles; use it only once you understand and accept what it is hiding.
The -r option relaxes handling of common whitespace, control-character and formatting problems. It is useful for poking at a legacy file, but it weakens the test itself. Compare its result against a normal run before deciding the file is fit to deploy.
cupstestppd is a checker, not an installer. Do not follow a failed test by editing /etc/cups, restarting the printing service, or changing a live queue as part of the diagnosis; those are separate, service-disrupting operations with their own backup and maintenance plan.
Because PPDs are deprecated, even a passing result has a narrow meaning: this file passed the selected checks. It does not prove a printer is reachable, that every filter is installed, or that a modern IPP printer even needs the file. Keep the original vendor file untouched, and put any experimental copy under a temporary or version-controlled path instead.