Giter VIP home page Giter VIP logo

istopwg / ippeveselfcert Goto Github PK

View Code? Open in Web Editor NEW
21.0 9.0 5.0 8.98 MB

IPP Everywhere Printer Self-Certification Tools

Home Page: https://www.pwg.org/ipp/everywhere.html

License: Apache License 2.0

Makefile 1.28% C 30.29% Batchfile 7.79% Shell 20.36% M4 3.54% C++ 18.69% Kotlin 0.06% Ruby 1.34% Swift 0.68% Objective-C 0.02% Dart 5.72% CMake 9.33% HTML 0.91%
ipp ippeverywhere certification printer

ippeveselfcert's Introduction

IPP Everywhere™ v2.0 Printer Self-Certification Tools

Note: The current v1.1 self-certification tools are provided in the "v1.1-updates" branch of this repository. The master branch provides the current v2.0 development code.

Version Apache 2.0 Build and Test ippeveselfcert Coverity Scan Status

The IPP Everywhere™ Printer self-certification tools are used to test the conformance of printers to PWG Candidate Standard 5100.14-20xx: IPP Everywhere™ v2.0. The testing and submission procedures are defined in PWG Candidate Standard 5100.20-20xx: IPP Everywhere™ v2.0 Printer Self-Certification Manual.

The IPP Everywhere™ home page provides access to all information relevant to IPP Everywhere™. The "[email protected]" mailing list is used to discuss IPP Everywhere Printer Self-Certification. You can subscribe at https://www.pwg.org/mailman/listinfo/ippeveselfcert.

Issues found in the tools should be reported using the Github issues page at https://github.com/istopwg/ippeveselfcert.

Note: Tests are intended to be run on an isolated network, or at least when no other users are printing using the target printer. Otherwise the test scripts will fail randomly.

Compiling

Please see the file "BUILD.md" for instructions on compiling the software.

Note: Self-certification results submitted to the PWG IPP Everywhere™ portal MUST be generated using the tools provides on the PWG web site.

Legal Stuff

Copyright © 2014-2024 by the IEEE-ISTO Printer Working Group.

This software is provided under the terms of the Apache License, Version 2.0. A copy of this license can be found in the file LICENSE. Additional legal information is provided in the file NOTICE.

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

ippeveselfcert's People

Contributors

michaelrsweet avatar wifiprintguy avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

ippeveselfcert's Issues

'ippfind' tool doesn't support DNS-SD service instance names with leading "_" or "-"

According to RFC 6763 section 4.1.1 (http://tools.ietf.org/html/rfc6763#section-4.1.1) a DNS-SD instance name may contain up to 63 octets of printable (non-control character) Net-Unicode characters. There is no restriction on the allowable characters for the first character. That includes the underscore ("_") and dash ("-") characters.

The 'ippfind' tool supports the following option and argument syntaxes:
ippfind [ options ] regtype[,subtype][.domain.] ... [ expression... ]
ippfind [ options ] name[.regtype[.domain.]] ... [ expression... ]

If 'ippfind' is used with a printer whose service instance name is "Smitty Normal Printer._ipp._tcp.local.", the 'ippfind' tool will assume the form being used is the first form, but the user will be wanting it to use the second form.

There is the "-n" or "--name" argument, which can be used as a workaround, but it would be better to collapse them into a single form and depend on the "-n" argument for all instances where the name is provided.

ipp-tests.test: update all EXPECTS testing for type dateTime to also allow "unknown" and some also support "no-value"

See thread here: http://www.pwg.org/pipermail/ipp/2016/018995.html

Original message was this:

"While running the IPP Everywhere Self Certification suite against a printer that has no persistent clock, we saw several failures having to do with the state of some time related attributes. When I started digging into those attributes, I discovered that some attributes, such as "date-time-at-processing" or "date-time-at-completed", are defined as (dateTime | no-value) while others such as "date-time-at-creation" or "printer-current-time" are simply defined to be of type "dateTime". And yet the description of "printer-current-time" in even the latest draft of RFC 2911bis allowed the attribute to have the out-of-band value 'no-value'.

What is the right thing to do in these cases? And should it be acceptable if a Printer that lacks a clock reports 'no-value' for "printer-config-change-date-time"? If it is OK to return 'no-value' then I think tests I-9 and I-14 may need to be fixed."

IPP WG minutes (http://ftp.pwg.org/pub/pwg/ipp/minutes/ippv2-concall-minutes-20161005.pdf) gave this guidance for updating the IPP Everywhere Self Certification test suite:

⁃ Allow both no-value and unknown for date-time-at-xxx and
printer-current-time and printer-config-change-date-time and
printer-state-change-date-time

D-2. JPEG Tests (mandatory) in "document-test.sh"

"image/jpeg" is optional for mono printer in ipp everywhere v1.1

D-2. JPEG Tests (mandatory) [FAIL]
RECEIVED: 7876 bytes in response
status-code = successful-ok (successful-ok)
EXPECTED: document-format-supported WITH-VALUE "image/jpeg"
GOT: document-format-supported="application/PCLm"
GOT: document-format-supported="application/octet-stream"
GOT: document-format-supported="image/pwg-raster"
GOT: document-format-supported="image/urf"
D-2.1 Print color.jpg with defaults [FAIL]

Test scripts should target an exact match for the service name

The "ippfind" tool takes a regular expression. If the service name provided to the script is actually a sub-string of another service name, then it will be run against all the matches. To fix this, the scripts should call "ippfind" with a regular expression wrapped in '^' and '$' to make sure there is an exact match, like so:

ippfind --name "^${NAME}$" "_ipp._tcp,_print" ...

Move license to Apache v2

As per PWG SC guidance, move the license for this project to Apache v2. Waiting on the move to CUPS 2.3 (ippeveselfcert 1.1 timeframe).

'ipp-tests.sh' should be modified to accommodate service instance names with awkward instance name syntax

The invocation of 'ippfind' should use the '-n' or '--name' option to make sure it can handle instance names that start with characters such as '_' that are used in the real world but are not supported by the currently used version of 'ippfind'

So, change this:

${IPPFIND} "$1._ipp._tcp.local." -x "${IPPTOOL}" -P "$1 IPP Results.plist" -I '{}' ipp-tests.test ;

to this:

${IPPFIND} --name "${1}" "_ipp._tcp.local." -x "${IPPTOOL}" -P "$1 IPP Results $(date +'%Y%m%d%H%M').plist" -I '{}' ipp-tests.test ;

(This also includes an additional date code element in the plist file name created to better support multiple runs.)

ippevesubmit: -m option is broken

Unfortunately, it looks like the ippevesubmit program's -m option is broken. The read_string function incorrectly is stripping everything on a line after the first space.

HTTP Upgrade test failed

When execut "B-5.1 HTTP Upgrade test" of dnssd-test.bat, after the certification tool sends OPTIONS request, the test Printer sends 101 Switching Protocols response.
However, the certification tool closes the current connection(does not start the ssl handshark), and re-send a OPTIONS request on a new connection.
The certification tool repeat above operations, and finally, this test failed.

http upgrade

Relax Get-Printer-Attributes tests

Currently the Get-Printer-Attributes tests (I-10.x) verify strict conformance to STD92 regarding attribute group names in the "requested-attributes" operation attribute. After discussion in the IPP workgroup, we have decided to relax the conformance tests to simply require attributes in the group be returned but not throw an error for attributes not in the group. IOW, allow the group names to be treated as 'all' for a naive implementation since it does not affect interoperability, just performance.

ipp-test.test: I-19 Test - Unexpected status code

Test I-19. Cancel-Job Operation (completed job), which tries to cancel a completed job results in status-code = client-error-not-authenticated when the first job of the queue was sent by another user.

The solution would be to modify the preceding test-case (I-18. Get-Jobs Operation) to query only jobs from the requesting user by adding ATTR boolean my-jobs true.

As I said, the problem is only visible when multiple clients are interacting with the same printer and the first job in the queue doesn't belong to the requesting user.

Merge CUPS 2.2.x changes

Need to bring in the libcups, ippfind, and ipptool changes from CUPS 2.2.x into the ippeveselfcert project:

  • libcups
  • ippfind
  • ipptool

Hard-coded filename(s) prevent "document-tests.sh" from running

  • When I run "document-tests.sh", it complains about missing PWG Raster sample files and asks to download them from ftp.pwg.org/pub/pwg/ipp/examples/ . That's ok, but then...
  • ...looking at that location, I see different versions: there are ones from 2011, and newer ones from 2015. Which one(s) to use?
  • The "document-tests.sh" script itself has hard-coded a test for the "2011"-versions and bails out if only "2015"-versions are available.
  • Also, the associated "documents-tests.test" file also contains the "2011" version names hard-coded....
  • Finally, it is not clear if one should download the PWG raster samples for ALL resolutions (I guess the resolutions reported by the IPP printer to be supported should suffice?). To clarify that in the message printed to the user when the test fails would be helpful.

In lieu of a suitable IPP printer in my current environment I resorted to test against a locally installed CUPS-1.7.5 queue (knowing it is not supposed to pass most of the tests, but wanting to see in general how this testing would work). This is when I noticed the problem with the hard-coded versions, plus the following:

"document-tests.test":
    D-1. PWG Raster Format Tests (mandatory)                             [PASS]
ipptool: Filename "pwg-raster-samples-${RASTER_RESOLUTION}-20111130/black-1/color.jpg-4x6-black-1-600dpi.pwg" on line 68 cannot be read.
ipptool: Filename mapped to "pwg-raster-samples-1200dpi-20111130/black-1/color.jpg-4x6-black-1-600dpi.pwg".

That "line 68" is from "document-tests.test". It reads:

   FILE pwg-raster-samples-${RASTER_RESOLUTION}-20111130/black-1/color.jpg-4x6-black-1-600dpi.pwg

I'm not sure why the var ${RASTER_RESOLUTION} did not resolve in the output line? And why it seems to be "mapped to 1200dpi"? And why is the "600dpi.pwg" file suffix hard-coded throughout the "document-tests.test" file?


(Note, I've not run this on one of the required/recommended OS platforms, but on Debian Jessie.)

Develop unit/self test framework using ippeveprinter

Currently there is no automated way of testing the self-certification tools. Goals:

  • Use ippeveprinter to simulate a variety of printers, both conforming and non-conforming.
  • Develop self-test scripts for Windows and macOS/Linux (that can be bundled with the tools) that runs them against ippeveprinter.
  • Make this self-test script part of the release process, such that a clean install should be able to pass the self-test on any of our supported platforms.

Windows IPP Everywhere Self Cert 1.0 Update 3: ipptool fails to run - missing regex.dll

If you install the IPP Everywhere Self Certification 1.0 Update 3 for Windows on a Windows 10 system (https://ftp.pwg.org/pub/pwg/tools/sw-ippeveselfcert10-20181023-windows.msi), and run "c:\Program Files\IPP Everywhere v1.0 Printer Self-Certification Tools\ipptool.exe", a dialog appears saying "The code execution cannot proceed because regex.dll was not found. Reinstalling the program may fix this problem."

ippevesubmit enhancements

From the April 2019 F2F:

  • ippevesubmit help isn't aligned properly
  • ippevesubmit should ask if this is for a print server
  • ippevesubmit should write to "printer name.json"

Update test scripts to use ippfind --literal-name option

The latest ippfind program supports a new --literal-name option that does an exact match instead of a regex match. This avoids problems with matching subsets of names and when the name contains regex characters like "[" and "]".

"You must first download and extract the PWG Raster...." shows up after followed README to setup document tests

You must first download and extract the PWG Raster Format sample files from:

http://ftp.pwg.org/pub/pwg/ipp/examples/

Before you can run this script.

README:
The corresponding PWG Raster sample files (see link in the introduction) MUST be placed in a subdirectory of the "tests" directory. For example:

cd tests
curl http://ftp.pwg.org/pub/pwg/ipp/examples/pwg-raster-samples-300dpi-20150616.zip >temp.zip
unzip temp.zip
rm temp.zip
cd ..

Improve README.md shipped with tools

The current README.md shipped with the tools is more of a manifest and less of a how-to document. Look at migrating as much of the portal documentation as possible to this file for future tools releases.

ipp-tests.test.in : Basic printing tests should use PWG Raster rather than JPEG

The "ipp-tests.test" / "ipp-tests.test.in" files include a number of tests that test printing using JPEG files. This is now not acceptable because with IPP Everywhere 1.1 Printers are now only required to support JPEG if they are color printers. This should be refactored to use a PWG Raster file of the appropriate resolution.

IppTool is showing junk output for "media-col-database" attribute

Run below command to access "media-col-database" attribute in windows, it will show junk output.
ipptool.exe -vtL ipp:///ipp/print d:\Data\ipptool\get-printer-attribute.test
With "-X" option it works.

get-printer-attribute.test
{
VERSION 2.0
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 keyword requested-attributes media-col-database

}

This issue was not seen in "ipptool-20140328-windows.msi" tool.
Tested using HP Laserjet printers.
ipptool-issue-media-col-database.zip

ipp-tests.test : I-27 Test - 10 second delay is sometimes inadequate

On line 1112, at the start of Test I-27, there is the directive:
"DELAY 10"

There are some printers that have a longer than 10 second delay before reporting 'media-needed'. Suggest leaving the "DELAY 10" but adding a retry to the EXPECT statement on line 1125 so that it becomes:

EXPECT printer-state-reasons OF-TYPE keyword IN-GROUP printer-attributes-tag WITH-VALUE "/^media-needed/" REPEAT-NO-MATCH REPEAT-LIMIT 12

This puts an upper bounds on the wait but will list the retries. Polling is not desirable but is inevitable here. (IPP Eventing? Let's not go there here...) We could do DELAY 5 and double the REPEAT-LIMIT so that the polling frequency is 5 seconds.

Test for finishings support should define HAVE_FINISHINGS if "finishings-supported" has value other than 3 (none)

This line:

EXPECT finishings-supported OF-TYPE enum IN-GROUP printer-attributes-tag DEFINE-MATCH HAVE_FINISHINGS

Should say instead:

EXPECT finishings-supported OF-TYPE enum IN-GROUP printer-attributes-tag WITH-VALUE >3 DEFINE-MATCH HAVE_FINISHINGS

This way it will only define HAVE_FINISHINGS if "finishings-supported" contains a value other than 3 (none).

ippevesubmit: Add outer JSON wrapper

Right now the JSON output is not a complete JSON value, just the fragment for the array.

Add a dummy top-level definition to make it a complete JSON value that can be validated.

scripts/make-ippeveselfcert.sh : build fails because renamed files aren't listed properly

The commit c25124e included a file rename (LICENSE.txt -> LICENSE.md) and mods to the scripts/make-ippeveselfcert.sh, but the modifications didn't properly deal with the file renaming.

So:

  1. fix the renamed file entry in the script
    -cp LICENSE.txt $pkgdir
    +cp LICENSE.md $pkgdir

  2. Get rid of the script's copy for "tests/LICENSE.md" which doesn't exist in that subdirectory

  3. Rename tests/README.txt to tests/README.md to make it be Markdown

bonjour-tests.sh: Requiring the best practice resource path "ipp/print" causes print servers to fail

If one runs the "bonjour-tests.sh" script against an IPP Everywhere Printer object hosted by a CUPS print server, it will fail because the resource path is not the best-practice "ipp/print" resource path. IPP Everywhere doesn't require that the printer's resource path is "ipp/print" so this should be removed from the test, to allow servers to pass. If there is a required resource path mandated in updates to IPP Everywhere this can be re-added.

Add more requested-attributes tests

Over in CUPS land we have discovered that some printers have issues with supporting the REQUIRED "requested-attributes" operation attribute with certain values. We need to add additional tests.

I developed a short test suite for CUPS, which can be adapted to the IPP tests for IPP Everywhere v1.1. It is attached.

get-printer-attributes-suite.test.txt

Some printer description attributes are required in the job template attributes

ipp-tests.bat "XXX-XXXX-0198D4"
I-10.6. Get-Printer-Attributes Operation (job-template) [FAIL]
RECEIVED: 4355 bytes in response
status-code = successful-ok (successful-ok)
EXPECTED: media-bottom-margin-supported
EXPECTED: media-col-supported
EXPECTED: media-left-margin-supported
EXPECTED: media-right-margin-supported
EXPECTED: media-size-supported
EXPECTED: media-source-supported
EXPECTED: media-top-margin-supported
EXPECTED: media-type-supported

In Table5 of IPP Everywhere v1.1, above expected attributes are defined as printer description attributes, not job template attributes. But this test item requies these attributes in job-template. Is it right?

Some bonjour tests failed on Ubuntu, but passed on macOS, same version of tests on same printer

Ubuntu Results:
B-1. IPP Browse test: FAIL
B-2. IPP TXT keys test: FAIL
B-3. IPP Resolve test: FAIL
B-4. IPP TXT values test: FAIL
pdl is missing image/jpeg: 'application/PCLm,application/octet-stream,image/pwg-raster,image/urf'
"bonjour-value-tests.test":
Validate TXT record values using Get-Printer-Attributes [PASS]
B-5. TLS tests: SKIP
B-5.1 HTTP Upgrade test: SKIP
B-5.2 IPPS Browse test: SKIP
B-5.3 IPPS TXT keys test: SKIP
B-5.4 IPPS Resolve test: SKIP
B-5.5 IPPS TXT values test: SKIP
Summary: 10 tests, 0 passed, 4 failed, 6 skipped
Score: 60%

macOS Results:
B-1. IPP Browse test: FAIL
B-2. IPP TXT keys test: PASS
B-3. IPP Resolve test: PASS
B-4. IPP TXT values test: FAIL
pdl is missing image/jpeg: 'application/PCLm,application/octet-stream,image/pwg-raster,image/urf'
"bonjour-value-tests.test":
Validate TXT record values using Get-Printer-Attributes [PASS]
B-5. TLS tests: PASS
B-5.1 HTTP Upgrade test: PASS
B-5.2 IPPS Browse test: FAIL
B-5.3 IPPS TXT keys test: PASS
B-5.4 IPPS Resolve test: PASS
B-5.5 IPPS TXT values test: FAIL
pdl is missing image/jpeg: 'application/PCLm,application/octet-stream,image/pwg-raster,image/urf'
"bonjour-value-tests.test":
Validate TXT record values using Get-Printer-Attributes [PASS]
Summary: 10 tests, 6 passed, 4 failed, 0 skipped
Score: 60%

Add new submission program

Based on our discussions at the last F2F, we will proceed with the development of a submission tool that creates JSON data appropriate for the new IPP Everywhere portal.

Changes needed to support print servers

Need to update test suite and/or submission page to better support IPP Everywhere print servers, particularly for virtual print servers that have no associated hardware marking devices (e.g. process and send PDF file over some transport) and thus do not have supplies, media, or printer identification.

ipp-tests.test: "document-number" member of "overrides-supported" should be "document-numbers"

On line 318 of "ipp-tests.test" and "ipp-tests.test.in", the line:

EXPECT overrides-supported OF-TYPE keyword IN-GROUP printer-attributes-tag WITH-VALUE "document-number" IF-DEFINED HAVE_PDF

ought to instead read:

EXPECT overrides-supported OF-TYPE keyword IN-GROUP printer-attributes-tag WITH-VALUE "document-numbers" IF-DEFINED HAVE_PDF

since the member of "overrides" / "overrides-supported" is "document-numbers" according to the IANA registry and PWG 5100.6.

Reported by Eren Rodriguez from HP Inc.

printer-supply and printer-alert issues

ipptool is currently unable to use a regular expression to match an octetString value.

Also, the regular expressions for these attributes seem to be broken...

Fix for 1.0 update 4 and 1.1.

ipp-tests.test : I-16 Test - REPEAT-LIMIT of 30 is sometimes inadequate

Test I-16 which attempts to Get-Job-Attributes until the Print-Job from I-12 is completed, uses a REPEAT-LIMIT of 30 on line 666:

EXPECT job-state OF-TYPE unknown|enum IN-GROUP job-attributes-tag COUNT 1 WITH-VALUE >6 REPEAT-NO-MATCH REPEAT-LIMIT 30

After the limit is reached, I-16 will not be repeated. This causes I-16 to pass even when the job from I-12 is in the processing state. In the case where I-16 (incorrectly?) passes with a processing job, if the job from I-12 is still not completed and no completed job exists, I-17 and I-18 can fail because they send a Get-Jobs request with which-jobs=completed and expect job attributes in the response. Similarly, in the case where I-16 passes with a processing job, if the job from I-12 is still not completed, the Cancel-Job operation from I-19 can also fail because it assumes the job from I-12 is completed and expects the returned status code of client-error-not-possible.

As Smith indicated for a different issue, polling is not desirable but is inevitable here. We found printers that could take about 60 iterations to pass but I advise a REPEAT-LIMIT of 100 so that we don't revisit this issue again for slower printer mechanisms.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.