# # IPP Everywhere Printer Self-Certification Manual 1.1: Section 6: IPP Tests. # # Copyright 2014-2020 by the IEEE-ISTO Printer Working Group. # Copyright 2007-2019 by Apple Inc. # Copyright 2001-2006 by Easy Software Products. All rights reserved. # # Licensed under Apache License v2.0. See the file "LICENSE" for more # information. # # Usage: # # ./ipptool [-d STRICT=1] -tI printer-uri ipp-tests.test # # The "-d STRICT=1" option makes certain tests more strict/pedantic. # # History: # # This test file is loosely based on the IPP/1.1, IPP/2.0 and IPP Everywhere # test files from the CUPS "examples" directory. Many of those tests have been # combined or removed, and all print tests are performed using a sample PWG # Raster file. These tests also validate support for the 'media-needed' keyword # in the "printer-state-reasons" Printer attribute. # FILE-ID "org.pwg.ippeveselfcert11.ipp" # All tests use IPP version 2.0, unless overridden in a test... VERSION 2.0 # Regular expressions for URI schemes: # # HTTP_URI_SCHEME - Matches strings beginning with http:// or https:// # IPP_URI_SCHEME - Matches strings beginning with ipp:// or ipps:// # UUID_URI - Matches UUID URN strings. DEFINE HTTP_URI_SCHEME "/^https?://.+$$/" DEFINE IPP_URI_SCHEME "/^ipps?://.+$$/" DEFINE LINK_LOCAL "/^(\[|\[v1.)fe80:/" DEFINE UUID_URI "/^urn:uuid:[0-9A-Fa-f]{8,8}-[0-9A-Fa-f]{4,4}-[0-9A-Fa-f]{4,4}-[0-9A-Fa-f]{4,4}-[0-9A-Fa-f]{12,12}/" # Regular expression for printer-supply attribute # # Generated with help from: http://abnf.msweet.org/ DEFINE SUPPLY_REGEX "/^(type\=[A-Za-z]+;|maxcapacity\=-{0,1}[0-9]+;|level\=-{0,1}[0-9]+;|index\=[0-9]+;|markerindex\=[0-9]+;|class\=[A-Za-z]+;|unit\=[A-Za-z]+;|colorantindex\=[0-9]+;|colorantrole\=[A-Za-z]+;|colorantname\=[-_.A-Za-z0-9]+;|coloranttonality\=[0-9]+){0,}$$/" DEFINE TYPE_REGEX "/^(type=[A-Za-z]+){0,}$$/" # Test Get-Printer-Attributes operation # # Required by: PWG 5100.14 Section 5.x { NAME "I-10. Get-Printer-Attributes Operation (default)" OPERATION Get-Printer-Attributes GROUP operation-attributes-tag ATTR charset attributes-charset utf-8 ATTR naturalLanguage attributes-natural-language en ATTR uri printer-uri $uri ATTR name requesting-user-name $user ATTR keyword requested-attributes printer-supply,printer-supply-info-uri STATUS successful-ok EXPECT printer-supply DEFINE-MATCH HAVE_PRINTER_SUPPLY EXPECT printer-supply-info-uri DEFINE-MATCH HAVE_PRINTER_SUPPLY EXPECT printer-supply OF-TYPE octetString IN-GROUP printer-attributes-tag WITH-ALL-VALUES "$TYPE_REGEX" IF-DEFINED HAVE_PRINTER_SUPPLY EXPECT printer-supply-info-uri OF-TYPE uri IN-GROUP printer-attributes-tag COUNT 1 WITH-VALUE "$HTTP_URI_SCHEME" IF-DEFINED HAVE_PRINTER_SUPPLY EXPECT printer-supply-info-uri WITH-HOSTNAME "$hostname" IF-DEFINED HAVE_PRINTER_SUPPLY }