[cups-devel] Simulating an IPP printer with desired attributes using ipptool and ipptoolfile

Kennedy, Smith (Wireless Architect) smith.kennedy at hp.com
Mon Jun 19 12:54:52 PDT 2017


Hi Sahil,

Have you looked into using "ippserver"?

http://istopwg.github.io/ippsample/ <http://istopwg.github.io/ippsample/>

That lets you directly create the simulator via config files rather than running ipptool with a bunch of .test files...


Smith

/**
    Smith Kennedy
    HP Inc.
*/

> On Jun 19, 2017, at 1:48 PM, Sahil Arora <sahilarora.535 at gmail.com> wrote:
> 
> Hi,
> I recently came across a test file while creates a printer in cups:
> 
> ### Start of test file create-printer.test
> # Create a local (temporary) print queue
> #
> # Usage:
> #
> #    ipptool -tv -d name=... -d device=ipp://... ipp://localhost:port/
> cups-create-local-printer.test
> {
>    # The name of the test...
>    NAME "Create local print queue"
> 
>    # The operation to use
>    OPERATION CUPS-Create-Local-Printer
> 
>    # Attributes, starting in the operation group...
>    GROUP operation-attributes-tag
>    ATTR charset attributes-charset utf-8
>    ATTR language attributes-natural-language en
>    ATTR uri printer-uri $uri
>    ATTR name requesting-user-name $user
> 
>    GROUP printer-attributes-tag
>    ATTR name printer-name $name
>    ATTR uri device-uri $device
> 
>    # What statuses are OK?
>    STATUS successful-ok
> 
>    # What attributes do we expect?
>    EXPECT printer-is-accepting-jobs OF-TYPE boolean
>    EXPECT printer-state OF-TYPE enum
>    EXPECT printer-state-reasons OF-TYPE keyword
>    EXPECT printer-uri-supported OF-TYPE uri
> }
> ### End of test file
> 
> This does indeed create a printer for me in cups with the name
> "customPrinter" when I run this file using the command:
> 
> `ipptool -tv -d name=customPrinter -d device=ipp://customPrinter
> ipp://localhost:631/ create-printer.test`
> 
> However, in this test file, the operation "CUPS-Create-Local-Printer" is
> not defined in the IANA IPP Registrations assignments for Operations<
> https://www.iana.org/assignments/ipp-registrations/ipp-registrations.xhtml#ipp-registrations-7
>> 
> 
> Is this operation local to CUPS? If yes, then where can I find all such
> operations local to CUPS, since I could not find any in the ipptoolfile man
> page<https://www.cups.org/doc/man-ipptoolfile.html?TOPIC=Man+Pages> or the
> ipptool man page<
> 
> 2. If I try to change/update the values of some attributes of my virtual
> printer, for instance the location, I write the following line in my
> "create-printer.test" file in group "printer-attributes-tag":
> 
> # Change value of attribute printer-location
> ATTR textWithoutLanguage printer-location TESTLOCATION
> 
> This indeed changes the value of the attribute and is reflected when I run
> "get-printer-attributes.test" on the printer. However, if I try to change
> some other attribute, for instance "copies-supported" or
> "print-quality-default" or any other attribute, it does not reflect in the
> get-printer-attributes request. The code I used to modify these attributes
> in the test file are:
> 
> # Change custom attributes
> ATTR enum print-quality-default high
> ATTR boolean server-is-sharing-printers true
> ATTR integer copies-default 13
> 
> 3. In some printers, there are other attributes as well. For instance, in a
> printer which supports PCLm, there are attributes like:
> 
> pclm-source-resolution-default (resolution) = 600dpi
> pclm-strip-height-supported (integer) = 16
> pclm-strip-height-preferred (integer) = 16
> 
> How should these attributes be added to the virtual printer so that they
> come up on a get-printer-attributes request? I tried adding them using the
> same format, but to no avail.
> 
> Thanks.
> --
> Sahil Arora
> _______________________________________________
> cups-devel mailing list
> cups-devel at cups.org
> https://lists.cups.org/mailman/listinfo/cups-devel



More information about the cups-devel mailing list