Unable to use shutter while running resolution cycle test

Bug #1329728 reported by Po-Hsu Lin
14
This bug affects 2 people
Affects Status Importance Assigned to Milestone
Checkbox Provider - Base
Fix Released
High
Daniel Manrique

Bug Description

While running the resolution cycle test, it complains about:
Could not configure screenshot tool -
                     you may need to install the package 'shutter',
                     or check that /home/ubuntu/.shutter/profiles/ exists.
I do have this package installed, and that directory does exist.

And the suggested result will be "failed", despite the display went through all available resolutions

It looks like there is something to do with our xrandr_cycle script,
the following command throws the same error message
xrandr_cycle --screenshot-dir /home/ubuntu/Pictures

ubuntu@201301-12638:~$ dpkg -l | grep shutter
ii shutter 0.90.1-0ubuntu1 all feature-rich screenshot program

Related branches

Revision history for this message
Po-Hsu Lin (cypressyew) wrote :
Revision history for this message
Po-Hsu Lin (cypressyew) wrote :

I found this issue exist since 12.04.1.
(the attachment for 201206-11394 with 12.04.1 is only 12 bytes)
Nothing to do with the new stack or new version of Ubuntu

Daniel Manrique (roadmr)
Changed in plainbox-provider-checkbox:
assignee: nobody → Daniel Manrique (roadmr)
status: New → In Progress
importance: Undecided → High
Revision history for this message
Daniel Manrique (roadmr) wrote :

OK here's what's happening. The diagnostic message is inaccurate; shutter is installed and the directory in question was created (the script creates it itself). There is however a third possibility for failure.

The script uses a custom shutter profile, this is shipped in data/settings/shutter.xml. The script is made to work with the old checkbox layout where everything lived under /usr/share/checkbox. First, the script finds the "base" checkbox path:

script_home = os.path.split(os.path.dirname(os.path.realpath(__file__)))[0]

If os.path.realpath(__file__) is /usr/share/checkbox/scripts , then the split and [0] chop off the last component, resulting in /usr/share/checkbox, and there is a 'data/settings/shutter.xml' relative to that directory.

WHen using this under plainbox (new stack), the binary is installed in /usr/lib/2013.com.canonical.certification:checkbox/bin, so the path manipulation will look for the data file in /usr/lib/2013.com.canonical.certification:checkbox/data/settings/shutter.xml. But due to splitting of data and binaries in plainbox providers, the file actually lives (and is correctly shipped in) /usr/share/2013.com.canonical.certification:checkbox/data/settings/shutter.xml.

So the file is not found (see line 90 in the script that tries to copy it and just blindly ignores the exception if it's not found), and then the diagnostic message shown is thrown when shutter.xml can't be read in the expected location (line 119). A lot of exceptions can happen in that block so the message is necessarily a bit vague.

So how to fix this:

- Modify the way the script obtains the shutter.xml template. Either we make it look in both possible locations ($PLAINBOX_PROVIDER_DATA is provided for convenience), we make it look ONLY in that location (since this problem affects only new-stack and not legacy we can leave legacy alone), or we ship the shutter.xml template in the script itself, as a heredoc for instance.

- Try to fix the exception handling so it's not so blind and shotgun-like, it should give clearer error messages and if possible it should NOT just pass exceptions.

I'll set this to triaged now.

Revision history for this message
Daniel Manrique (roadmr) wrote :

er, no, I'll just keep it as "in progress" and fix it right now.

Daniel Manrique (roadmr)
Changed in plainbox-provider-checkbox:
milestone: none → 0.6
Changed in plainbox-provider-checkbox:
milestone: 0.6 → 0.7
Changed in plainbox-provider-checkbox:
milestone: 0.7 → 0.8
Daniel Manrique (roadmr)
Changed in plainbox-provider-checkbox:
status: In Progress → Fix Committed
Changed in plainbox-provider-checkbox:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Duplicates of this bug

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.