Merge lp:~pitti/autopilot/fix-uinput into lp:autopilot

Proposed by Martin Pitt
Status: Merged
Approved by: Christopher Lee
Approved revision: 509
Merged at revision: 508
Proposed branch: lp:~pitti/autopilot/fix-uinput
Merge into: lp:autopilot
Diff against target: 82 lines (+8/-27)
4 files modified
autopilot/input/_uinput.py (+2/-6)
autopilot/tests/functional/test_input_stack.py (+2/-4)
debian/61-autopilot3-uinput.rules (+2/-2)
debian/python3-autopilot.postinst (+2/-15)
To merge this branch: bzr merge lp:~pitti/autopilot/fix-uinput
Reviewer Review Type Date Requested Status
Christopher Lee (community) Approve
PS Jenkins bot continuous-integration Approve
Review via email: mp+228813@code.launchpad.net

Commit message

Replace group membership based access to /dev/uinput with dynamic ACLs for the current foreground session, and drop the /dev/autopilot-uinput symlink and "autopilot" group.

Description of the change

Fix permission and symlink handling for /dev/uinput. Please see the individual commit logs and the bug report for details.

To post a comment you must log in.
Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :

PASSED: Continuous integration, rev:509
http://jenkins.qa.ubuntu.com/job/autopilot-ci/834/
Executed test runs:
    SUCCESS: http://jenkins.qa.ubuntu.com/job/autopilot-utopic-amd64-ci/109
        deb: http://jenkins.qa.ubuntu.com/job/autopilot-utopic-amd64-ci/109/artifact/work/output/*zip*/output.zip
    SUCCESS: http://jenkins.qa.ubuntu.com/job/autopilot-utopic-armhf-ci/108
        deb: http://jenkins.qa.ubuntu.com/job/autopilot-utopic-armhf-ci/108/artifact/work/output/*zip*/output.zip
    SUCCESS: http://jenkins.qa.ubuntu.com/job/autopilot-utopic-i386-ci/108
        deb: http://jenkins.qa.ubuntu.com/job/autopilot-utopic-i386-ci/108/artifact/work/output/*zip*/output.zip
    SUCCESS: http://jenkins.qa.ubuntu.com/job/generic-deb-autopilot-utopic-touch/2714
    SUCCESS: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-utopic-autopilot/259
    SUCCESS: http://jenkins.qa.ubuntu.com/job/generic-deb-autopilot-runner-mako/2820
    SUCCESS: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-builder-utopic-armhf/3957
        deb: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-builder-utopic-armhf/3957/artifact/work/output/*zip*/output.zip
    SUCCESS: http://s-jenkins.ubuntu-ci:8080/job/touch-flash-device/10673
    SUCCESS: http://jenkins.qa.ubuntu.com/job/autopilot-testrunner-otto-utopic-autopilot/308
    SUCCESS: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-builder-utopic-amd64/2418
        deb: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-builder-utopic-amd64/2418/artifact/work/output/*zip*/output.zip

Click here to trigger a rebuild:
http://s-jenkins.ubuntu-ci:8080/job/autopilot-ci/834/rebuild

review: Approve (continuous-integration)
Revision history for this message
Martin Pitt (pitti) wrote :

Jean-Baptiste tested that udev rule yesterday on another phone. I just tested the complete package on mako build 157:

 * download/adb push above armhf binaries, install them, and remount / read-only again
 * Ensure udev rule is being applied during upgrade:

   $ getfacl /dev/uinput
   getfacl: Removing leading '/' from absolute path names
   # file: dev/uinput
   # owner: root
   # group: 110
   user::rw-
   user:phablet:rw-
   group::rw-
   mask::rw-
   other::---

   (notice the user:phablet -- that's the ACL)

 * Clean up after previous autopilot:
   sudo deluser phablet autopilot
   sudo delgroup --system autopilot

 * $ test -w /dev/uinput && echo yes
   yes

 * Run AP test for calculator (on desktop, not phablet-shell):
  $ bzr checkout --lightweight lp:ubuntu-calculator-app
  $ adt-run ubuntu-calculator-app/ --click com.ubuntu.calculator --- ssh -s adb
  -> success

 * Reboot, re-run the last two commands successfully

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

LGTM

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'autopilot/input/_uinput.py'
2--- autopilot/input/_uinput.py 2014-05-23 13:25:43 +0000
3+++ autopilot/input/_uinput.py 2014-07-30 10:33:25 +0000
4@@ -20,7 +20,6 @@
5 """UInput device drivers."""
6
7 import logging
8-import os.path
9
10 from evdev import UInput, ecodes as e
11
12@@ -35,11 +34,8 @@
13
14
15 def _get_devnode_path():
16- """Provide a fallback uinput node for devices which don't support udev"""
17- devnode = '/dev/autopilot-uinput'
18- if not os.path.exists(devnode):
19- devnode = '/dev/uinput'
20- return devnode
21+ """Return the uinput device node"""
22+ return '/dev/uinput'
23
24
25 class _UInputKeyboardDevice(object):
26
27=== modified file 'autopilot/tests/functional/test_input_stack.py'
28--- autopilot/tests/functional/test_input_stack.py 2014-05-23 13:12:50 +0000
29+++ autopilot/tests/functional/test_input_stack.py 2014-07-30 10:33:25 +0000
30@@ -50,12 +50,10 @@
31
32 def setUp(self):
33 super(InputStackKeyboardBase, self).setUp()
34- if self.backend == 'UInput' and not (
35- os.access('/dev/autopilot-uinput', os.W_OK) or
36- os.access('/dev/uinput', os.W_OK)):
37+ if self.backend == 'UInput' and not os.access('/dev/uinput', os.W_OK):
38 raise SkipTest(
39 "UInput backend currently requires write access to "
40- "/dev/autopilot-uinput or /dev/uinput")
41+ "/dev/uinput")
42
43
44 class InputStackKeyboardCreationTests(InputStackKeyboardBase):
45
46=== modified file 'debian/61-autopilot3-uinput.rules'
47--- debian/61-autopilot3-uinput.rules 2014-04-28 23:13:02 +0000
48+++ debian/61-autopilot3-uinput.rules 2014-07-30 10:33:25 +0000
49@@ -1,2 +1,2 @@
50-# Creates autopilot group specific access to /dev/uinput
51-KERNEL=="uinput", SUBSYSTEM=="misc", SYMLINK="autopilot-uinput", GROUP="autopilot", MODE="0660"
52+# Make local foreground session able to run autopilot
53+KERNEL=="uinput", SUBSYSTEM=="misc", TAG+="uaccess"
54
55=== modified file 'debian/python3-autopilot.postinst'
56--- debian/python3-autopilot.postinst 2013-09-12 16:07:27 +0000
57+++ debian/python3-autopilot.postinst 2014-07-30 10:33:25 +0000
58@@ -3,22 +3,9 @@
59
60 set -e
61
62-AUTOPILOT_GROUP=autopilot
63-
64 if [ "$1" = configure ]; then
65- # Add the autopilot group
66- addgroup --quiet \
67- --system \
68- --no-create-home \
69- "$AUTOPILOT_GROUP" || true
70-
71- # Add each sudo user to the autopilot group
72- for u in $(getent group sudo | sed -e "s/^.*://" -e "s/,/ /g"); do
73- adduser --quiet "$u" "$AUTOPILOT_GROUP" > /dev/null || true
74- done
75-
76- # udev rules were installed, trigger creation of the /dev node
77- udevadm trigger --action=change
78+ # udev rules were installed, trigger update of /dev/uinput
79+ udevadm trigger --action=change --sysname-match=uinput
80 fi
81
82 #DEBHELPER#

Subscribers

People subscribed via source and target branches