-
Notifications
You must be signed in to change notification settings - Fork 43
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Initial printing support for sd-export-usb #277
Conversation
Provides inital support for printing files inside an `sd-export` archive sent to sd-export-usb. The format supports two actions: * `"device": "printer-test"` will print the default printer test page. * `"device": "printer" will print the documents in the archive.
abe9697
to
5f1d51b
Compare
* Ensure more reliable and DRY parsing of sd-export metadata.json * Use notify-send to provide user feedback on export status
I understand that we'll likely want to treat each print job as blocking other print jobs for now. I'm still curious what happens in this proof-of-concept implementation if we don't. What happens in this implementation if you kick off a job when one is already in progress? And one after that? Does the printer queue get cleared out? Do previous jobs get interrupted? |
66015d1
to
7b344c6
Compare
No : because the Disposable VM is not shut down, the previous job remains in the printer queue, and sent to the printer. If another job is triggered, it will appended to the queue and be printed after the first one. Given the manual nature of the export flow at this point, it's very hard to effectively test for race conditions. |
* Use xpp for printer settings menu prior to sending to printer, add applet for printing * Poll lpinfo to wait for job to be sent before returning: lpinfo considers the job complete once the job was sent to the printer, and *not* when the print is completed. * Convert openoffice files to pdf prior to printing, which requires openoffice to be installed. This will convert the openoffice document to pdf. Out of the box, lp/xpp/lpr cannot print openoffice/word files * Delete extracted files from /tmp/ after printing.
…n.list fpf-apt-test-repo.sls would append the repo URL to /etc/apt/sources.list.d/securedrop_workstation.list each time make * is called. This is because templates persist accross installs, and the source is added to the template. Using `clean_file: True` will ensure `/etc/apt/sources.list.d/securedrop_workstation.list` is squashed each time fpf-apt-test-repo.sls is invoked.
Followed instructions as given for setup.
Created a .sd-export archive with export method in metadata.json set to "device": "printer" and added pdf and text files under the export_data folder to be printed, ran
app tests
All 12 tests passed, 1 warning about the imp module's deprecation. Looks good @emkll! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Approved based on test plan and diff review
Functional testing
Note that for now this should only work with brother printers due to .ppd configuration that must be done within the dispVM itself. I will try to get my hands on other printer makes/models to support other vendors.
Testing should be very similar to that performed in #259, as the handler script is the same and the export archive format is the same
config.json
(you can see which usb device is used by runningqvm-usb
in dom0)make all
ormake sd-export
with a printer connected to the configured usbIn sd-svs:
metadata.json
set to"device": "printer-test"
metadata.json
set to"device": "printer"
App tests (for sd-export-usb)