Bug 7649 - Printer handling requires Python 2
Summary: Printer handling requires Python 2
Status: CLOSED FIXED
Alias: None
Product: ThinLinc
Classification: Unclassified
Component: Printing (show other bugs)
Version: trunk
Hardware: PC Unknown
: P2 Normal
Target Milestone: 4.13.0
Assignee: Frida Flodin
URL:
Keywords: nikle_tester, prosaic
Depends on:
Blocks: 4586
  Show dependency treegraph
 
Reported: 2021-02-22 10:06 CET by Frida Flodin
Modified: 2021-08-17 10:04 CEST (History)
1 user (show)

See Also:
Acceptance Criteria:


Attachments

Description Frida Flodin cendio 2021-02-22 10:06:49 CET
We need to convert it to work with Python 3
Comment 1 Frida Flodin cendio 2021-02-22 10:18:47 CET
When fixing bug 7554 non-ASCII printer names does not work anymore. (Before it only worked on UTF-8 systems)

It should work again, on any system, when tl-limit-printers run with Python 3. This needs to be tested on this bug.


(Bug 7554, comment 179)
> Tested the following on Ubuntu20.04 with build 6753.r36201:
> ✓ ASCII printer name both tlwebadm and tl-limit-printer
> ✓ non-ASCII printer name in tlwebadm
> ✗ non-ASCII printer name in tl-limit-printers*
> ✓ tlwebadm/locations on server with locale GB18030 and UTF-8
> ✓ tl-limit-printers on server with locale GB18030 and UTF-8
> 
> 
> * This is broken as long as we still run tl-limit-printers with Python 2.
> When tl-limit-printers is running with Python 3 this should work.
Comment 22 Frida Flodin cendio 2021-06-22 16:32:13 CEST
Tested thinlocal
----------------
Build 2166.
Server on Fedora 34 with cups 2.3.3. 
Client on Fedora 33.

Tested:
✓ Content from stdin
  ✓ Is printed.
  ✓ Tempfile on server is removed.
  ✓ Non-ascii input on UTF-8 system.
✓ Content from file is printed.
✓ Content type is correctly sent to client.
✓ Jobname is correctly sent to client. 
✓ vsmserver is not responding -> the job is printed once it's up again
Comment 23 Frida Flodin cendio 2021-06-22 16:35:58 CEST
Tested nearest
----------------
Build 2166.
Server on Fedora 34 with cups 2.3.3.
Client on Fedora 32.

Tested:
✓ Content from stdin
  ✓ Is printed.
  ✓ Tempfile on server is removed.
  ✓ Non-ascii input on UTF-8 system.
✓ Content from file is printed.
✓ The client terminal was not found in configuration
✓ Nearest printer is configured as 'nearest'.
✓ ipp command returned != 0
✓ Multiple copies
✓ Non-ASCII content in file
Comment 24 Frida Flodin cendio 2021-06-23 10:49:02 CEST
Tested thinlocal respooling on RHEL 8 (cups-2.2.6) with build 2168.

- Given:
Two agents configured in a subcluster connected to one master. User has ThinLinc active session on agent A.

- When: 
User connects via ssh to agent B and prints a job to 'thinlocal' printer.

- Then:
The job is respooled to agent A and then printed to 'thinlocal' on agent A. Finally the job is printed on the local printer of the ThinLinc session.



NOTE:
-----
Had to allow remote printing on agent A
> cupsctl --remote-admin --remote-any --share-printers
And disable the firewall to send the printing job.
Comment 25 Frida Flodin cendio 2021-06-23 13:38:30 CEST
Tested tl-limit-printers on Fedora 34 with server build 2168.

✓ Limited on session start
✓ Limited on reconnect
✓ No USER variable
✓ User has no session
✓ Limited via hardware address
✓ Limited via location
✓ Non-ASCII printer name (Fixes comment #1 (Only tested on UTF-8 though))
✓ Multiple users
  ✓ From same hardware address
  ✓ From two different hwaddr
  ✓ One execution of tl-limit-printers updates printers for all users
✓ Connecting from unknown hardware address.
✓ Configured printer that does not exist.
✓ vsmserver not responding
Comment 26 Frida Flodin cendio 2021-06-23 14:05:39 CEST
Tested tl-lp-redir on Fedora 34 with server build 2168.

Tested this by running this in a ThinLinc session:
> echo "text" > /var/opt/thinlinc/sessions/cendio/last/dev/lp0

✓ The content is printed on the client's local printer.
✓ [..]/dev/lp0 is deleted once the session is terminated.
Comment 27 Frida Flodin cendio 2021-06-23 14:38:16 CEST
Tested thinlinc-ps2pdf filter on Fedora 34 with server build 2168.

This is tested by printing a postscript file to 'thinlocal', the filter will convert the file to PDF before sending it to the client.


✓ Printing .ps content from stdin
✓ Printing .ps content from file

NOTE:
Make sure the filter actually is used by checking the cups log. If there is another filter that does the same thing with lower cost it will be used instead. I had to remove '/usr/lib/cups/filter/gstopdf' and then restart cups.
Comment 33 Frida Flodin cendio 2021-06-24 14:33:05 CEST
Had to fix some resource warnings.

Things that need retesting: 

tl-limit-printers
-----------------
  - [ ] Make sure the right information about sessions is fetched
  - [ ] Can't connect to vsmserver -> no ResourceWarnings
  - [ ] A printer is configured but does not exists -> check log entry
  - [ ] Make sure lockfile is closed -> no ResourceWarnings


thinlocal
---------
  - [ ] A job can be printed to local printer
  - [ ] No ResourceWarnings when vsmserver is unreachable
Comment 34 Frida Flodin cendio 2021-06-28 11:14:15 CEST
(In reply to Frida from comment #33)
> Had to fix some resource warnings.
> 
> Things that need retesting: 
> 
> tl-limit-printers
> -----------------
>   - [X] Make sure the right information about sessions is fetched
>   - [X] Can't connect to vsmserver -> no ResourceWarnings
>   - [X] A printer is configured but does not exists -> check log entry
>   - [X] Make sure lockfile is closed -> no ResourceWarnings
> 
> 
> thinlocal
> ---------
>   - [X] A job can be printed to local printer
>   - [X] No ResourceWarnings when vsmserver is unreachable

Tested on Fedora 34 with build 2172.
Comment 36 Frida Flodin cendio 2021-06-28 16:26:20 CEST
Tested on SLES 12 (cups-1.7.5), ThinLinc server build 2175:

✓ thinlocal
✓ nearest
✓ l-limit-printers
✓ tl-lp-redir
✗ thinlinc-ps2pdf*

* Found a ResourceWarning that needs fixing.
> D [28/Jun/2021:15:47:48 +0200] [Job 11] /usr/lib/cups/filter/thinlinc-ps2pdf:38: ResourceWarning: unclosed file <_io.BufferedReader name='/var/spool/cups/d00011-001'>
Comment 38 Frida Flodin cendio 2021-06-29 08:00:43 CEST
The resource warning from thinlinc-ps2pdf is now fixed. Tested on SLES 12 with build 2176.

Now everything should be converted to Python 3 and tested.


Some useful tips for tester:
* I mostly used Cups-PDF to check that the prints are correct.

* If you want to create a fake printer that does nothing when printed to: 
> lpadmin -p my_test_printer -E -v file:///dev/null
* Easy printing from command line, for example:
> echo 'hello' | lpr -P thinlocal
Comment 39 Niko Lehto cendio 2021-07-02 09:06:46 CEST
Tested these on a Fedora 33 server with build 2188:

Tested thinlocal
----------------
✓ Content from stdin
  ✓ Is printed.
  ✓ Tempfile on server is removed.
  ✓ Non-ascii input on UTF-8 system.
✓ Content from file is printed.
✓ Content type is correctly sent to client.
✓ Jobname is correctly sent to client. 
✓ vsmserver is not responding -> the job is printed once it's up again

✓ Resource warning check:
  ✓ A job can be printed to local printer
  ✓ No ResourceWarnings when vsmserver is unreachable

Tested tl-limit-printers
------------------------
✓ Limited on session start
✓ Limited on reconnect
✓ No USER variable
✓ User has no session
✓ Limited via hardware address
✓ Limited via location
✓ Non-ASCII printer name
✓ Multiple users
  ✓ From same hardware address
  ✓ From two different hwaddr
  ✓ One execution of tl-limit-printers updates printers for all users
✓ Connecting from unknown hardware address.
✓ Configured printer that does not exist.
✓ vsmserver not responding

Resource warning checks:
✓ Can't connect to vsmserver -> no ResourceWarnings
✓ Make sure the right information about sessions is fetched
✓ Make sure lockfile is closed -> no ResourceWarnings

tl-lp-redir
-----------
✓ The content is printed on the client's local printer.
✓ [..]/dev/lp0 is deleted once the session is terminated.

thinlinc-ps2pdf
---------------
✓ Printing .ps content from stdin
✓ Printing .ps content from file

Looks good!

Left to test:

Non-ASCII printer names. (non UTF-8 system)

Nearest
----------------
  Content from stdin
    Is printed.
    Tempfile on server is removed.
    Non-ascii input on UTF-8 system.
  Content from file is printed.
  The client terminal was not found in configuration
  Nearest printer is configured as 'nearest'.
  ipp command returned != 0
  Multiple copies
  Non-ASCII content in file
Comment 40 Niko Lehto cendio 2021-07-02 16:41:55 CEST
Tested on Fedora 33 server with build 2188:

Tested nearest
----------------
✓ Content from stdin
  ✓ Is printed.
  ✓ Tempfile on server is removed.
  ✓ Non-ascii input on UTF-8 system.
✓ Content from file is printed.
✓ The client terminal was not found in configuration
✓ Nearest printer is configured as 'nearest'.
✓ ipp command returned != 0
✓ Multiple copies
✓ Non-ASCII content in file

Left to test:
  Respooling
  Non-ASCII printer names. (non UTF-8 system)
Comment 41 Niko Lehto cendio 2021-07-05 16:36:52 CEST
tested on build 2188 with Fedora 33 server:
✓ Respooling
✓ Non-ASCII printer names. (non UTF-8 system)

Works good!

Note You need to log in before you can comment on or make changes to this bug.