1# 2# IPP/2.0 test suite. 3# 4# Copyright © 2007-2017 by Apple Inc. 5# Copyright © 2001-2006 by Easy Software Products. All rights reserved. 6# 7# Licensed under Apache License v2.0. See the file "LICENSE" for more 8# information. 9# 10# Usage: 11# 12# ./ipptool -V 2.0 -f filename -t printer-uri ipp-2.0.test 13# 14 15# Do all of the IPP/1.1 tests as an IPP/2.0 client 16# 17# Required by: PWG 5100.12 section 4.1 18INCLUDE "ipp-1.1.test" 19 20 21# Regular expression for PWG media size names (eek!) 22DEFINE MEDIA_REGEX "/^(choice(_((custom|na|asme|roc|oe|roll)_[a-z0-9][-a-z0-9]*_([1-9][0-9]*(\.[0-9]*[1-9])?|0\.[0-9]*[1-9])x([1-9][0-9]*(\.[0-9]*[1-9])?|0\.[0-9]*[1-9])in|(custom|iso|jis|jpn|prc|om|roll)_[a-z0-9][-a-z0-9]*_([1-9][0-9]*(\.[0-9]*[1-9])?|0\.[0-9]*[1-9])x([1-9][0-9]*(\.[0-9]*[1-9])?|0\.[0-9]*[1-9])mm)){2,}|(custom|na|asme|roc|oe|roll)_[a-z0-9][-a-z0-9]*_([1-9][0-9]*(\.[0-9]*[1-9])?|0\.[0-9]*[1-9])x([1-9][0-9]*(\.[0-9]*[1-9])?|0\.[0-9]*[1-9])in|(custom|iso|jis|jpn|prc|om|roll)_[a-z0-9][-a-z0-9]*_([1-9][0-9]*(\.[0-9]*[1-9])?|0\.[0-9]*[1-9])x([1-9][0-9]*(\.[0-9]*[1-9])?|0\.[0-9]*[1-9])mm)$$/" 23 24 25# Test required printer description attribute support. 26# 27# Required by: PWG 5100.12 section 6.2 28{ 29 NAME "PWG 5100.12 section 6.2 - Required Printer Description Attributes" 30 OPERATION Get-Printer-Attributes 31 GROUP operation-attributes-tag 32 ATTR charset attributes-charset utf-8 33 ATTR naturalLanguage attributes-natural-language en 34 ATTR uri printer-uri $uri 35 ATTR name requesting-user-name $user 36 ATTR mimeMediaType document-format application/octet-stream 37 38 STATUS successful-ok 39 40 # Figure out capabilities 41 EXPECT color-supported OF-TYPE boolean IN-GROUP printer-attributes-tag COUNT 1 WITH-VALUE true DEFINE-MATCH PRINTER_IS_COLOR 42 43 # Job template attributes 44 EXPECT copies-default OF-TYPE integer IN-GROUP printer-attributes-tag COUNT 1 WITH-VALUE >0 45 EXPECT copies-supported OF-TYPE rangeOfInteger IN-GROUP printer-attributes-tag 46 EXPECT finishings-default OF-TYPE enum IN-GROUP printer-attributes-tag 47 EXPECT finishings-supported OF-TYPE enum IN-GROUP printer-attributes-tag WITH-VALUE 3 48 EXPECT media-default OF-TYPE no-value|keyword|name IN-GROUP printer-attributes-tag COUNT 1 WITH-VALUE "$MEDIA_REGEX" 49 EXPECT ?media-ready OF-TYPE keyword|name IN-GROUP printer-attributes-tag WITH-ALL-VALUES "$MEDIA_REGEX" 50 EXPECT media-supported OF-TYPE keyword|name IN-GROUP printer-attributes-tag WITH-ALL-VALUES "$MEDIA_REGEX" 51 EXPECT orientation-requested-default OF-TYPE no-value|enum IN-GROUP printer-attributes-tag COUNT 1 WITH-VALUE 3,4,5,6 52 EXPECT orientation-requested-supported OF-TYPE enum IN-GROUP printer-attributes-tag WITH-VALUE 3,4,5,6 53 EXPECT output-bin-default OF-TYPE keyword|name IN-GROUP printer-attributes-tag COUNT 1 54 EXPECT output-bin-supported OF-TYPE keyword|name IN-GROUP printer-attributes-tag 55 EXPECT print-quality-default OF-TYPE enum IN-GROUP printer-attributes-tag COUNT 1 WITH-VALUE 3,4,5 56 EXPECT print-quality-supported OF-TYPE enum IN-GROUP printer-attributes-tag WITH-VALUE 3,4,5 57 EXPECT printer-resolution-default OF-TYPE resolution IN-GROUP printer-attributes-tag COUNT 1 58 EXPECT printer-resolution-supported OF-TYPE resolution IN-GROUP printer-attributes-tag 59 EXPECT sides-default OF-TYPE keyword IN-GROUP printer-attributes-tag COUNT 1 WITH-ALL-VALUES "/^(one-sided|two-sided-long-edge|two-sided-short-edge)$$/" 60 EXPECT sides-supported OF-TYPE keyword IN-GROUP printer-attributes-tag WITH-ALL-VALUES "/^(one-sided|two-sided-long-edge|two-sided-short-edge)$$/" 61 62 # Optional media-col support 63 EXPECT ?media-col-default OF-TYPE collection IN-GROUP printer-attributes-tag COUNT 1 64 EXPECT ?media-col-ready OF-TYPE collection IN-GROUP printer-attributes-tag 65 EXPECT ?media-col-supported OF-TYPE keyword IN-GROUP printer-attributes-tag 66 EXPECT media-col-supported WITH-VALUE media-back-coating DEFINE-MATCH HAVE_MEDIA_BACK_COATING 67 EXPECT media-col-supported WITH-VALUE media-color DEFINE-MATCH HAVE_MEDIA_COLOR 68 EXPECT media-col-supported WITH-VALUE media-front-coating DEFINE-MATCH HAVE_MEDIA_FRONT_COATING 69 EXPECT media-col-supported WITH-VALUE media-grain DEFINE-MATCH HAVE_MEDIA_GRAIN 70 EXPECT media-col-supported WITH-VALUE media-hole-count DEFINE-MATCH HAVE_MEDIA_HOLE_COUNT 71 EXPECT media-col-supported WITH-VALUE media-info DEFINE-MATCH HAVE_MEDIA_INFO 72 EXPECT media-col-supported WITH-VALUE media-key DEFINE-MATCH HAVE_MEDIA_KEY 73 EXPECT media-col-supported WITH-VALUE media-order-count DEFINE-MATCH HAVE_MEDIA_ORDER_COUNT 74 EXPECT media-col-supported WITH-VALUE media-pre-printed DEFINE-MATCH HAVE_MEDIA_PRE_PRINTED 75 EXPECT media-col-supported WITH-VALUE media-recycled DEFINE-MATCH HAVE_MEDIA_RECYCLED 76 EXPECT media-col-supported WITH-VALUE media-size DEFINE-MATCH HAVE_MEDIA_SIZE 77 EXPECT media-col-supported WITH-VALUE media-tooth DEFINE-MATCH HAVE_MEDIA_TOOTH 78 EXPECT media-col-supported WITH-VALUE media-type DEFINE-MATCH HAVE_MEDIA_TYPE 79 EXPECT media-col-supported WITH-VALUE media-weight-metric DEFINE-MATCH HAVE_MEDIA_WEIGHT_METRIC 80 81 EXPECT media-back-coating-supported OF-TYPE keyword|name IN-GROUP printer-attributes-tag IF-DEFINED HAVE_MEDIA_BACK_COATING 82 EXPECT media-color-supported OF-TYPE keyword|name IN-GROUP printer-attributes-tag IF-DEFINED HAVE_MEDIA_COLOR 83 EXPECT media-front-coating-supported OF-TYPE keyword|name IN-GROUP printer-attributes-tag IF-DEFINED HAVE_MEDIA_FRONT_COATING 84 EXPECT media-grain-supported OF-TYPE keyword|name IN-GROUP printer-attributes-tag IF-DEFINED HAVE_MEDIA_GRAIN 85 EXPECT media-hole-count-supported OF-TYPE rangeOfInteger IN-GROUP printer-attributes-tag WITH-VALUE >-1 IF-DEFINED HAVE_MEDIA_HOLE_COUNT 86 EXPECT media-info-supported OF-TYPE keyword|name IN-GROUP printer-attributes-tag IF-DEFINED HAVE_MEDIA_INFO 87 EXPECT media-key-supported OF-TYPE keyword|name IN-GROUP printer-attributes-tag IF-DEFINED HAVE_MEDIA_KEY 88 EXPECT media-order-count-supported OF-TYPE rangeOfInteger IN-GROUP printer-attributes-tag WITH-VALUE >0 IF-DEFINED HAVE_MEDIA_ORDER_COUNT 89 EXPECT media-pre-printed-supported OF-TYPE keyword|name IN-GROUP printer-attributes-tag IF-DEFINED HAVE_MEDIA_PRE_PRINTED 90 EXPECT media-recycled-supported OF-TYPE keyword|name IN-GROUP printer-attributes-tag IF-DEFINED HAVE_MEDIA_RECYCLED 91 EXPECT media-size-supported OF-TYPE collection IN-GROUP printer-attributes-tag IF-DEFINED HAVE_MEDIA_SIZE 92 EXPECT media-tooth-supported OF-TYPE keyword|name IN-GROUP printer-attributes-tag IF-DEFINED HAVE_MEDIA_TOOTH 93 EXPECT media-type-supported OF-TYPE keyword|name IN-GROUP printer-attributes-tag IF-DEFINED HAVE_MEDIA_TYPE 94 EXPECT media-weight-metric-supported OF-TYPE rangeOfInteger IN-GROUP printer-attributes-tag WITH-VALUE >-1 IF-DEFINED HAVE_MEDIA_WEIGHT_METRIC 95 96 # Printer description attributes 97 EXPECT color-supported OF-TYPE boolean IN-GROUP printer-attributes-tag COUNT 1 98 EXPECT pages-per-minute OF-TYPE integer IN-GROUP printer-attributes-tag COUNT 1 99 EXPECT pages-per-minute-color OF-TYPE integer IN-GROUP printer-attributes-tag COUNT 1 IF-DEFINED PRINTER_IS_COLOR 100 EXPECT !pages-per-minute-color IF-NOT-DEFINED PRINTER_IS_COLOR 101 EXPECT printer-info OF-TYPE text IN-GROUP printer-attributes-tag COUNT 1 WITH-VALUE "/^.{0,127}$$/" 102 EXPECT printer-location OF-TYPE text IN-GROUP printer-attributes-tag COUNT 1 WITH-VALUE "/^.{0,127}$$/" 103 EXPECT printer-make-and-model OF-TYPE text IN-GROUP printer-attributes-tag COUNT 1 WITH-VALUE "/^.{0,127}$$/" 104 EXPECT printer-more-info OF-TYPE uri IN-GROUP printer-attributes-tag COUNT 1 105} 106