Click app (Camera) cannot find qttestability library

Bug #1424889 reported by Christopher Lee
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
autopkgtest (Ubuntu)
Fix Released
High
Martin Pitt

Bug Description

I'm unable to run the camera autopilot tests using adt-run. According to the application log[1] it fails to find the qttestability library file (and thus autopilot can't introspect it.)

To reproduce this I run these commands:
  $ ubuntu-device-flash --developer-mode --password 0000 --channel="ubuntu-touch/devel-proposed" --wipe
  $ phablet-network
  $ phablet-click-test-setup --click com.ubuntu.camera
  $ adt-run -d -l /tmp/adt-run-camera.log --output-dir /tmp/veebers/ --click com.ubuntu.camera --timeout-short=600 --- ssh -s adb -- -p 0000

I've pastebin-ed the adt-run log too: http://paste.ubuntu.com/10380312/

A quick look shows that LD_LIBRARY_PATH includes the path that has the .so files. Further more if I set the image writable and install the qttestability-autopilot package then reset the image to readonly running this command works (presumably due to using the dpkg installed library).

[1] See attached subunit file which includes application log.

Revision history for this message
Christopher Lee (veebers) wrote :
Revision history for this message
Martin Pitt (pitti) wrote :

Please don't run phablet-click-test-setup together with adt-run. I don't know what it does specifically, but it is somewhere between "redundant" and "confuses adt-run".

Revision history for this message
Christopher Lee (veebers) wrote :

I tried the run without the phablet-click-test-setup but experienced the same issues,

Attached log file here: http://paste.ubuntu.com/10384363/

Revision history for this message
Martin Pitt (pitti) wrote :

I tried that very command on a current vivid-proposed mako image #110, and it works just fine. However, you run utopic's version of autopkgtest (3.6git1) which is too old to know about the touch changes in vivid. Please grab and install vivid's autopkgtest: http://archive.ubuntu.com/ubuntu/pool/main/a/autopkgtest/autopkgtest_3.9.7_all.deb (works fine on precise upwards).

Changed in autopkgtest (Ubuntu):
status: New → Fix Released
Revision history for this message
Brendan Donegan (brendan-donegan) wrote :

The command Chris gives does work with that version of autopkgtest but when I branch:

 lp:~canonical-platform-qa/ubuntu-sanity-tests/camera-test-blur-example

and run:

python3 -m ubuntu_sanity_tests.command_line ubuntu_sanity_tests.tests.test_camera_picture.TestImageCapture.test_blurring

then the same error occurs

Changed in autopkgtest (Ubuntu):
status: Fix Released → New
Revision history for this message
Brendan Donegan (brendan-donegan) wrote :

The error looks like:

Library qttestability load failed: "Cannot load library qttestability: (qttestability: cannot open shared object file: No such file or directory)"
Library qttestability load failed!

Revision history for this message
Christopher Lee (veebers) wrote :

Ok right, so installed the linked updated version of autopkgtest and it gets further for me (I see some tests pass).

I do see, however, this message:
Testability driver loaded. Wire protocol version is "1.4".
Testability driver loaded. Wire protocol version is "1.4".
Unable to register object on D-Bus! Testability interface will not be available.

For some reason it appears that the app is attempting to load the testability driver twice (and failing to register the 2nd time).

Not sure why this is happening (or if its recent) but it's not normal. This is on the app end though.

Revision history for this message
Martin Pitt (pitti) wrote :

Mystery solved:

[13232.018182] type=1400 audit(1424844047.097:122): apparmor="DENIED" operation="open" profile="com.ubuntu.camera_camera_3.0.0.484" name="/tmp/adt-run.cXxSBr/deps/usr/lib/libqttestability.so.1.0.0" pid=31948 comm="camera-app" requested_mask="r" denied_mask="r" fsuid=32011 ouid=0

Christopher's original report specified a --click explicity; for that, autopkgtest will modify the apparmor profile to allow introspection and loading stuff from the test deps temp dir. But the ubuntu-sanity-tests invocation does not involve any explicit --click, thus there is no apparmor modification.

For this it seems we need to bite the bullet and modify the apparmor profile for *all* installed clicks: i. e. if the test is running in a touch+apparmor+click environment, but only a Debian package is specified and no --click. This will add 3 minutes to the test run (one complete apparmor profile update takes ~ 1.5 min, and we have to revert it at the end of the test), but I guess we have to bite that bullet.

Changed in autopkgtest (Ubuntu):
importance: Undecided → High
status: New → In Progress
assignee: nobody → Martin Pitt (pitti)
Revision history for this message
Martin Pitt (pitti) wrote :

Workaround: Call "phablet-config autopilot --dbus-probe enable" once after reinstalling the phone, then the test should run.

Revision history for this message
Martin Pitt (pitti) wrote :

Sorry, scratch that; dbus-probe enable won't suffice. You can try http://people.canonical.com/~pitti/tmp/adt-run instead; this isn't a final solution as it is horribly inefficient for other use cases, but it at least should avoid this bug.

Revision history for this message
Martin Pitt (pitti) wrote :

This is a simple reproducer:

$ adt-run testclick/ --- ssh -s adb
[...]
FAIL: libqttestability.so not loaded by calculator (pid 2124)

Revision history for this message
Martin Pitt (pitti) wrote :
Changed in autopkgtest (Ubuntu):
status: In Progress → Fix Committed
Revision history for this message
Brendan Donegan (brendan-donegan) wrote :

Works perfectly

Revision history for this message
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package autopkgtest - 3.11

---------------
autopkgtest (3.11) unstable; urgency=medium

  Improvements:
  * Add action argument --testname to run only one individual test from the
    next package.

  Bug fixes:
  * Restore click AppArmor profiles after a test, if we modified them before
    the test.
  * When running a deb test in a click+AppArmor environment, update AppArmor
    rules for all clicks for introspectability and temporary test
    dependencies. This takes about a minute before the test, and another one
    after the test, but is necessary for use cases like ubuntu-sanity-tests.
    (LP: #1424889)

 -- Martin Pitt <email address hidden> Fri, 27 Feb 2015 07:02:52 +0100

Changed in autopkgtest (Ubuntu):
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

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