Mir

Merge lp:~raof/mir/udevify-eventhub into lp:mir

Proposed by Chris Halse Rogers
Status: Merged
Approved by: Daniel van Vugt
Approved revision: no longer in the source branch.
Merged at revision: 1477
Proposed branch: lp:~raof/mir/udevify-eventhub
Merge into: lp:mir
Prerequisite: lp:~raof/mir/vtinator
Diff against target: 1913 lines (+1278/-151)
32 files modified
3rd_party/android-input/android/CMakeLists.txt (+2/-0)
3rd_party/android-input/android/frameworks/base/services/input/EventHub.cpp (+46/-92)
3rd_party/android-input/android/frameworks/base/services/input/EventHub.h (+6/-5)
benchmarks/android-input/CMakeLists.txt (+3/-1)
cmake/MirCommon.cmake (+6/-3)
cmake/src/mir/mir_discover_gtest_tests.cpp (+15/-2)
debian/control (+1/-1)
deploy-and-test.sh (+21/-0)
include/test/mir_test_framework/udev_environment.h (+1/-0)
tests/CMakeLists.txt (+3/-10)
tests/acceptance-tests/test_server_disconnect.cpp (+2/-0)
tests/acceptance-tests/test_surfaces_with_output_id.cpp (+5/-0)
tests/mir_test_framework/CMakeLists.txt (+9/-11)
tests/mir_test_framework/udev_environment.cpp (+22/-2)
tests/mir_test_framework/udev_recordings/bluetooth-magic-trackpad.ioctl (+21/-0)
tests/mir_test_framework/udev_recordings/bluetooth-magic-trackpad.umockdev (+222/-0)
tests/mir_test_framework/udev_recordings/laptop-keyboard.ioctl (+12/-0)
tests/mir_test_framework/udev_recordings/laptop-keyboard.umockdev (+74/-0)
tests/mir_test_framework/udev_recordings/synaptics-touchpad.ioctl (+29/-0)
tests/mir_test_framework/udev_recordings/synaptics-touchpad.umockdev (+65/-0)
tests/mir_test_framework/udev_recordings/usb-keyboard.ioctl (+13/-0)
tests/mir_test_framework/udev_recordings/usb-keyboard.umockdev (+244/-0)
tests/mir_test_framework/udev_recordings/usb-mouse.ioctl (+14/-0)
tests/mir_test_framework/udev_recordings/usb-mouse.umockdev (+240/-0)
tests/mir_test_framework/using_stub_client_platform.cpp (+11/-2)
tests/unit-tests/CMakeLists.txt (+5/-14)
tests/unit-tests/android_input/CMakeLists.txt (+1/-0)
tests/unit-tests/android_input/test_eventhub.cpp (+125/-0)
tests/unit-tests/client/test_mir_connection.cpp (+6/-0)
tests/unit-tests/input/android/test_android_input_window_handle.cpp (+17/-8)
tools/valgrind_suppressions_armhf (+30/-0)
tools/valgrind_suppressions_generic (+7/-0)
To merge this branch: bzr merge lp:~raof/mir/udevify-eventhub
Reviewer Review Type Date Requested Status
PS Jenkins bot (community) continuous-integration Approve
Daniel van Vugt manual test Approve
Andreas Pokorny (community) Approve
Kevin DuBois (community) Approve
Alan Griffiths Approve
Alexandros Frantzis Pending
Robert Carr Pending
Review via email: mp+210348@code.launchpad.net

This proposal supersedes a proposal from 2014-02-17.

Commit message

Switch EventHub device enumeration and hotplug to Udev.

Fixes: https://bugs.launchpad.net/mir/+bug/1237784

Description of the change

Switch EventHub device enumeration and hotplug to Udev.

To post a comment you must log in.
Revision history for this message
PS Jenkins bot (ps-jenkins) wrote : Posted in a previous version of this proposal
review: Needs Fixing (continuous-integration)
Revision history for this message
PS Jenkins bot (ps-jenkins) wrote : Posted in a previous version of this proposal
review: Needs Fixing (continuous-integration)
Revision history for this message
PS Jenkins bot (ps-jenkins) wrote : Posted in a previous version of this proposal
review: Needs Fixing (continuous-integration)
Revision history for this message
PS Jenkins bot (ps-jenkins) wrote : Posted in a previous version of this proposal
review: Needs Fixing (continuous-integration)
Revision history for this message
PS Jenkins bot (ps-jenkins) wrote : Posted in a previous version of this proposal
review: Needs Fixing (continuous-integration)
Revision history for this message
PS Jenkins bot (ps-jenkins) wrote : Posted in a previous version of this proposal
review: Approve (continuous-integration)
Revision history for this message
Alan Griffiths (alan-griffiths) wrote : Posted in a previous version of this proposal

Looks sane. Not tested on all my kit yet.

review: Approve
Revision history for this message
Kevin DuBois (kdub) wrote : Posted in a previous version of this proposal

looks okay overall.

155 - bool usingSuspendBlockIoctl = !ioctl(fd, EVIOCSSUSPENDBLOCK, 1);

Makes me a bit leery, I think some of the android devices still use wakelocks/earlysuspend. If it was removed just to make valgrind less chattery, I'd rather leave the line in.

review: Needs Information
Revision history for this message
Chris Halse Rogers (raof) wrote : Posted in a previous version of this proposal

Hm. If we're using wakelocks, shouldn't we not #define acquire_wake_lock and release_wake_lock to nothing? (We do this at the top of EventHub.cpp.

Revision history for this message
Kevin DuBois (kdub) wrote : Posted in a previous version of this proposal

I'm not familiar enough with the code to know why those two macros are empty.

Did a bit of research, it seems that ioctl will block suspend until the event queue has been consumed.
(http://comments.gmane.org/gmane.linux.kernel.input/23434) Maybe android had a problem where it would wake up and process events from the past that it didn't get to before the device entered suspend (just a theory).

If we can't figure out what's going on with the ioctl, and everything around suspend seems to be working, could we just comment out the code with an explanation? This would be a pain to remember later if some suspend/input problem pops up.

Revision history for this message
Daniel van Vugt (vanvugt) wrote : Posted in a previous version of this proposal

Generally looks reasonable.

(1) Needs fixing:
Text conflict in debian/control
1 conflicts encountered.

(2) I'm a bit sad to see we're intentionally regressing on bug 1271434, but that appears to be a requirement now. Do we have any alternatives?
329 - libumockdev-dev [!armhf],
330 - umockdev [!armhf],
331 + libumockdev-dev (>= 0.6),
332 + umockdev,

review: Needs Fixing
Revision history for this message
Daniel van Vugt (vanvugt) wrote : Posted in a previous version of this proposal

(2) Can we just recommend umockdev instead of requiring it? And adjust if not detected. Seems like a necessary step for Mir to eventually be portable to other distros anyway...

Revision history for this message
Chris Halse Rogers (raof) wrote : Posted in a previous version of this proposal

Would you accept a script to run that'll get you a working umockdev on the touch images?

There's nothing Ubuntu specific about umockdev, and you'll miss out on all the input tests if you don't have it.

Revision history for this message
Daniel van Vugt (vanvugt) wrote : Posted in a previous version of this proposal

When it comes to portability I suspect most distros don't care how many of the tests can run. Only what's required to produce a full package. As such, I think this is a good candidate for something /recommended/ but not /required/ to build Mir. I'm sure there are other build-deps that could be the same.

I personally don't need a script. I can probably do a single command or two to resolve it. It's more about convenience, having to make your root FS writable and then get Internet access on the device to install new packages, all just to run Mir's tests. I think we should be more helpful and easier to use than that. A script doesn't really solve the problem.

Revision history for this message
Chris Halse Rogers (raof) wrote : Posted in a previous version of this proposal

If distros aren't concerned about tests then umockdev is already optional - it's only searched for if ENABLE_TESTS is on (which it is by default)

No, I meant a script in the Mir codebase that sets up umockdev on the device *without* enabling writeable-root. It's entirely possible to do so.

Revision history for this message
Daniel van Vugt (vanvugt) wrote : Posted in a previous version of this proposal

OK, that's half a good point. Not building the tests does eliminate the build dependencies for tests, but then you have zero tests. Which is not helpful for our day-to-day testing.

Hmm, yes a script which works transparently like that sounds good.

Conflict still needs fixing.

Revision history for this message
Alexandros Frantzis (afrantzis) wrote : Posted in a previous version of this proposal

Looks good.

Concerning not being able to run the unit tests without umockdev preloaded: we could name the real executable mir_unit_test_bin and have a script called mir_unit_tests that calls the real binary with umockdev-wrapper.

review: Approve
Revision history for this message
Alexandros Frantzis (afrantzis) wrote : Posted in a previous version of this proposal

As Daniel noted, this branch conflict with latest lp:mir/devel, so a sync with lp:mir/devel is needed.

Revision history for this message
Daniel van Vugt (vanvugt) wrote : Posted in a previous version of this proposal

Alexandros,

It's not the simple. The problem is how to support devices which don't have umockdev, and come with read-only filesystems by default (hence installing umockdev is non-trivial).

Revision history for this message
Alexandros Frantzis (afrantzis) wrote : Posted in a previous version of this proposal

> It's not the simple. The problem is how to support devices which don't have umockdev,
> and come with read-only filesystems by default (hence installing umockdev is non-trivial).

If umockdev is needed to run mir_unit_tests, then the mir-test-tools package should depend on it.

Revision history for this message
Daniel van Vugt (vanvugt) wrote : Posted in a previous version of this proposal

That sounds like a perfectly correct statement. But the problem remains while mir-test-tools is not a standard package pre-installed on touch images. And I'm not sure it should be.

Revision history for this message
Andreas Pokorny (andreas-pokorny) wrote : Posted in a previous version of this proposal

When you swap 1473 for
#include "src/server/report/null_report_factory.h"

the lines 1516, 1534 and 1561 could be written as:
+ 1516 auto hub = new android::EventHub{mir::report::null_input_report()};

and you could remove the lines of 1481 to 1504

but not really a blocker.

review: Approve
Revision history for this message
Daniel van Vugt (vanvugt) wrote : Posted in a previous version of this proposal

Just refreshing...

(1) Needs fixing:
Text conflict in debian/control
1 conflicts encountered.

(2) A workaround to avoid regressing on bug 1271434, would be awesome;
329 - libumockdev-dev [!armhf],
330 - umockdev [!armhf],
331 + libumockdev-dev (>= 0.6),
332 + umockdev,

review: Needs Fixing
Revision history for this message
Robert Carr (robertcarr) wrote : Posted in a previous version of this proposal

Cool

review: Approve
Revision history for this message
PS Jenkins bot (ps-jenkins) wrote : Posted in a previous version of this proposal
review: Needs Fixing (continuous-integration)
Revision history for this message
Daniel van Vugt (vanvugt) wrote : Posted in a previous version of this proposal

(3) deploy-and-test.sh: There are some duplicated very long lines there. They should be unduplicated into $VARIABLES and line length more controlled with \ continuation.

(4) Please avoid hardcoded paths: /home/phablet/mir/usr
Any developer with multiple branches on the go will have their own install/path scheme for droids.

(5) I think I failed to mention that I don't use "adb push" so any script has to avoid transferring files for me. I use "rsync" (and "start ssh" on the device) as it only copies what's changed between rebuilds. If you avoided doing the deployment/push in your script then it would also resolve (4). Simply populating the local build/{bin,lib} is enough, then let the developer copy the files in their own way.

review: Needs Fixing
Revision history for this message
Daniel van Vugt (vanvugt) wrote : Posted in a previous version of this proposal

OK, forget about deploy-and-test.sh. We don't need it. Developers are perfectly capable of getting hold of umockdev-run in a variety of ways.

One simple (but slightly slow) way is to run this on the device:
  sudo /bin/sh -c 'mount -o rw,remount / ; apt-get update ; apt-get install -y umockdev'

Solved.

review: Approve
Revision history for this message
Daniel van Vugt (vanvugt) wrote : Posted in a previous version of this proposal

(6) So now I have umockdev-run installed properly there's a new issue of hardcoded relative paths. Relative paths are wrong from most locations :)

[----------] 15 tests from VariousDevices/EventHubDeviceEnumerationTest
[ RUN ] VariousDevices/EventHubDeviceEnumerationTest.ScansOnConstruction/0
unknown file: Failure
C++ exception with description "Failed to create mock udev device: Failed to open file '../../bin/udev_recordings/synaptics-touchpad.umockdev': No such file or directory" thrown in the test body.
[ FAILED ] VariousDevices/EventHubDeviceEnumerationTest.ScansOnConstruction/0, where GetParam() = "synaptics-touchpad" (1 ms)
[ RUN ] VariousDevices/EventHubDeviceEnumerationTest.ScansOnConstruction/1
unknown file: Failure
C++ exception with description "Failed to create mock udev device: Failed to open file '../../bin/udev_recordings/usb-keyboard.umockdev': No such file or directory" thrown in the test body.
[ FAILED ] VariousDevices/EventHubDeviceEnumerationTest.ScansOnConstruction/1, where GetParam() = "usb-keyboard" (1 ms)
[ RUN ] VariousDevices/EventHubDeviceEnumerationTest.ScansOnConstruction/2
unknown file: Failure
C++ exception with description "Failed to create mock udev device: Failed to open file '../../bin/udev_recordings/usb-mouse.umockdev': No such file or directory" thrown in the test body.
[ FAILED ] VariousDevices/EventHubDeviceEnumerationTest.ScansOnConstruction/2, where GetParam() = "usb-mouse" (1 ms)

review: Needs Fixing
Revision history for this message
Daniel van Vugt (vanvugt) wrote : Posted in a previous version of this proposal

You could just replace '../../bin' with some logic that inserts the dirname part of your argv[0].

Revision history for this message
Chris Halse Rogers (raof) wrote : Posted in a previous version of this proposal

Hardcoded relative paths are right more often than hardcoded *absolute* paths :)

If that's really a blocking issue I'll just bite the bullet and use GResource so we can embed these resources into the binary itself.

Revision history for this message
Daniel van Vugt (vanvugt) wrote : Posted in a previous version of this proposal

It is a blocking issue. The path "../../bin" implies that you expect everyone to run mir_unit_tests from within "udev_recordings" or some other equally deep directory. That means you have to have an ugly LD_LIBRARY_PATH="../../lib" and also "../../bin" is equivalent to ".." anyway.

Revision history for this message
PS Jenkins bot (ps-jenkins) wrote : Posted in a previous version of this proposal
review: Needs Fixing (continuous-integration)
Revision history for this message
Daniel van Vugt (vanvugt) wrote : Posted in a previous version of this proposal

Now that it works I don't think the recordings should live under "bin". But let's worry about that another day.

With the device set up (and me no longer complaining about doing so):
   sudo /bin/sh -c 'mount -o rw,remount / ; apt-get update ; apt-get install -y umockdev'

Now the tests pass:
   env LD_LIBRARY_PATH=./lib umockdev-run bin/mir_unit_tests

review: Approve
Revision history for this message
Daniel van Vugt (vanvugt) wrote : Posted in a previous version of this proposal

Still needs re-review due to new unreviewed changes today.

Revision history for this message
PS Jenkins bot (ps-jenkins) wrote : Posted in a previous version of this proposal
review: Needs Fixing (continuous-integration)
Revision history for this message
PS Jenkins bot (ps-jenkins) wrote : Posted in a previous version of this proposal
review: Needs Fixing (continuous-integration)
Revision history for this message
PS Jenkins bot (ps-jenkins) wrote : Posted in a previous version of this proposal
review: Needs Fixing (continuous-integration)
Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Needs Fixing (continuous-integration)
Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Needs Fixing (continuous-integration)
Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Needs Fixing (continuous-integration)
Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Needs Fixing (continuous-integration)
Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Needs Fixing (continuous-integration)
Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Needs Fixing (continuous-integration)
Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Needs Fixing (continuous-integration)
Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Approve (continuous-integration)
Revision history for this message
Alan Griffiths (alan-griffiths) wrote :

WOW! It has grown.

review: Approve
Revision history for this message
Kevin DuBois (kdub) wrote :

seems my concern about EVIOCSSUSPENDBLOCK is addressed... the rest of it (as much as I understand the input stuff) looks okay to me

review: Approve
Revision history for this message
Andreas Pokorny (andreas-pokorny) wrote :

Something non-blocking:

+ 1573ff
.. there is something nicer:

1573 + std::unique_ptr<MirConnection> release_it(connection);
1574 + auto wait_handle = connection->disconnect();
1575 + wait_handle->wait_for_all();

review: Approve
Revision history for this message
Daniel van Vugt (vanvugt) wrote :

Just repeated manual testing. All OK, although people need to be aware of how to prepare a device to run the tests now:

sudo mount -o remount,rw /
sudo apt-get update
sudo apt-get install -y umockdev

review: Approve (manual test)
Revision history for this message
PS Jenkins bot (ps-jenkins) :
review: Approve (continuous-integration)

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file '3rd_party/android-input/android/CMakeLists.txt'
2--- 3rd_party/android-input/android/CMakeLists.txt 2014-03-06 06:05:17 +0000
3+++ 3rd_party/android-input/android/CMakeLists.txt 2014-03-13 07:39:32 +0000
4@@ -7,6 +7,7 @@
5 system/extras/ext4_utils
6
7 ${PROJECT_SOURCE_DIR}/include/server
8+ ${PROJECT_SOURCE_DIR}/include/platform
9 )
10
11 add_definitions(
12@@ -64,6 +65,7 @@
13 target_link_libraries(
14 android-input
15
16+ mirplatform
17 ${Boost_LIBRARIES}
18 )
19
20
21=== modified file '3rd_party/android-input/android/frameworks/base/services/input/EventHub.cpp'
22--- 3rd_party/android-input/android/frameworks/base/services/input/EventHub.cpp 2013-10-03 05:12:59 +0000
23+++ 3rd_party/android-input/android/frameworks/base/services/input/EventHub.cpp 2014-03-13 07:39:32 +0000
24@@ -205,34 +205,34 @@
25
26 // --- EventHub ---
27
28-const uint32_t EventHub::EPOLL_ID_INOTIFY;
29+const uint32_t EventHub::EPOLL_ID_UDEV;
30 const uint32_t EventHub::EPOLL_ID_WAKE;
31 const int EventHub::EPOLL_SIZE_HINT;
32 const int EventHub::EPOLL_MAX_EVENTS;
33
34 EventHub::EventHub(std::shared_ptr<mi::InputReport> const& input_report) :
35 input_report(input_report),
36+ device_listener{mir::udev::Context()},
37 mBuiltInKeyboardId(NO_BUILT_IN_KEYBOARD), mNextDeviceId(1),
38 mOpeningDevices(0), mClosingDevices(0),
39 mNeedToSendFinishedDeviceScan(false),
40 mNeedToReopenDevices(false), mNeedToScanDevices(true),
41- mPendingEventCount(0), mPendingEventIndex(0), mPendingINotify(false) {
42+ mPendingEventCount(0), mPendingEventIndex(0), mPendingUdevEvent(false) {
43 acquire_wake_lock(PARTIAL_WAKE_LOCK, WAKE_LOCK_ID);
44
45 mEpollFd = epoll_create(EPOLL_SIZE_HINT);
46 LOG_ALWAYS_FATAL_IF(mEpollFd < 0, "Could not create epoll instance. errno=%d", errno);
47
48- mINotifyFd = inotify_init();
49- int result = inotify_add_watch(mINotifyFd, DEVICE_PATH, IN_DELETE | IN_CREATE | IN_ATTRIB);
50- LOG_ALWAYS_FATAL_IF(result < 0, "Could not register INotify for %s. errno=%d",
51- DEVICE_PATH, errno);
52+ device_listener.filter_by_subsystem("input");
53+ device_listener.enable();
54+
55
56 struct epoll_event eventItem;
57 memset(&eventItem, 0, sizeof(eventItem));
58 eventItem.events = EPOLLIN;
59- eventItem.data.u32 = EPOLL_ID_INOTIFY;
60- result = epoll_ctl(mEpollFd, EPOLL_CTL_ADD, mINotifyFd, &eventItem);
61- LOG_ALWAYS_FATAL_IF(result != 0, "Could not add INotify to epoll instance. errno=%d", errno);
62+ eventItem.data.u32 = EPOLL_ID_UDEV;
63+ int result = epoll_ctl(mEpollFd, EPOLL_CTL_ADD, device_listener.fd(), &eventItem);
64+ LOG_ALWAYS_FATAL_IF(result != 0, "Could not add Udev monitor to epoll instance. errno=%d", errno);
65
66 int wakeFds[2];
67 result = pipe(wakeFds);
68@@ -265,7 +265,6 @@
69 }
70
71 ::close(mEpollFd);
72- ::close(mINotifyFd);
73 ::close(mWakeReadPipeFd);
74 ::close(mWakeWritePipeFd);
75
76@@ -730,9 +729,9 @@
77 bool deviceChanged = false;
78 while (mPendingEventIndex < mPendingEventCount) {
79 const struct epoll_event& eventItem = mPendingEventItems[mPendingEventIndex++];
80- if (eventItem.data.u32 == EPOLL_ID_INOTIFY) {
81+ if (eventItem.data.u32 == EPOLL_ID_UDEV) {
82 if (eventItem.events & EPOLLIN) {
83- mPendingINotify = true;
84+ mPendingUdevEvent = true;
85 } else {
86 ALOGW("Received unexpected epoll event 0x%08x for INotify.", eventItem.events);
87 }
88@@ -839,9 +838,9 @@
89 // readNotify() will modify the list of devices so this must be done after
90 // processing all other events to ensure that we read all remaining events
91 // before closing the devices.
92- if (mPendingINotify && mPendingEventIndex >= mPendingEventCount) {
93- mPendingINotify = false;
94- readNotifyLocked();
95+ if (mPendingUdevEvent && mPendingEventIndex >= mPendingEventCount) {
96+ mPendingUdevEvent = false;
97+ handleUdevEventsLocked();
98 deviceChanged = true;
99 }
100
101@@ -916,15 +915,44 @@
102 }
103
104 void EventHub::scanDevicesLocked() {
105- status_t res = scanDirLocked(DEVICE_PATH);
106- if(res < 0) {
107- ALOGE("scan dir failed for %s\n", DEVICE_PATH);
108+ mir::udev::Enumerator input_enumerator{std::make_shared<mir::udev::Context>()};
109+
110+ input_enumerator.match_subsystem("input");
111+ input_enumerator.scan_devices();
112+
113+ for (auto& device : input_enumerator)
114+ {
115+ if (device.devnode() != nullptr)
116+ {
117+ openDeviceLocked(device.devnode());
118+ }
119 }
120+
121 if (mDevices.indexOfKey(VIRTUAL_KEYBOARD_ID) < 0) {
122 createVirtualKeyboardLocked();
123 }
124 }
125
126+void EventHub::handleUdevEventsLocked()
127+{
128+ device_listener.process_events([this](mir::udev::Monitor::EventType type, mir::udev::Device const& dev){
129+ if (type == mir::udev::Monitor::ADDED)
130+ {
131+ if (dev.devnode() != nullptr)
132+ {
133+ openDeviceLocked(dev.devnode());
134+ }
135+ }
136+ else if (type == mir::udev::Monitor::REMOVED)
137+ {
138+ if (dev.devnode() != nullptr)
139+ {
140+ closeDeviceByPathLocked(dev.devnode());
141+ }
142+ }
143+ });
144+}
145+
146 // ----------------------------------------------------------------------------
147
148 static bool containsNonZeroByte(const uint8_t* array, uint32_t startIndex, uint32_t endIndex) {
149@@ -1391,80 +1419,6 @@
150 }
151 }
152
153-status_t EventHub::readNotifyLocked() {
154- int res;
155- char devname[PATH_MAX];
156- char *filename;
157- char event_buf[512];
158- int event_size;
159- int event_pos = 0;
160- struct inotify_event *event;
161-
162- ALOGV("EventHub::readNotify nfd: %d\n", mINotifyFd);
163- res = read(mINotifyFd, event_buf, sizeof(event_buf));
164- if(res < (int)sizeof(*event)) {
165- if(errno == EINTR)
166- return 0;
167- ALOGW("could not get event, %s\n", strerror(errno));
168- return -1;
169- }
170- //printf("got %d bytes of event information\n", res);
171-
172- strcpy(devname, DEVICE_PATH);
173- filename = devname + strlen(devname);
174- *filename++ = '/';
175-
176- while(res >= (int)sizeof(*event)) {
177- event = (struct inotify_event *)(event_buf + event_pos);
178- //printf("%d: %08x \"%s\"\n", event->wd, event->mask, event->len ? event->name : "");
179- if(event->len) {
180- strcpy(filename, event->name);
181- if(event->mask & IN_CREATE) {
182- openDeviceLocked(devname);
183- } else if (event->mask & IN_ATTRIB) {
184- Device* device = getDeviceByPathLocked(devname);
185- if (!device) {
186- ALOGI("Retry opening device file %s", devname);
187- // file permissions might have changed, making the device readable now
188- // let's retry opening it
189- openDeviceLocked(devname);
190- }
191- } else {
192- ALOGI("Removing device '%s' due to inotify event\n", devname);
193- closeDeviceByPathLocked(devname);
194- }
195- }
196- event_size = sizeof(*event) + event->len;
197- res -= event_size;
198- event_pos += event_size;
199- }
200- return 0;
201-}
202-
203-status_t EventHub::scanDirLocked(const char *dirname)
204-{
205- char devname[PATH_MAX];
206- char *filename;
207- DIR *dir;
208- struct dirent *de;
209- dir = opendir(dirname);
210- if(dir == NULL)
211- return -1;
212- strcpy(devname, dirname);
213- filename = devname + strlen(devname);
214- *filename++ = '/';
215- while((de = readdir(dir))) {
216- if(de->d_name[0] == '.' &&
217- (de->d_name[1] == '\0' ||
218- (de->d_name[1] == '.' && de->d_name[2] == '\0')))
219- continue;
220- strcpy(filename, de->d_name);
221- openDeviceLocked(devname);
222- }
223- closedir(dir);
224- return 0;
225-}
226-
227 void EventHub::requestReopenDevices() {
228 ALOGV("requestReopenDevices() called");
229
230
231=== modified file '3rd_party/android-input/android/frameworks/base/services/input/EventHub.h'
232--- 3rd_party/android-input/android/frameworks/base/services/input/EventHub.h 2013-10-03 05:12:59 +0000
233+++ 3rd_party/android-input/android/frameworks/base/services/input/EventHub.h 2014-03-13 07:39:32 +0000
234@@ -18,6 +18,8 @@
235 #ifndef _RUNTIME_EVENT_HUB_H
236 #define _RUNTIME_EVENT_HUB_H
237
238+#include "mir/udev/wrapper.h"
239+
240 #include <androidfw/Input.h>
241 #include <androidfw/InputDevice.h>
242 #include <androidfw/Keyboard.h>
243@@ -366,9 +368,8 @@
244 void closeDeviceLocked(Device* device);
245 void closeAllDevicesLocked();
246
247- status_t scanDirLocked(const char *dirname);
248 void scanDevicesLocked();
249- status_t readNotifyLocked();
250+ void handleUdevEventsLocked();
251
252 Device* getDeviceLocked(int32_t deviceId) const;
253 Device* getDeviceByPathLocked(const char* devicePath) const;
254@@ -407,12 +408,12 @@
255 Vector<String8> mExcludedDevices;
256
257 int mEpollFd;
258- int mINotifyFd;
259+ mir::udev::Monitor device_listener;
260 int mWakeReadPipeFd;
261 int mWakeWritePipeFd;
262
263 // Ids used for epoll notifications not associated with devices.
264- static const uint32_t EPOLL_ID_INOTIFY = 0x80000001;
265+ static const uint32_t EPOLL_ID_UDEV = 0x80000001;
266 static const uint32_t EPOLL_ID_WAKE = 0x80000002;
267
268 // Epoll FD list size hint.
269@@ -425,7 +426,7 @@
270 struct epoll_event mPendingEventItems[EPOLL_MAX_EVENTS];
271 size_t mPendingEventCount;
272 size_t mPendingEventIndex;
273- bool mPendingINotify;
274+ bool mPendingUdevEvent;
275 };
276
277 // Made available to test
278
279=== modified file 'benchmarks/android-input/CMakeLists.txt'
280--- benchmarks/android-input/CMakeLists.txt 2013-10-15 10:10:05 +0000
281+++ benchmarks/android-input/CMakeLists.txt 2014-03-13 07:39:32 +0000
282@@ -5,7 +5,9 @@
283 )
284
285 include_directories(
286- ${Mir_SOURCE_DIR}/include/test)
287+ ${Mir_SOURCE_DIR}/include/test
288+ ${Mir_SOURCE_DIR}/include/platform
289+)
290
291 add_executable(input-reader-perf ${SOURCES})
292
293
294=== modified file 'cmake/MirCommon.cmake'
295--- cmake/MirCommon.cmake 2014-03-06 06:05:17 +0000
296+++ cmake/MirCommon.cmake 2014-03-13 07:39:32 +0000
297@@ -22,8 +22,10 @@
298 valgrind)
299
300 if(VALGRIND_EXECUTABLE)
301- set(VALGRIND_ARGS "--error-exitcode=1" "--trace-children=yes")
302+ set(VALGRIND_ARGS "--error-exitcode=1" "--trace-children=yes" "--leak-check=full" "--show-leak-kinds=definite" "--errors-for-leak-kinds=definite")
303+ set(VALGRIND_ARGS ${VALGRIND_ARGS} "--suppressions=${CMAKE_SOURCE_DIR}/tools/valgrind_suppressions_generic")
304 set(DISCOVER_FLAGS "--enable-memcheck")
305+ set(DISCOVER_FLAGS ${DISCOVER_FLAGS} "--suppressions=${CMAKE_SOURCE_DIR}/tools/valgrind_suppressions_generic")
306 if (TARGET_ARCH STREQUAL "arm-linux-gnueabihf")
307 set(VALGRIND_ARGS ${VALGRIND_ARGS} "--suppressions=${CMAKE_SOURCE_DIR}/tools/valgrind_suppressions_armhf")
308 set(DISCOVER_FLAGS ${DISCOVER_FLAGS} "--suppressions=${CMAKE_SOURCE_DIR}/tools/valgrind_suppressions_armhf")
309@@ -35,10 +37,11 @@
310
311 function (mir_discover_tests EXECUTABLE)
312 if(DISABLE_GTEST_TEST_DISCOVERY)
313- add_test(${EXECUTABLE} ${VALGRIND_EXECUTABLE} ${VALGRIND_ARGS} "${EXECUTABLE_OUTPUT_PATH}/${EXECUTABLE}")
314-
315+ add_test(${EXECUTABLE} ${VALGRIND_EXECUTABLE} ${VALGRIND_ARGS} ${EXECUTABLE_OUTPUT_PATH}/${EXECUTABLE} "--gtest_filter=-*DeathTest.*")
316+ add_test(${EXECUTABLE}_death_tests ${EXECUTABLE_OUTPUT_PATH}/${EXECUTABLE} "--gtest_filter=*DeathTest.*")
317 if (${ARGC} GREATER 1)
318 set_property(TEST ${EXECUTABLE} PROPERTY ENVIRONMENT ${ARGN})
319+ set_property(TEST ${EXECUTABLE}_death_tests PROPERTY ENVIRONMENT ${ARGN})
320 endif()
321 else()
322 set(CHECK_TEST_DISCOVERY_TARGET_NAME "check_discover_tests_in_${EXECUTABLE}")
323
324=== modified file 'cmake/src/mir/mir_discover_gtest_tests.cpp'
325--- cmake/src/mir/mir_discover_gtest_tests.cpp 2014-03-06 06:05:17 +0000
326+++ cmake/src/mir/mir_discover_gtest_tests.cpp 2014-03-13 07:39:32 +0000
327@@ -234,6 +234,18 @@
328 }
329 }
330
331+bool is_death_test(string const& test)
332+{
333+ // precondition: test will match Foo.*
334+ // assumption: death tests will match FooDeathTest.*
335+ bool death_test = false;
336+ if (test.size() > strlen("DeathTest.*"))
337+ death_test = test.substr(test.size() - strlen("DeathTest.*"),
338+ strlen("DeathTest")) == "DeathTest";
339+
340+ return death_test;
341+}
342+
343 int main (int argc, char **argv)
344 {
345 int output_width = get_output_width();
346@@ -291,8 +303,9 @@
347 snprintf(
348 cmd_line,
349 sizeof(cmd_line),
350- config.enable_memcheck ? memcheck_cmd_line_pattern(config.suppressions).c_str() :
351- ordinary_cmd_line_pattern().c_str(),
352+ (config.enable_memcheck && !is_death_test(*test)) ?
353+ memcheck_cmd_line_pattern(config.suppressions).c_str() :
354+ ordinary_cmd_line_pattern().c_str(),
355 test_suite.c_str(),
356 elide_string_left(*test, output_width/2).c_str(),
357 config.executable,
358
359=== modified file 'debian/control'
360--- debian/control 2014-03-12 06:41:13 +0000
361+++ debian/control 2014-03-13 07:39:32 +0000
362@@ -31,7 +31,7 @@
363 libgoogle-glog-dev,
364 liblttng-ust-dev,
365 libxkbcommon-dev,
366- libumockdev-dev,
367+ libumockdev-dev (>= 0.6),
368 umockdev,
369 libudev-dev,
370 google-mock (>= 1.6.0+svn437),
371
372=== added file 'deploy-and-test.sh'
373--- deploy-and-test.sh 1970-01-01 00:00:00 +0000
374+++ deploy-and-test.sh 2014-03-13 07:39:32 +0000
375@@ -0,0 +1,21 @@
376+#!/bin/sh
377+
378+if [ ! -d build-android-arm ] ; then
379+ echo "Built tree not found in $(pwd)/build-android-arm"
380+ exit 1
381+fi
382+
383+# Unpack umockdev requirements
384+( cd build-android-arm ;
385+ apt-get download umockdev:armhf libumockdev0:armhf ;
386+ dpkg -x umockdev_*armhf*.deb . ;
387+ dpkg -x libumockdev0_*armhf*.deb .
388+)
389+
390+adb push build-android-arm/bin /home/phablet/mir/bin
391+adb push build-android-arm/lib /home/phablet/mir/lib
392+adb push build-android-arm/usr /home/phablet/mir/usr
393+
394+adb shell "LD_LIBRARY_PATH=/home/phablet/mir/usr/lib/arm-linux-gnueabihf/:/home/phablet/mir/lib PATH=$PATH:/home/phablet/mir/usr/bin bash -c \"cd /home/phablet/mir/usr/bin ; umockdev-run /home/phablet/mir/bin/mir_unit_tests\""
395+adb shell "LD_LIBRARY_PATH=/home/phablet/mir/usr/lib/arm-linux-gnueabihf/:/home/phablet/mir/lib PATH=$PATH:/home/phablet/mir/usr/bin bash -c \"cd /home/phablet/mir/usr/bin ; umockdev-run /home/phablet/mir/bin/mir_integration_tests\""
396+adb shell "LD_LIBRARY_PATH=/home/phablet/mir/usr/lib/arm-linux-gnueabihf/:/home/phablet/mir/lib PATH=$PATH:/home/phablet/mir/usr/bin bash -c \"cd /home/phablet/mir/usr/bin ; umockdev-run /home/phablet/mir/bin/mir_acceptance_tests\""
397
398=== modified file 'include/test/mir_test_framework/udev_environment.h'
399--- include/test/mir_test_framework/udev_environment.h 2014-03-06 06:05:17 +0000
400+++ include/test/mir_test_framework/udev_environment.h 2014-03-13 07:39:32 +0000
401@@ -56,6 +56,7 @@
402 void add_standard_device(std::string const& name);
403
404 UMockdevTestbed *testbed;
405+ std::string const recordings_path;
406 };
407
408 }
409
410=== modified file 'tests/CMakeLists.txt'
411--- tests/CMakeLists.txt 2014-03-06 06:05:17 +0000
412+++ tests/CMakeLists.txt 2014-03-13 07:39:32 +0000
413@@ -1,13 +1,6 @@
414-
415-if (MIR_TEST_PLATFORM STREQUAL "mesa")
416- set (UMOCKDEV_REQUIRED YES)
417-endif()
418-
419-if (UMOCKDEV_REQUIRED)
420- pkg_check_modules(UMOCKDEV REQUIRED umockdev-1.0)
421- if (NOT UMOCKDEV_FOUND)
422- message(FATAL_ERROR "Umockdev not found, cannot build without disabling tests (via MIR_ENABLE_TESTS).")
423- endif()
424+pkg_check_modules(UMOCKDEV REQUIRED umockdev-1.0>=0.6)
425+if (NOT UMOCKDEV_FOUND)
426+ message(FATAL_ERROR "Umockdev not found, cannot build without disabling tests (via MIR_ENABLE_TESTS).")
427 endif()
428
429 include_directories(${MIR_3RD_PARTY_INCLUDE_DIRECTORIES})
430
431=== modified file 'tests/acceptance-tests/test_server_disconnect.cpp'
432--- tests/acceptance-tests/test_server_disconnect.cpp 2013-10-18 11:22:44 +0000
433+++ tests/acceptance-tests/test_server_disconnect.cpp 2014-03-13 07:39:32 +0000
434@@ -73,6 +73,8 @@
435 {
436 mir_surface_swap_buffers_sync(surface);
437 }
438+ mir_surface_release_sync(surface);
439+ mir_connection_release(connection);
440 }
441
442 mtf::CrossProcessSync sync;
443
444=== modified file 'tests/acceptance-tests/test_surfaces_with_output_id.cpp'
445--- tests/acceptance-tests/test_surfaces_with_output_id.cpp 2014-03-06 08:07:06 +0000
446+++ tests/acceptance-tests/test_surfaces_with_output_id.cpp 2014-03-13 07:39:32 +0000
447@@ -119,6 +119,10 @@
448 }
449 };
450
451+void null_surface_callback(MirSurface*, void*)
452+{
453+}
454+
455 }
456
457 using SurfacesWithOutputId = BespokeDisplayServerTestFixture;
458@@ -301,6 +305,7 @@
459
460 auto surface = mir_connection_create_surface_sync(connection, &request_params);
461 EXPECT_FALSE(mir_surface_is_valid(surface));
462+ mir_surface_release(surface, &null_surface_callback, nullptr);
463 }
464
465 mir_display_config_destroy(config);
466
467=== modified file 'tests/mir_test_framework/CMakeLists.txt'
468--- tests/mir_test_framework/CMakeLists.txt 2014-03-06 06:05:17 +0000
469+++ tests/mir_test_framework/CMakeLists.txt 2014-03-13 07:39:32 +0000
470@@ -1,9 +1,8 @@
471-add_definitions(-DUDEVMOCK_DIR="${CMAKE_CURRENT_SOURCE_DIR}/udev_recordings")
472-
473 include_directories(
474 ${Boost_INCLUDE_DIRS}
475 ${GLESv2_INCLUDE_DIRS}
476 ${CMAKE_SOURCE_DIR}
477+ ${UMOCKDEV_INCLUDE_DIRS}
478 )
479
480 set(
481@@ -20,19 +19,15 @@
482 display_server_test_fixture.cpp
483 process.cpp
484 using_stub_client_platform.cpp
485+ udev_environment.cpp
486 )
487
488 list(APPEND TEST_FRAMEWORK_SRCS
489 socket_detect_server.cpp
490 )
491
492-if (UMOCKDEV_REQUIRED)
493- include_directories(${UMOCKDEV_INCLUDE_DIRS})
494- list(APPEND TEST_FRAMEWORK_SRCS udev_environment.cpp)
495- list(APPEND TEST_FRAMEWORK_LIBS ${UMOCKDEV_LIBRARIES})
496- # Umockdev uses glib, which uses the deprecated "register" storage qualifier
497- set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Dregister=")
498-endif ()
499+# Umockdev uses glib, which uses the deprecated "register" storage qualifier
500+set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Dregister=")
501
502 add_library(
503 mir-test-framework STATIC
504@@ -52,9 +47,12 @@
505 ${GTEST_BOTH_LIBRARIES}
506 ${GMOCK_LIBRARY}
507 ${GMOCK_MAIN_LIBRARY}
508+ ${UMOCKDEV_LIBRARIES}
509 ${CMAKE_THREAD_LIBS_INIT} # Link in pthread.
510 )
511
512-target_link_libraries(mir-test-framework
513- ${TEST_FRAMEWORK_LIBS}
514+add_custom_command(TARGET mir-test-framework POST_BUILD
515+ COMMAND ${CMAKE_COMMAND} -E copy_directory
516+ ${CMAKE_CURRENT_SOURCE_DIR}/udev_recordings ${CMAKE_BINARY_DIR}/bin/udev_recordings
517+ COMMENT "Copying umockdev recordings to build dir..."
518 )
519
520=== modified file 'tests/mir_test_framework/udev_environment.cpp'
521--- tests/mir_test_framework/udev_environment.cpp 2014-03-06 06:05:17 +0000
522+++ tests/mir_test_framework/udev_environment.cpp 2014-03-13 07:39:32 +0000
523@@ -24,17 +24,37 @@
524 #include <sys/types.h>
525 #include <sys/stat.h>
526 #include <unistd.h>
527+#include <libgen.h>
528 #include <fstream>
529 #include <sstream>
530 #include <string>
531 #include <vector>
532 #include <stdexcept>
533 #include <boost/throw_exception.hpp>
534+#include <boost/exception/errinfo_errno.hpp>
535
536
537 namespace mtf = mir::mir_test_framework;
538
539+namespace
540+{
541+std::string binary_path()
542+{
543+ char buf[1024];
544+ auto tmp = readlink("/proc/self/exe", buf, sizeof buf);
545+ if (tmp < 0)
546+ BOOST_THROW_EXCEPTION(boost::enable_error_info(
547+ std::runtime_error("Failed to find our executable path"))
548+ << boost::errinfo_errno(errno));
549+ if (tmp > static_cast<ssize_t>(sizeof(buf) - 1))
550+ BOOST_THROW_EXCEPTION(std::runtime_error("Path to executable is too long!"));
551+ buf[tmp] = '\0';
552+ return dirname(buf);
553+}
554+}
555+
556 mtf::UdevEnvironment::UdevEnvironment()
557+ : recordings_path(binary_path() + "/udev_recordings")
558 {
559 testbed = umockdev_testbed_new();
560 }
561@@ -84,7 +104,7 @@
562
563 void mtf::UdevEnvironment::add_standard_device(std::string const& name)
564 {
565- auto descriptor_filename = std::string(UDEVMOCK_DIR) + "/" + name + ".umockdev";
566+ auto descriptor_filename = recordings_path + "/" + name + ".umockdev";
567 GError* err = nullptr;
568 if (!umockdev_testbed_add_from_file(testbed, descriptor_filename.c_str(), &err))
569 {
570@@ -92,7 +112,7 @@
571 err->message));
572 }
573
574- auto ioctls_filename = std::string(UDEVMOCK_DIR) + "/" + name + ".ioctl";
575+ auto ioctls_filename = recordings_path + "/" + name + ".ioctl";
576 struct stat sb;
577 if (stat(ioctls_filename.c_str(), &sb) == 0)
578 {
579
580=== added file 'tests/mir_test_framework/udev_recordings/bluetooth-magic-trackpad.ioctl'
581--- tests/mir_test_framework/udev_recordings/bluetooth-magic-trackpad.ioctl 1970-01-01 00:00:00 +0000
582+++ tests/mir_test_framework/udev_recordings/bluetooth-magic-trackpad.ioctl 2014-03-13 07:39:32 +0000
583@@ -0,0 +1,21 @@
584+@DEV /dev/input/event13
585+EVIOCGNAME(0) 24 4170706C6520576972656C65737320547261636B70616400003C6F4488EC284430A3960100000000B08601F81A7F000080018F071B7F000000000000000000000000000000000000C0298F071B7F00
586+EVIOCGVERSION 0 01000100
587+EVIOCGID 0 0500AC050E036001
588+EVIOCGPHYS(0) 18 62383A37363A33663A37383A65623A373600636B70616400003C6F4488EC284430A3960100000000B08601F81A7F000080018F071B7F000000000000000000000000000000000000C0298F071B7F00
589+EVIOCGUNIQ(0) 18 64383A61323A35653A66383A37303A643600636B70616400003C6F4488EC284430A3960100000000B08601F81A7F000080018F071B7F000000000000000000000000000000000000C0298F071B7F00
590+EVIOCGBIT(1) 96 0000000000000000000000000000000000000000000000000000000000000000000001000000000020E5000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
591+EVIOCGBIT(3) 8 0300000000807302
592+EVIOCGBIT(2) 2 0000
593+EVIOCGBIT(5) 2 0000
594+EVIOCGBIT(17) 2 0000
595+EVIOCGBIT(21) 16 00000000000000000000000000000000
596+EVIOCGPROP(0) 4 05000000
597+EVIOCGABS(53) 0 00000000A3F4FFFF5F0C000004000000000000002E000000
598+EVIOCGABS(54) 0 0000000068F6FFFF050A000004000000000000002D000000
599+EVIOCGABS(48) 0 0000000000000000FC030000040000000000000000000000
600+EVIOCGABS(49) 0 0000000000000000FC030000040000000000000000000000
601+EVIOCGABS(52) 0 00000000E1FFFFFF20000000010000000000000000000000
602+EVIOCGABS(57) 0 0000000000000000FFFF0000000000000000000000000000
603+EVIOCGABS(47) 0 04000000000000000F000000000000000000000000000000
604+EVIOCGKEY(0) 96 000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
605
606=== added file 'tests/mir_test_framework/udev_recordings/bluetooth-magic-trackpad.umockdev'
607--- tests/mir_test_framework/udev_recordings/bluetooth-magic-trackpad.umockdev 1970-01-01 00:00:00 +0000
608+++ tests/mir_test_framework/udev_recordings/bluetooth-magic-trackpad.umockdev 2014-03-13 07:39:32 +0000
609@@ -0,0 +1,222 @@
610+P: /devices/pci0000:00/0000:00:14.0/usb3/3-4/3-4:1.0/bluetooth/hci0/hci0:21/input20/event13
611+N: input/event13
612+E: DEVNAME=/dev/input/event13
613+E: ID_INPUT=1
614+E: ID_INPUT_TOUCHPAD=1
615+E: MAJOR=13
616+E: MINOR=77
617+E: SUBSYSTEM=input
618+A: dev=13:77
619+L: device=../../input20
620+
621+P: /devices/pci0000:00/0000:00:14.0/usb3/3-4/3-4:1.0/bluetooth/hci0/hci0:21/input20
622+E: ABS=273800000000003
623+E: EV=10001b
624+E: ID_FOR_SEAT=input-pci-0000_00_14_0-usb-0_4_1_0
625+E: ID_INPUT=1
626+E: ID_INPUT_TOUCHPAD=1
627+E: ID_PATH=pci-0000:00:14.0-usb-0:4:1.0
628+E: ID_PATH_TAG=pci-0000_00_14_0-usb-0_4_1_0
629+E: KEY=e520 10000 0 0 0 0
630+E: MODALIAS=input:b0005v05ACp030Ee0160-e0,1,3,4,14,k110,145,148,14A,14D,14E,14F,ra0,1,2F,30,31,34,35,36,39,m4,lsfw
631+E: MSC=10
632+E: NAME="Apple Wireless Trackpad"
633+E: PHYS="b8:76:3f:78:eb:76"
634+E: PRODUCT=5/5ac/30e/160
635+E: PROP=5
636+E: SUBSYSTEM=input
637+E: TAGS=:seat:
638+E: UNIQ="d8:a2:5e:f8:70:d6"
639+L: device=../../hci0:21
640+A: modalias=input:b0005v05ACp030Ee0160-e0,1,3,4,14,k110,145,148,14A,14D,14E,14F,ra0,1,2F,30,31,34,35,36,39,m4,lsfw
641+A: name=Apple Wireless Trackpad
642+A: phys=b8:76:3f:78:eb:76
643+A: properties=5
644+A: uniq=d8:a2:5e:f8:70:d6
645+
646+P: /devices/pci0000:00/0000:00:14.0/usb3/3-4/3-4:1.0/bluetooth/hci0/hci0:21
647+E: DEVTYPE=link
648+E: SUBSYSTEM=bluetooth
649+A: address=d8:a2:5e:f8:70:d6
650+L: device=../../hci0
651+A: type=ACL
652+
653+P: /devices/pci0000:00/0000:00:14.0/usb3/3-4/3-4:1.0/bluetooth/hci0
654+E: DEVTYPE=host
655+E: SUBSYSTEM=bluetooth
656+A: address=b8:76:3f:78:eb:76
657+L: device=../../../3-4:1.0
658+A: name=ubuntu-0
659+A: type=BR/EDR
660+
661+P: /devices/pci0000:00/0000:00:14.0/usb3/3-4/3-4:1.0
662+E: DEVTYPE=usb_interface
663+E: DRIVER=btusb
664+E: ID_USB_CLASS_FROM_DATABASE=Wireless
665+E: ID_USB_PROTOCOL_FROM_DATABASE=Bluetooth
666+E: ID_USB_SUBCLASS_FROM_DATABASE=Radio Frequency
667+E: ID_VENDOR_FROM_DATABASE=Atheros Communications, Inc.
668+E: INTERFACE=224/1/1
669+E: MODALIAS=usb:v0CF3p3004d0002dcE0dsc01dp01icE0isc01ip01in00
670+E: PRODUCT=cf3/3004/2
671+E: SUBSYSTEM=usb
672+E: TYPE=224/1/1
673+A: bAlternateSetting= 0
674+A: bInterfaceClass=e0
675+A: bInterfaceNumber=00
676+A: bInterfaceProtocol=01
677+A: bInterfaceSubClass=01
678+A: bNumEndpoints=03
679+L: driver=../../../../../../bus/usb/drivers/btusb
680+A: modalias=usb:v0CF3p3004d0002dcE0dsc01dp01icE0isc01ip01in00
681+A: supports_autosuspend=1
682+
683+P: /devices/pci0000:00/0000:00:14.0/usb3/3-4
684+N: bus/usb/003/003=12011001E0010140F30C04300200010203010902B100020104E0320904000003E00101000705810310000107058202400001070502024000010904010002E001010007058301000001070503010000010904010102E001010007058301090001070503010900010904010202E001010007058301110001070503011100010904010302E001010007058301190001070503011900010904010402E001010007058301210001070503012100010904010502E00101000705830131000107050301310001
685+E: BUSNUM=003
686+E: DEVNAME=/dev/bus/usb/003/003
687+E: DEVNUM=003
688+E: DEVTYPE=usb_device
689+E: DRIVER=usb
690+E: ID_BUS=usb
691+E: ID_MODEL=3004
692+E: ID_MODEL_ENC=3004
693+E: ID_MODEL_ID=3004
694+E: ID_REVISION=0002
695+E: ID_SERIAL=0cf3_3004
696+E: ID_USB_INTERFACES=:e00101:
697+E: ID_VENDOR=0cf3
698+E: ID_VENDOR_ENC=0cf3
699+E: ID_VENDOR_FROM_DATABASE=Atheros Communications, Inc.
700+E: ID_VENDOR_ID=0cf3
701+E: MAJOR=189
702+E: MINOR=258
703+E: PRODUCT=cf3/3004/2
704+E: SUBSYSTEM=usb
705+E: TYPE=224/1/1
706+A: authorized=1
707+A: avoid_reset_quirk=0
708+A: bConfigurationValue=1
709+A: bDeviceClass=e0
710+A: bDeviceProtocol=01
711+A: bDeviceSubClass=01
712+A: bMaxPacketSize0=64
713+A: bMaxPower=100mA
714+A: bNumConfigurations=1
715+A: bNumInterfaces= 2
716+A: bcdDevice=0002
717+A: bmAttributes=e0
718+A: busnum=3
719+A: configuration=
720+H: descriptors=12011001E0010140F30C04300200010203010902B100020104E0320904000003E00101000705810310000107058202400001070502024000010904010002E001010007058301000001070503010000010904010102E001010007058301090001070503010900010904010202E001010007058301110001070503011100010904010302E001010007058301190001070503011900010904010402E001010007058301210001070503012100010904010502E00101000705830131000107050301310001
721+A: dev=189:258
722+A: devnum=3
723+A: devpath=4
724+L: driver=../../../../../bus/usb/drivers/usb
725+A: idProduct=3004
726+A: idVendor=0cf3
727+A: ltm_capable=no
728+A: maxchild=0
729+L: port=../3-0:1.0/port4
730+A: quirks=0x0
731+A: removable=removable
732+A: speed=12
733+A: urbnum=2662
734+A: version= 1.10
735+
736+P: /devices/pci0000:00/0000:00:14.0/usb3
737+N: bus/usb/003/001=12010002090001406B1D020013030302010109021900010100E0000904000001090000000705810304000C
738+E: BUSNUM=003
739+E: DEVNAME=/dev/bus/usb/003/001
740+E: DEVNUM=001
741+E: DEVTYPE=usb_device
742+E: DRIVER=usb
743+E: ID_BUS=usb
744+E: ID_FOR_SEAT=usb-pci-0000_00_14_0
745+E: ID_MODEL=xHCI_Host_Controller
746+E: ID_MODEL_ENC=xHCI\x20Host\x20Controller
747+E: ID_MODEL_FROM_DATABASE=2.0 root hub
748+E: ID_MODEL_ID=0002
749+E: ID_PATH=pci-0000:00:14.0
750+E: ID_PATH_TAG=pci-0000_00_14_0
751+E: ID_REVISION=0313
752+E: ID_SERIAL=Linux_3.13.0-8-generic_xhci_hcd_xHCI_Host_Controller_0000:00:14.0
753+E: ID_SERIAL_SHORT=0000:00:14.0
754+E: ID_USB_INTERFACES=:090000:
755+E: ID_VENDOR=Linux_3.13.0-8-generic_xhci_hcd
756+E: ID_VENDOR_ENC=Linux\x203.13.0-8-generic\x20xhci_hcd
757+E: ID_VENDOR_FROM_DATABASE=Linux Foundation
758+E: ID_VENDOR_ID=1d6b
759+E: MAJOR=189
760+E: MINOR=256
761+E: PRODUCT=1d6b/2/313
762+E: SUBSYSTEM=usb
763+E: TAGS=:seat:
764+E: TYPE=9/0/1
765+A: authorized=1
766+A: authorized_default=1
767+A: avoid_reset_quirk=0
768+A: bConfigurationValue=1
769+A: bDeviceClass=09
770+A: bDeviceProtocol=01
771+A: bDeviceSubClass=00
772+A: bMaxPacketSize0=64
773+A: bMaxPower=0mA
774+A: bNumConfigurations=1
775+A: bNumInterfaces= 1
776+A: bcdDevice=0313
777+A: bmAttributes=e0
778+A: busnum=3
779+A: configuration=
780+H: descriptors=12010002090001406B1D020013030302010109021900010100E0000904000001090000000705810304000C
781+A: dev=189:256
782+A: devnum=1
783+A: devpath=0
784+L: driver=../../../../bus/usb/drivers/usb
785+A: idProduct=0002
786+A: idVendor=1d6b
787+A: ltm_capable=no
788+A: manufacturer=Linux 3.13.0-8-generic xhci_hcd
789+A: maxchild=14
790+A: product=xHCI Host Controller
791+A: quirks=0x0
792+A: removable=unknown
793+A: serial=0000:00:14.0
794+A: speed=480
795+A: urbnum=178
796+A: version= 2.00
797+
798+P: /devices/pci0000:00/0000:00:14.0
799+E: DRIVER=xhci_hcd
800+E: ID_MODEL_FROM_DATABASE=Lynx Point USB xHCI Host Controller
801+E: ID_PCI_CLASS_FROM_DATABASE=Serial bus controller
802+E: ID_PCI_INTERFACE_FROM_DATABASE=XHCI
803+E: ID_PCI_SUBCLASS_FROM_DATABASE=USB controller
804+E: ID_VENDOR_FROM_DATABASE=Intel Corporation
805+E: MODALIAS=pci:v00008086d00008C31sv00001558sd00007410bc0Csc03i30
806+E: PCI_CLASS=C0330
807+E: PCI_ID=8086:8C31
808+E: PCI_SLOT_NAME=0000:00:14.0
809+E: PCI_SUBSYS_ID=1558:7410
810+E: SUBSYSTEM=pci
811+A: broken_parity_status=0
812+A: class=0x0c0330
813+H: config=8680318C060490020430030C000000000400E2F700000000000000000000000000000000000000000000000058151074000000007000000000000000FF010000FD01368089C60F8000000000000000009F6E8807000000000000000000000000302000000000000000000000000000000180C2C108000000000000000000000005008700F802E0FE000000000000000000000000000000000000000000000000400100000000000000000000000000000F000100000000000000000000000000030420C0030C3000030C300000000000FF3F0000FF3F00003F0000003F000000A0000000D03C000000000000D8D8D8080000000000000000B10F050800000000
814+A: consistent_dma_mask_bits=64
815+A: d3cold_allowed=1
816+A: device=0x8c31
817+A: dma_mask_bits=64
818+L: driver=../../../bus/pci/drivers/xhci_hcd
819+A: enabled=1
820+A: irq=42
821+A: local_cpulist=0-7
822+A: local_cpus=00000000,00000000,00000000,00000000,00000000,00000000,00000000,000000ff
823+A: modalias=pci:v00008086d00008C31sv00001558sd00007410bc0Csc03i30
824+A: msi_bus=
825+A: numa_node=-1
826+A: pools=poolinfo - 0.1\nbuffer-2048 0 0 2048 0\nbuffer-512 0 0 512 0\nbuffer-128 0 0 128 0\nbuffer-32 0 0 32 0\nxHCI 1KB stream ctx arrays 0 0 1024 0\nxHCI 256 byte stream ctx arrays 0 0 256 0\nxHCI input/output contexts 7 7 2112 7\nxHCI ring segments 40 40 4096 40\nbuffer-2048 0 0 2048 0\nbuffer-512 0 0 512 0\nbuffer-128 0 0 128 0\nbuffer-32 0 0 32 0
827+A: resource=0x00000000f7e20000 0x00000000f7e2ffff 0x0000000000140204\n0x0000000000000000 0x0000000000000000 0x0000000000000000\n0x0000000000000000 0x0000000000000000 0x0000000000000000\n0x0000000000000000 0x0000000000000000 0x0000000000000000\n0x0000000000000000 0x0000000000000000 0x0000000000000000\n0x0000000000000000 0x0000000000000000 0x0000000000000000\n0x0000000000000000 0x0000000000000000 0x0000000000000000\n0x0000000000000000 0x0000000000000000 0x0000000000000000\n0x0000000000000000 0x0000000000000000 0x0000000000000000\n0x0000000000000000 0x0000000000000000 0x0000000000000000\n0x0000000000000000 0x0000000000000000 0x0000000000000000\n0x0000000000000000 0x0000000000000000 0x0000000000000000\n0x0000000000000000 0x0000000000000000 0x0000000000000000
828+A: subsystem_device=0x7410
829+A: subsystem_vendor=0x1558
830+A: vendor=0x8086
831+
832
833=== added file 'tests/mir_test_framework/udev_recordings/laptop-keyboard.ioctl'
834--- tests/mir_test_framework/udev_recordings/laptop-keyboard.ioctl 1970-01-01 00:00:00 +0000
835+++ tests/mir_test_framework/udev_recordings/laptop-keyboard.ioctl 2014-03-13 07:39:32 +0000
836@@ -0,0 +1,12 @@
837+@DEV /dev/input/event4
838+EVIOCGNAME(0) 29 4154205472616E736C61746564205365742032206B6579626F61726400E9B73A300372020000000000CB0170ED7F000080E1C47FED7F000000000000000000000000000000000000C009C57FED7F00
839+EVIOCGVERSION 0 01000100
840+EVIOCGID 0 11000100010083AB
841+EVIOCGPHYS(0) 22 697361303036302F736572696F302F696E707574300079626F61726400E9B73A300372020000000000CB0170ED7F000080E1C47FED7F000000000000000000000000000000000000C009C57FED7F00
842+EVIOCGBIT(1) 96 FEFFFFFFFFFFFFFFFFFFEFFFDFFFFFFE01D000F878308003000000020400000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
843+EVIOCGBIT(3) 8 0000000000000000
844+EVIOCGBIT(2) 2 0000
845+EVIOCGBIT(5) 2 0000
846+EVIOCGBIT(17) 2 0700
847+EVIOCGBIT(21) 16 00000000000000000000000000000000
848+EVIOCGPROP(0) 4 00000000
849
850=== added file 'tests/mir_test_framework/udev_recordings/laptop-keyboard.umockdev'
851--- tests/mir_test_framework/udev_recordings/laptop-keyboard.umockdev 1970-01-01 00:00:00 +0000
852+++ tests/mir_test_framework/udev_recordings/laptop-keyboard.umockdev 2014-03-13 07:39:32 +0000
853@@ -0,0 +1,74 @@
854+P: /devices/platform/i8042/serio0/input/input4/event4
855+N: input/event4
856+S: input/by-path/platform-i8042-serio-0-event-kbd
857+E: DEVLINKS=/dev/input/by-path/platform-i8042-serio-0-event-kbd
858+E: DEVNAME=/dev/input/event4
859+E: ID_INPUT=1
860+E: ID_INPUT_KEY=1
861+E: ID_INPUT_KEYBOARD=1
862+E: ID_PATH=platform-i8042-serio-0
863+E: ID_PATH_TAG=platform-i8042-serio-0
864+E: ID_SERIAL=noserial
865+E: MAJOR=13
866+E: MINOR=68
867+E: SUBSYSTEM=input
868+E: XKBLAYOUT=us
869+E: XKBMODEL=pc105
870+E: XKBOPTIONS=compose:menu,ctrl:nocaps
871+E: XKBVARIANT=dvorak
872+A: dev=13:68
873+L: device=../../input4
874+
875+P: /devices/platform/i8042/serio0/input/input4
876+E: EV=120013
877+E: ID_FOR_SEAT=input-platform-i8042-serio-0
878+E: ID_INPUT=1
879+E: ID_INPUT_KEY=1
880+E: ID_INPUT_KEYBOARD=1
881+E: ID_PATH=platform-i8042-serio-0
882+E: ID_PATH_TAG=platform-i8042-serio-0
883+E: ID_SERIAL=noserial
884+E: KEY=402000000 3803078f800d001 feffffdfffefffff fffffffffffffffe
885+E: LED=7
886+E: MODALIAS=input:b0011v0001p0001eAB83-e0,1,4,11,14,k71,72,73,74,75,76,77,79,7A,7B,7C,7D,7E,7F,80,8C,8E,8F,9B,9C,9D,9E,9F,A3,A4,A5,A6,AC,AD,B7,B8,B9,D9,E2,ram4,l0,1,2,sfw
887+E: MSC=10
888+E: NAME="AT Translated Set 2 keyboard"
889+E: PHYS="isa0060/serio0/input0"
890+E: PRODUCT=11/1/1/ab83
891+E: PROP=0
892+E: SUBSYSTEM=input
893+E: TAGS=:seat:
894+L: device=../../../serio0
895+A: modalias=input:b0011v0001p0001eAB83-e0,1,4,11,14,k71,72,73,74,75,76,77,79,7A,7B,7C,7D,7E,7F,80,8C,8E,8F,9B,9C,9D,9E,9F,A3,A4,A5,A6,AC,AD,B7,B8,B9,D9,E2,ram4,l0,1,2,sfw
896+A: name=AT Translated Set 2 keyboard
897+A: phys=isa0060/serio0/input0
898+A: properties=0
899+A: uniq=
900+
901+P: /devices/platform/i8042/serio0
902+E: DRIVER=atkbd
903+E: MODALIAS=serio:ty06pr00id00ex00
904+E: SERIO_EXTRA=00
905+E: SERIO_ID=00
906+E: SERIO_PROTO=00
907+E: SERIO_TYPE=06
908+E: SUBSYSTEM=serio
909+A: bind_mode=auto
910+A: description=i8042 KBD port
911+L: driver=../../../../bus/serio/drivers/atkbd
912+A: err_count=0
913+A: extra=0
914+A: force_release=369-370
915+A: modalias=serio:ty06pr00id00ex00
916+A: scroll=0
917+A: set=2
918+A: softraw=1
919+A: softrepeat=0
920+
921+P: /devices/platform/i8042
922+E: DRIVER=i8042
923+E: MODALIAS=platform:i8042
924+E: SUBSYSTEM=platform
925+L: driver=../../../bus/platform/drivers/i8042
926+A: modalias=platform:i8042
927+
928
929=== added file 'tests/mir_test_framework/udev_recordings/synaptics-touchpad.ioctl'
930--- tests/mir_test_framework/udev_recordings/synaptics-touchpad.ioctl 1970-01-01 00:00:00 +0000
931+++ tests/mir_test_framework/udev_recordings/synaptics-touchpad.ioctl 2014-03-13 07:39:32 +0000
932@@ -0,0 +1,29 @@
933+@DEV /dev/input/event12
934+EVIOCGNAME(0) 27 53796E50532F322053796E61707469637320546F756368506164000000000000200B0050157F0000C895BE6B157F0000C0080050157F0000C0F4275D157F0000F03FD30100000000F523476D157F00
935+EVIOCGVERSION 0 01000100
936+EVIOCGID 0 110002000700B101
937+EVIOCGPHYS(0) 22 697361303036302F736572696F322F696E707574300068506164000000000000200B0050157F0000C895BE6B157F0000C0080050157F0000C0F4275D157F0000F03FD30100000000F523476D157F00
938+EVIOCGBIT(1) 96 0000000000000000000000000000000000000000000000000000000000000000000001000000000020E5000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
939+EVIOCGBIT(3) 8 0300001100806006
940+EVIOCGBIT(2) 2 0000
941+EVIOCGBIT(5) 2 0000
942+EVIOCGBIT(17) 2 0000
943+EVIOCGBIT(21) 16 00000000000000000000000000000000
944+EVIOCGPROP(0) 4 05000000
945+EVIOCGABS(53) 0 00000000C00500003016000008000000000000002E000000
946+EVIOCGABS(54) 0 00000000800500007812000008000000000000003E000000
947+EVIOCGABS(58) 0 0000000000000000FF000000000000000000000000000000
948+EVIOCGABS(57) 0 0000000000000000FFFF0000000000000000000000000000
949+EVIOCGABS(47) 0 000000000000000001000000000000000000000000000000
950+EVIOCGKEY(0) 96 000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
951+EVIOCGNAME(0) 27 53796E50532F322053796E61707469637320546F756368506164000000000000200B00A8A37F0000C8A59DC6A37F0000C00800A8A37F0000C00407B8A37F0000F0DF950100000000F53326C8A37F00
952+EVIOCGPHYS(0) 22 697361303036302F736572696F322F696E707574300068506164000000000000200B00A8A37F0000C8A59DC6A37F0000C00800A8A37F0000C00407B8A37F0000F0DF950100000000F53326C8A37F00
953+EVIOCGNAME(0) 18 48444120496E74656C20504348204D6963007574300068506164000000000000200B00CC1C7F0000C81563E91C7F0000C00800CC1C7F0000C074CCDA1C7F0000307F170200000000F5A3EBEA1C7F00
954+EVIOCGID 0 0000000000000000
955+EVIOCGPHYS(0) 5 414C5341006E74656C20504348204D6963007574300068506164000000000000200B00CC1C7F0000C81563E91C7F0000C00800CC1C7F0000C074CCDA1C7F0000307F170200000000F5A3EBEA1C7F00
956+EVIOCGBIT(1) 96 000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
957+EVIOCGBIT(3) 8 0000000000000000
958+EVIOCGBIT(5) 2 1000
959+EVIOCGPROP(0) 4 00000000
960+EVIOCGNAME(0) 27 53796E50532F322053796E61707469637320546F756368506164000000000000200B00E8217F0000C885F704227F0000C00800E8217F0000C0E460F6217F0000303FF40100000000F5138006227F00
961+EVIOCGPHYS(0) 22 697361303036302F736572696F322F696E707574300068506164000000000000200B00E8217F0000C885F704227F0000C00800E8217F0000C0E460F6217F0000303FF40100000000F5138006227F00
962
963=== added file 'tests/mir_test_framework/udev_recordings/synaptics-touchpad.umockdev'
964--- tests/mir_test_framework/udev_recordings/synaptics-touchpad.umockdev 1970-01-01 00:00:00 +0000
965+++ tests/mir_test_framework/udev_recordings/synaptics-touchpad.umockdev 2014-03-13 07:39:32 +0000
966@@ -0,0 +1,65 @@
967+P: /devices/platform/i8042/serio2/input/input11/event12
968+N: input/event12
969+S: input/by-path/platform-i8042-serio-2-event-mouse
970+E: DEVLINKS=/dev/input/by-path/platform-i8042-serio-2-event-mouse
971+E: DEVNAME=/dev/input/event12
972+E: ID_INPUT=1
973+E: ID_INPUT_TOUCHPAD=1
974+E: ID_PATH=platform-i8042-serio-2
975+E: ID_PATH_TAG=platform-i8042-serio-2
976+E: ID_SERIAL=noserial
977+E: MAJOR=13
978+E: MINOR=76
979+E: SUBSYSTEM=input
980+A: dev=13:76
981+L: device=../../input11
982+
983+P: /devices/platform/i8042/serio2/input/input11
984+E: ABS=660800011000003
985+E: EV=b
986+E: ID_FOR_SEAT=input-platform-i8042-serio-2
987+E: ID_INPUT=1
988+E: ID_INPUT_TOUCHPAD=1
989+E: ID_PATH=platform-i8042-serio-2
990+E: ID_PATH_TAG=platform-i8042-serio-2
991+E: ID_SERIAL=noserial
992+E: KEY=e520 10000 0 0 0 0
993+E: MODALIAS=input:b0011v0002p0007e01B1-e0,1,3,k110,145,148,14A,14D,14E,14F,ra0,1,18,1C,2F,35,36,39,3A,mlsfw
994+E: NAME="SynPS/2 Synaptics TouchPad"
995+E: PHYS="isa0060/serio2/input0"
996+E: PRODUCT=11/2/7/1b1
997+E: PROP=5
998+E: SUBSYSTEM=input
999+E: TAGS=:seat:
1000+L: device=../../../serio2
1001+A: modalias=input:b0011v0002p0007e01B1-e0,1,3,k110,145,148,14A,14D,14E,14F,ra0,1,18,1C,2F,35,36,39,3A,mlsfw
1002+A: name=SynPS/2 Synaptics TouchPad
1003+A: phys=isa0060/serio2/input0
1004+A: properties=5
1005+A: uniq=
1006+
1007+P: /devices/platform/i8042/serio2
1008+E: DRIVER=psmouse
1009+E: MODALIAS=serio:ty01pr00id00ex00
1010+E: SERIO_EXTRA=00
1011+E: SERIO_ID=00
1012+E: SERIO_PROTO=00
1013+E: SERIO_TYPE=01
1014+E: SUBSYSTEM=serio
1015+A: bind_mode=auto
1016+A: description=i8042 AUX1 port
1017+L: driver=../../../../bus/serio/drivers/psmouse
1018+A: modalias=serio:ty01pr00id00ex00
1019+A: protocol=SynPS/2
1020+A: rate=80
1021+A: resetafter=5
1022+A: resolution=200
1023+A: resync_time=0
1024+
1025+P: /devices/platform/i8042
1026+E: DRIVER=i8042
1027+E: MODALIAS=platform:i8042
1028+E: SUBSYSTEM=platform
1029+L: driver=../../../bus/platform/drivers/i8042
1030+A: modalias=platform:i8042
1031+
1032
1033=== added file 'tests/mir_test_framework/udev_recordings/usb-keyboard.ioctl'
1034--- tests/mir_test_framework/udev_recordings/usb-keyboard.ioctl 1970-01-01 00:00:00 +0000
1035+++ tests/mir_test_framework/udev_recordings/usb-keyboard.ioctl 2014-03-13 07:39:32 +0000
1036@@ -0,0 +1,13 @@
1037+@DEV /dev/input/event14
1038+EVIOCGNAME(0) 42 46756A69747375205369656D656E7320436F6D70757465727320476D624820465343204B42205553420000C0837F000080D1FFC7837F000000000000000000000000000000000000C0F9FFC7837F00
1039+EVIOCGVERSION 0 01000100
1040+EVIOCGID 0 0300F80B04101001
1041+EVIOCGPHYS(0) 26 7573622D303030303A30303A31342E302D322F696E7075743000476D624820465343204B42205553420000C0837F000080D1FFC7837F000000000000000000000000000000000000C0F9FFC7837F00
1042+EVIOCGUNIQ(0) 1 0073622D303030303A30303A31342E302D322F696E7075743000476D624820465343204B42205553420000C0837F000080D1FFC7837F000000000000000000000000000000000000C0F9FFC7837F00
1043+EVIOCGBIT(1) 96 FEFFFFFFFFFFFFFFFFFFCF01DFFF80E00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
1044+EVIOCGBIT(3) 8 0000000000000000
1045+EVIOCGBIT(2) 2 0000
1046+EVIOCGBIT(5) 2 0000
1047+EVIOCGBIT(17) 2 1F00
1048+EVIOCGBIT(21) 16 00000000000000000000000000000000
1049+EVIOCGPROP(0) 4 00000000
1050
1051=== added file 'tests/mir_test_framework/udev_recordings/usb-keyboard.umockdev'
1052--- tests/mir_test_framework/udev_recordings/usb-keyboard.umockdev 1970-01-01 00:00:00 +0000
1053+++ tests/mir_test_framework/udev_recordings/usb-keyboard.umockdev 2014-03-13 07:39:32 +0000
1054@@ -0,0 +1,244 @@
1055+P: /devices/pci0000:00/0000:00:14.0/usb3/3-2/3-2:1.0/input/input24/event14
1056+N: input/event14
1057+S: input/by-id/usb-Fujitsu_Siemens_Computers_GmbH_FSC_KB_USB-event-kbd
1058+S: input/by-path/pci-0000:00:14.0-usb-0:2:1.0-event-kbd
1059+E: DEVLINKS=/dev/input/by-id/usb-Fujitsu_Siemens_Computers_GmbH_FSC_KB_USB-event-kbd /dev/input/by-path/pci-0000:00:14.0-usb-0:2:1.0-event-kbd
1060+E: DEVNAME=/dev/input/event14
1061+E: ID_BUS=usb
1062+E: ID_INPUT=1
1063+E: ID_INPUT_KEY=1
1064+E: ID_INPUT_KEYBOARD=1
1065+E: ID_MODEL=FSC_KB_USB
1066+E: ID_MODEL_ENC=FSC\x20KB\x20USB
1067+E: ID_MODEL_ID=1004
1068+E: ID_PATH=pci-0000:00:14.0-usb-0:2:1.0
1069+E: ID_PATH_TAG=pci-0000_00_14_0-usb-0_2_1_0
1070+E: ID_REVISION=0001
1071+E: ID_SERIAL=Fujitsu_Siemens_Computers_GmbH_FSC_KB_USB
1072+E: ID_TYPE=hid
1073+E: ID_USB_DRIVER=usbhid
1074+E: ID_USB_INTERFACES=:030101:030000:
1075+E: ID_USB_INTERFACE_NUM=00
1076+E: ID_VENDOR=Fujitsu_Siemens_Computers_GmbH
1077+E: ID_VENDOR_ENC=Fujitsu\x20Siemens\x20Computers\x20GmbH
1078+E: ID_VENDOR_ID=0bf8
1079+E: MAJOR=13
1080+E: MINOR=78
1081+E: SUBSYSTEM=input
1082+E: XKBLAYOUT=us
1083+E: XKBMODEL=pc105
1084+E: XKBOPTIONS=compose:menu,ctrl:nocaps
1085+E: XKBVARIANT=dvorak
1086+A: dev=13:78
1087+L: device=../../input24
1088+
1089+P: /devices/pci0000:00/0000:00:14.0/usb3/3-2/3-2:1.0/input/input24
1090+E: EV=120013
1091+E: ID_BUS=usb
1092+E: ID_FOR_SEAT=input-pci-0000_00_14_0-usb-0_2_1_0
1093+E: ID_INPUT=1
1094+E: ID_INPUT_KEY=1
1095+E: ID_INPUT_KEYBOARD=1
1096+E: ID_MODEL=FSC_KB_USB
1097+E: ID_MODEL_ENC=FSC\x20KB\x20USB
1098+E: ID_MODEL_ID=1004
1099+E: ID_PATH=pci-0000:00:14.0-usb-0:2:1.0
1100+E: ID_PATH_TAG=pci-0000_00_14_0-usb-0_2_1_0
1101+E: ID_REVISION=0001
1102+E: ID_SERIAL=Fujitsu_Siemens_Computers_GmbH_FSC_KB_USB
1103+E: ID_TYPE=hid
1104+E: ID_USB_DRIVER=usbhid
1105+E: ID_USB_INTERFACES=:030101:030000:
1106+E: ID_USB_INTERFACE_NUM=00
1107+E: ID_VENDOR=Fujitsu_Siemens_Computers_GmbH
1108+E: ID_VENDOR_ENC=Fujitsu\x20Siemens\x20Computers\x20GmbH
1109+E: ID_VENDOR_ID=0bf8
1110+E: KEY=e080ffdf01cfffff fffffffffffffffe
1111+E: LED=1f
1112+E: MODALIAS=input:b0003v0BF8p1004e0110-e0,1,4,11,14,k77,7D,7E,7F,ram4,l0,1,2,3,4,sfw
1113+E: MSC=10
1114+E: NAME="Fujitsu Siemens Computers GmbH FSC KB USB"
1115+E: PHYS="usb-0000:00:14.0-2/input0"
1116+E: PRODUCT=3/bf8/1004/110
1117+E: PROP=0
1118+E: SUBSYSTEM=input
1119+E: TAGS=:seat:
1120+E: UNIQ=""
1121+L: device=../../../3-2:1.0
1122+A: modalias=input:b0003v0BF8p1004e0110-e0,1,4,11,14,k77,7D,7E,7F,ram4,l0,1,2,3,4,sfw
1123+A: name=Fujitsu Siemens Computers GmbH FSC KB USB
1124+A: phys=usb-0000:00:14.0-2/input0
1125+A: properties=0
1126+A: uniq=
1127+
1128+P: /devices/pci0000:00/0000:00:14.0/usb3/3-2/3-2:1.0
1129+E: DEVTYPE=usb_interface
1130+E: DRIVER=usbhid
1131+E: ID_VENDOR_FROM_DATABASE=Fujitsu Siemens Computers
1132+E: INTERFACE=3/1/1
1133+E: MODALIAS=usb:v0BF8p1004d0001dc00dsc00dp00ic03isc01ip01in00
1134+E: PRODUCT=bf8/1004/1
1135+E: SUBSYSTEM=usb
1136+E: TYPE=0/0/0
1137+A: bAlternateSetting= 0
1138+A: bInterfaceClass=03
1139+A: bInterfaceNumber=00
1140+A: bInterfaceProtocol=01
1141+A: bInterfaceSubClass=01
1142+A: bNumEndpoints=01
1143+L: driver=../../../../../../bus/usb/drivers/usbhid
1144+A: interface=HID KEYBOARD (v2.0 rf)
1145+A: modalias=usb:v0BF8p1004d0001dc00dsc00dp00ic03isc01ip01in00
1146+A: supports_autosuspend=1
1147+
1148+P: /devices/pci0000:00/0000:00:14.0/usb3/3-2
1149+N: bus/usb/003/016=1201100100000008F80B041001000102000109023B00020102A032090400000103010103092110010001223F000705810308000A090401000103000000092110010001225100070582030200A0
1150+E: BUSNUM=003
1151+E: DEVNAME=/dev/bus/usb/003/016
1152+E: DEVNUM=016
1153+E: DEVTYPE=usb_device
1154+E: DRIVER=usb
1155+E: ID_BUS=usb
1156+E: ID_MODEL=FSC_KB_USB
1157+E: ID_MODEL_ENC=FSC\x20KB\x20USB
1158+E: ID_MODEL_ID=1004
1159+E: ID_REVISION=0001
1160+E: ID_SERIAL=Fujitsu_Siemens_Computers_GmbH_FSC_KB_USB
1161+E: ID_USB_INTERFACES=:030101:030000:
1162+E: ID_VENDOR=Fujitsu_Siemens_Computers_GmbH
1163+E: ID_VENDOR_ENC=Fujitsu\x20Siemens\x20Computers\x20GmbH
1164+E: ID_VENDOR_FROM_DATABASE=Fujitsu Siemens Computers
1165+E: ID_VENDOR_ID=0bf8
1166+E: MAJOR=189
1167+E: MINOR=271
1168+E: PRODUCT=bf8/1004/1
1169+E: SUBSYSTEM=usb
1170+E: TYPE=0/0/0
1171+A: authorized=1
1172+A: avoid_reset_quirk=0
1173+A: bConfigurationValue=1
1174+A: bDeviceClass=00
1175+A: bDeviceProtocol=00
1176+A: bDeviceSubClass=00
1177+A: bMaxPacketSize0=8
1178+A: bMaxPower=100mA
1179+A: bNumConfigurations=1
1180+A: bNumInterfaces= 2
1181+A: bcdDevice=0001
1182+A: bmAttributes=a0
1183+A: busnum=3
1184+A: configuration=FSC KB USB
1185+H: descriptors=1201100100000008F80B041001000102000109023B00020102A032090400000103010103092110010001223F000705810308000A090401000103000000092110010001225100070582030200A0
1186+A: dev=189:271
1187+A: devnum=16
1188+A: devpath=2
1189+L: driver=../../../../../bus/usb/drivers/usb
1190+A: idProduct=1004
1191+A: idVendor=0bf8
1192+A: ltm_capable=no
1193+A: manufacturer=Fujitsu Siemens Computers GmbH
1194+A: maxchild=0
1195+L: port=../3-0:1.0/port2
1196+A: product=FSC KB USB
1197+A: quirks=0x0
1198+A: removable=removable
1199+A: speed=1.5
1200+A: urbnum=136
1201+A: version= 1.10
1202+
1203+P: /devices/pci0000:00/0000:00:14.0/usb3
1204+N: bus/usb/003/001=12010002090001406B1D020013030302010109021900010100E0000904000001090000000705810304000C
1205+E: BUSNUM=003
1206+E: DEVNAME=/dev/bus/usb/003/001
1207+E: DEVNUM=001
1208+E: DEVTYPE=usb_device
1209+E: DRIVER=usb
1210+E: ID_BUS=usb
1211+E: ID_FOR_SEAT=usb-pci-0000_00_14_0
1212+E: ID_MODEL=xHCI_Host_Controller
1213+E: ID_MODEL_ENC=xHCI\x20Host\x20Controller
1214+E: ID_MODEL_FROM_DATABASE=2.0 root hub
1215+E: ID_MODEL_ID=0002
1216+E: ID_PATH=pci-0000:00:14.0
1217+E: ID_PATH_TAG=pci-0000_00_14_0
1218+E: ID_REVISION=0313
1219+E: ID_SERIAL=Linux_3.13.0-8-generic_xhci_hcd_xHCI_Host_Controller_0000:00:14.0
1220+E: ID_SERIAL_SHORT=0000:00:14.0
1221+E: ID_USB_INTERFACES=:090000:
1222+E: ID_VENDOR=Linux_3.13.0-8-generic_xhci_hcd
1223+E: ID_VENDOR_ENC=Linux\x203.13.0-8-generic\x20xhci_hcd
1224+E: ID_VENDOR_FROM_DATABASE=Linux Foundation
1225+E: ID_VENDOR_ID=1d6b
1226+E: MAJOR=189
1227+E: MINOR=256
1228+E: PRODUCT=1d6b/2/313
1229+E: SUBSYSTEM=usb
1230+E: TAGS=:seat:
1231+E: TYPE=9/0/1
1232+A: authorized=1
1233+A: authorized_default=1
1234+A: avoid_reset_quirk=0
1235+A: bConfigurationValue=1
1236+A: bDeviceClass=09
1237+A: bDeviceProtocol=01
1238+A: bDeviceSubClass=00
1239+A: bMaxPacketSize0=64
1240+A: bMaxPower=0mA
1241+A: bNumConfigurations=1
1242+A: bNumInterfaces= 1
1243+A: bcdDevice=0313
1244+A: bmAttributes=e0
1245+A: busnum=3
1246+A: configuration=
1247+H: descriptors=12010002090001406B1D020013030302010109021900010100E0000904000001090000000705810304000C
1248+A: dev=189:256
1249+A: devnum=1
1250+A: devpath=0
1251+L: driver=../../../../bus/usb/drivers/usb
1252+A: idProduct=0002
1253+A: idVendor=1d6b
1254+A: ltm_capable=no
1255+A: manufacturer=Linux 3.13.0-8-generic xhci_hcd
1256+A: maxchild=14
1257+A: product=xHCI Host Controller
1258+A: quirks=0x0
1259+A: removable=unknown
1260+A: serial=0000:00:14.0
1261+A: speed=480
1262+A: urbnum=236
1263+A: version= 2.00
1264+
1265+P: /devices/pci0000:00/0000:00:14.0
1266+E: DRIVER=xhci_hcd
1267+E: ID_MODEL_FROM_DATABASE=Lynx Point USB xHCI Host Controller
1268+E: ID_PCI_CLASS_FROM_DATABASE=Serial bus controller
1269+E: ID_PCI_INTERFACE_FROM_DATABASE=XHCI
1270+E: ID_PCI_SUBCLASS_FROM_DATABASE=USB controller
1271+E: ID_VENDOR_FROM_DATABASE=Intel Corporation
1272+E: MODALIAS=pci:v00008086d00008C31sv00001558sd00007410bc0Csc03i30
1273+E: PCI_CLASS=C0330
1274+E: PCI_ID=8086:8C31
1275+E: PCI_SLOT_NAME=0000:00:14.0
1276+E: PCI_SUBSYS_ID=1558:7410
1277+E: SUBSYSTEM=pci
1278+A: broken_parity_status=0
1279+A: class=0x0c0330
1280+H: config=8680318C060490020430030C000000000400E2F700000000000000000000000000000000000000000000000058151074000000007000000000000000FF010000FD01368089C60F8000000000000000009F6E8807000000000000000000000000302000000000000000000000000000000180C2C108000000000000000000000005008700F802E0FE000000000000000000000000000000000000000000000000400100000000000000000000000000000F000100000000000000000000000000030420C0030C3000030C300000000000FF3F0000FF3F00003F0000003F000000A0000000D03C000000000000D8D8D8080000000000000000B10F050800000000
1281+A: consistent_dma_mask_bits=64
1282+A: d3cold_allowed=1
1283+A: device=0x8c31
1284+A: dma_mask_bits=64
1285+L: driver=../../../bus/pci/drivers/xhci_hcd
1286+A: enabled=1
1287+A: irq=42
1288+A: local_cpulist=0-7
1289+A: local_cpus=00000000,00000000,00000000,00000000,00000000,00000000,00000000,000000ff
1290+A: modalias=pci:v00008086d00008C31sv00001558sd00007410bc0Csc03i30
1291+A: msi_bus=
1292+A: numa_node=-1
1293+A: pools=poolinfo - 0.1\nbuffer-2048 0 0 2048 0\nbuffer-512 0 0 512 0\nbuffer-128 0 0 128 0\nbuffer-32 0 0 32 0\nxHCI 1KB stream ctx arrays 0 0 1024 0\nxHCI 256 byte stream ctx arrays 0 0 256 0\nxHCI input/output contexts 11 11 2112 11\nxHCI ring segments 40 40 4096 40\nbuffer-2048 0 0 2048 0\nbuffer-512 0 0 512 0\nbuffer-128 9 32 128 1\nbuffer-32 0 0 32 0
1294+A: resource=0x00000000f7e20000 0x00000000f7e2ffff 0x0000000000140204\n0x0000000000000000 0x0000000000000000 0x0000000000000000\n0x0000000000000000 0x0000000000000000 0x0000000000000000\n0x0000000000000000 0x0000000000000000 0x0000000000000000\n0x0000000000000000 0x0000000000000000 0x0000000000000000\n0x0000000000000000 0x0000000000000000 0x0000000000000000\n0x0000000000000000 0x0000000000000000 0x0000000000000000\n0x0000000000000000 0x0000000000000000 0x0000000000000000\n0x0000000000000000 0x0000000000000000 0x0000000000000000\n0x0000000000000000 0x0000000000000000 0x0000000000000000\n0x0000000000000000 0x0000000000000000 0x0000000000000000\n0x0000000000000000 0x0000000000000000 0x0000000000000000\n0x0000000000000000 0x0000000000000000 0x0000000000000000
1295+A: subsystem_device=0x7410
1296+A: subsystem_vendor=0x1558
1297+A: vendor=0x8086
1298+
1299
1300=== added file 'tests/mir_test_framework/udev_recordings/usb-mouse.ioctl'
1301--- tests/mir_test_framework/udev_recordings/usb-mouse.ioctl 1970-01-01 00:00:00 +0000
1302+++ tests/mir_test_framework/udev_recordings/usb-mouse.ioctl 2014-03-13 07:39:32 +0000
1303@@ -0,0 +1,14 @@
1304+@DEV /dev/input/event13
1305+EVIOCGNAME(0) 27 4C6F67697465636820555342204F70746963616C204D6F757365006C29CED7F73013430200000000C0200014ED7F000080D1FF1BED7F000000000000000000000000000000000000C0F9FF1BED7F00
1306+EVIOCGVERSION 0 01000100
1307+EVIOCGID 0 03006D0418C01101
1308+EVIOCGPHYS(0) 26 7573622D303030303A30303A31342E302D332F696E7075743000006C29CED7F73013430200000000C0200014ED7F000080D1FF1BED7F000000000000000000000000000000000000C0F9FF1BED7F00
1309+EVIOCGUNIQ(0) 1 0073622D303030303A30303A31342E302D332F696E7075743000006C29CED7F73013430200000000C0200014ED7F000080D1FF1BED7F000000000000000000000000000000000000C0F9FF1BED7F00
1310+EVIOCGBIT(1) 96 000000000000000000000000000000000000000000000000000000000000000000000700000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
1311+EVIOCGBIT(3) 8 0000000000000000
1312+EVIOCGBIT(2) 2 0301
1313+EVIOCGBIT(5) 2 0000
1314+EVIOCGBIT(17) 2 0000
1315+EVIOCGBIT(21) 16 00000000000000000000000000000000
1316+EVIOCGPROP(0) 4 00000000
1317+EVIOCGKEY(0) 96 000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
1318
1319=== added file 'tests/mir_test_framework/udev_recordings/usb-mouse.umockdev'
1320--- tests/mir_test_framework/udev_recordings/usb-mouse.umockdev 1970-01-01 00:00:00 +0000
1321+++ tests/mir_test_framework/udev_recordings/usb-mouse.umockdev 2014-03-13 07:39:32 +0000
1322@@ -0,0 +1,240 @@
1323+P: /devices/pci0000:00/0000:00:14.0/usb3/3-3/3-3:1.0/input/input23/event13
1324+N: input/event13
1325+S: input/by-id/usb-Logitech_USB_Optical_Mouse-event-mouse
1326+S: input/by-path/pci-0000:00:14.0-usb-0:3:1.0-event-mouse
1327+E: DEVLINKS=/dev/input/by-id/usb-Logitech_USB_Optical_Mouse-event-mouse /dev/input/by-path/pci-0000:00:14.0-usb-0:3:1.0-event-mouse
1328+E: DEVNAME=/dev/input/event13
1329+E: ID_BUS=usb
1330+E: ID_INPUT=1
1331+E: ID_INPUT_MOUSE=1
1332+E: ID_MODEL=USB_Optical_Mouse
1333+E: ID_MODEL_ENC=USB\x20Optical\x20Mouse
1334+E: ID_MODEL_ID=c018
1335+E: ID_PATH=pci-0000:00:14.0-usb-0:3:1.0
1336+E: ID_PATH_TAG=pci-0000_00_14_0-usb-0_3_1_0
1337+E: ID_REVISION=4301
1338+E: ID_SERIAL=Logitech_USB_Optical_Mouse
1339+E: ID_TYPE=hid
1340+E: ID_USB_DRIVER=usbhid
1341+E: ID_USB_INTERFACES=:030102:
1342+E: ID_USB_INTERFACE_NUM=00
1343+E: ID_VENDOR=Logitech
1344+E: ID_VENDOR_ENC=Logitech
1345+E: ID_VENDOR_ID=046d
1346+E: MAJOR=13
1347+E: MINOR=77
1348+E: SUBSYSTEM=input
1349+A: dev=13:77
1350+L: device=../../input23
1351+
1352+P: /devices/pci0000:00/0000:00:14.0/usb3/3-3/3-3:1.0/input/input23
1353+E: EV=17
1354+E: ID_BUS=usb
1355+E: ID_FOR_SEAT=input-pci-0000_00_14_0-usb-0_3_1_0
1356+E: ID_INPUT=1
1357+E: ID_INPUT_MOUSE=1
1358+E: ID_MODEL=USB_Optical_Mouse
1359+E: ID_MODEL_ENC=USB\x20Optical\x20Mouse
1360+E: ID_MODEL_ID=c018
1361+E: ID_PATH=pci-0000:00:14.0-usb-0:3:1.0
1362+E: ID_PATH_TAG=pci-0000_00_14_0-usb-0_3_1_0
1363+E: ID_REVISION=4301
1364+E: ID_SERIAL=Logitech_USB_Optical_Mouse
1365+E: ID_TYPE=hid
1366+E: ID_USB_DRIVER=usbhid
1367+E: ID_USB_INTERFACES=:030102:
1368+E: ID_USB_INTERFACE_NUM=00
1369+E: ID_VENDOR=Logitech
1370+E: ID_VENDOR_ENC=Logitech
1371+E: ID_VENDOR_ID=046d
1372+E: KEY=70000 0 0 0 0
1373+E: MODALIAS=input:b0003v046DpC018e0111-e0,1,2,4,k110,111,112,r0,1,8,am4,lsfw
1374+E: MSC=10
1375+E: NAME="Logitech USB Optical Mouse"
1376+E: PHYS="usb-0000:00:14.0-3/input0"
1377+E: PRODUCT=3/46d/c018/111
1378+E: PROP=0
1379+E: REL=103
1380+E: SUBSYSTEM=input
1381+E: TAGS=:seat:
1382+E: UNIQ=""
1383+L: device=../../../3-3:1.0
1384+A: modalias=input:b0003v046DpC018e0111-e0,1,2,4,k110,111,112,r0,1,8,am4,lsfw
1385+A: name=Logitech USB Optical Mouse
1386+A: phys=usb-0000:00:14.0-3/input0
1387+A: properties=0
1388+A: uniq=
1389+
1390+P: /devices/pci0000:00/0000:00:14.0/usb3/3-3/3-3:1.0
1391+E: DEVTYPE=usb_interface
1392+E: DRIVER=usbhid
1393+E: ID_MODEL_FROM_DATABASE=Optical Wheel Mouse
1394+E: ID_VENDOR_FROM_DATABASE=Logitech, Inc.
1395+E: INTERFACE=3/1/2
1396+E: MODALIAS=usb:v046DpC018d4301dc00dsc00dp00ic03isc01ip02in00
1397+E: PRODUCT=46d/c018/4301
1398+E: SUBSYSTEM=usb
1399+E: TYPE=0/0/0
1400+A: bAlternateSetting= 0
1401+A: bInterfaceClass=03
1402+A: bInterfaceNumber=00
1403+A: bInterfaceProtocol=02
1404+A: bInterfaceSubClass=01
1405+A: bNumEndpoints=01
1406+L: driver=../../../../../../bus/usb/drivers/usbhid
1407+A: modalias=usb:v046DpC018d4301dc00dsc00dp00ic03isc01ip02in00
1408+A: supports_autosuspend=1
1409+
1410+P: /devices/pci0000:00/0000:00:14.0/usb3/3-3
1411+N: bus/usb/003/015=12010002000000086D0418C001430102000109022200010100A0320904000001030102000921110100012234000705810305000A
1412+E: BUSNUM=003
1413+E: DEVNAME=/dev/bus/usb/003/015
1414+E: DEVNUM=015
1415+E: DEVTYPE=usb_device
1416+E: DRIVER=usb
1417+E: ID_BUS=usb
1418+E: ID_MODEL=USB_Optical_Mouse
1419+E: ID_MODEL_ENC=USB\x20Optical\x20Mouse
1420+E: ID_MODEL_FROM_DATABASE=Optical Wheel Mouse
1421+E: ID_MODEL_ID=c018
1422+E: ID_REVISION=4301
1423+E: ID_SERIAL=Logitech_USB_Optical_Mouse
1424+E: ID_USB_INTERFACES=:030102:
1425+E: ID_VENDOR=Logitech
1426+E: ID_VENDOR_ENC=Logitech
1427+E: ID_VENDOR_FROM_DATABASE=Logitech, Inc.
1428+E: ID_VENDOR_ID=046d
1429+E: MAJOR=189
1430+E: MINOR=270
1431+E: PRODUCT=46d/c018/4301
1432+E: SUBSYSTEM=usb
1433+E: TYPE=0/0/0
1434+E: UPOWER_VENDOR=Logitech, Inc.
1435+A: authorized=1
1436+A: avoid_reset_quirk=0
1437+A: bConfigurationValue=1
1438+A: bDeviceClass=00
1439+A: bDeviceProtocol=00
1440+A: bDeviceSubClass=00
1441+A: bMaxPacketSize0=8
1442+A: bMaxPower=100mA
1443+A: bNumConfigurations=1
1444+A: bNumInterfaces= 1
1445+A: bcdDevice=4301
1446+A: bmAttributes=a0
1447+A: busnum=3
1448+A: configuration=
1449+H: descriptors=12010002000000086D0418C001430102000109022200010100A0320904000001030102000921110100012234000705810305000A
1450+A: dev=189:270
1451+A: devnum=15
1452+A: devpath=3
1453+L: driver=../../../../../bus/usb/drivers/usb
1454+A: idProduct=c018
1455+A: idVendor=046d
1456+A: ltm_capable=no
1457+A: manufacturer=Logitech
1458+A: maxchild=0
1459+L: port=../3-0:1.0/port3
1460+A: product=USB Optical Mouse
1461+A: quirks=0x0
1462+A: removable=removable
1463+A: speed=1.5
1464+A: urbnum=167
1465+A: version= 2.00
1466+
1467+P: /devices/pci0000:00/0000:00:14.0/usb3
1468+N: bus/usb/003/001=12010002090001406B1D020013030302010109021900010100E0000904000001090000000705810304000C
1469+E: BUSNUM=003
1470+E: DEVNAME=/dev/bus/usb/003/001
1471+E: DEVNUM=001
1472+E: DEVTYPE=usb_device
1473+E: DRIVER=usb
1474+E: ID_BUS=usb
1475+E: ID_FOR_SEAT=usb-pci-0000_00_14_0
1476+E: ID_MODEL=xHCI_Host_Controller
1477+E: ID_MODEL_ENC=xHCI\x20Host\x20Controller
1478+E: ID_MODEL_FROM_DATABASE=2.0 root hub
1479+E: ID_MODEL_ID=0002
1480+E: ID_PATH=pci-0000:00:14.0
1481+E: ID_PATH_TAG=pci-0000_00_14_0
1482+E: ID_REVISION=0313
1483+E: ID_SERIAL=Linux_3.13.0-8-generic_xhci_hcd_xHCI_Host_Controller_0000:00:14.0
1484+E: ID_SERIAL_SHORT=0000:00:14.0
1485+E: ID_USB_INTERFACES=:090000:
1486+E: ID_VENDOR=Linux_3.13.0-8-generic_xhci_hcd
1487+E: ID_VENDOR_ENC=Linux\x203.13.0-8-generic\x20xhci_hcd
1488+E: ID_VENDOR_FROM_DATABASE=Linux Foundation
1489+E: ID_VENDOR_ID=1d6b
1490+E: MAJOR=189
1491+E: MINOR=256
1492+E: PRODUCT=1d6b/2/313
1493+E: SUBSYSTEM=usb
1494+E: TAGS=:seat:
1495+E: TYPE=9/0/1
1496+A: authorized=1
1497+A: authorized_default=1
1498+A: avoid_reset_quirk=0
1499+A: bConfigurationValue=1
1500+A: bDeviceClass=09
1501+A: bDeviceProtocol=01
1502+A: bDeviceSubClass=00
1503+A: bMaxPacketSize0=64
1504+A: bMaxPower=0mA
1505+A: bNumConfigurations=1
1506+A: bNumInterfaces= 1
1507+A: bcdDevice=0313
1508+A: bmAttributes=e0
1509+A: busnum=3
1510+A: configuration=
1511+H: descriptors=12010002090001406B1D020013030302010109021900010100E0000904000001090000000705810304000C
1512+A: dev=189:256
1513+A: devnum=1
1514+A: devpath=0
1515+L: driver=../../../../bus/usb/drivers/usb
1516+A: idProduct=0002
1517+A: idVendor=1d6b
1518+A: ltm_capable=no
1519+A: manufacturer=Linux 3.13.0-8-generic xhci_hcd
1520+A: maxchild=14
1521+A: product=xHCI Host Controller
1522+A: quirks=0x0
1523+A: removable=unknown
1524+A: serial=0000:00:14.0
1525+A: speed=480
1526+A: urbnum=225
1527+A: version= 2.00
1528+
1529+P: /devices/pci0000:00/0000:00:14.0
1530+E: DRIVER=xhci_hcd
1531+E: ID_MODEL_FROM_DATABASE=Lynx Point USB xHCI Host Controller
1532+E: ID_PCI_CLASS_FROM_DATABASE=Serial bus controller
1533+E: ID_PCI_INTERFACE_FROM_DATABASE=XHCI
1534+E: ID_PCI_SUBCLASS_FROM_DATABASE=USB controller
1535+E: ID_VENDOR_FROM_DATABASE=Intel Corporation
1536+E: MODALIAS=pci:v00008086d00008C31sv00001558sd00007410bc0Csc03i30
1537+E: PCI_CLASS=C0330
1538+E: PCI_ID=8086:8C31
1539+E: PCI_SLOT_NAME=0000:00:14.0
1540+E: PCI_SUBSYS_ID=1558:7410
1541+E: SUBSYSTEM=pci
1542+A: broken_parity_status=0
1543+A: class=0x0c0330
1544+H: config=8680318C060490020430030C000000000400E2F700000000000000000000000000000000000000000000000058151074000000007000000000000000FF010000FD01368089C60F8000000000000000009F6E8807000000000000000000000000302000000000000000000000000000000180C2C108000000000000000000000005008700F802E0FE000000000000000000000000000000000000000000000000400100000000000000000000000000000F000100000000000000000000000000030420C0030C3000030C300000000000FF3F0000FF3F00003F0000003F000000A0000000D03C000000000000D8D8D8080000000000000000B10F050800000000
1545+A: consistent_dma_mask_bits=64
1546+A: d3cold_allowed=1
1547+A: device=0x8c31
1548+A: dma_mask_bits=64
1549+L: driver=../../../bus/pci/drivers/xhci_hcd
1550+A: enabled=1
1551+A: irq=42
1552+A: local_cpulist=0-7
1553+A: local_cpus=00000000,00000000,00000000,00000000,00000000,00000000,00000000,000000ff
1554+A: modalias=pci:v00008086d00008C31sv00001558sd00007410bc0Csc03i30
1555+A: msi_bus=
1556+A: numa_node=-1
1557+A: pools=poolinfo - 0.1\nbuffer-2048 0 0 2048 0\nbuffer-512 0 0 512 0\nbuffer-128 0 0 128 0\nbuffer-32 0 0 32 0\nxHCI 1KB stream ctx arrays 0 0 1024 0\nxHCI 256 byte stream ctx arrays 0 0 256 0\nxHCI input/output contexts 9 9 2112 9\nxHCI ring segments 34 34 4096 34\nbuffer-2048 0 0 2048 0\nbuffer-512 0 0 512 0\nbuffer-128 3 32 128 1\nbuffer-32 0 0 32 0
1558+A: resource=0x00000000f7e20000 0x00000000f7e2ffff 0x0000000000140204\n0x0000000000000000 0x0000000000000000 0x0000000000000000\n0x0000000000000000 0x0000000000000000 0x0000000000000000\n0x0000000000000000 0x0000000000000000 0x0000000000000000\n0x0000000000000000 0x0000000000000000 0x0000000000000000\n0x0000000000000000 0x0000000000000000 0x0000000000000000\n0x0000000000000000 0x0000000000000000 0x0000000000000000\n0x0000000000000000 0x0000000000000000 0x0000000000000000\n0x0000000000000000 0x0000000000000000 0x0000000000000000\n0x0000000000000000 0x0000000000000000 0x0000000000000000\n0x0000000000000000 0x0000000000000000 0x0000000000000000\n0x0000000000000000 0x0000000000000000 0x0000000000000000\n0x0000000000000000 0x0000000000000000 0x0000000000000000
1559+A: subsystem_device=0x7410
1560+A: subsystem_vendor=0x1558
1561+A: vendor=0x8086
1562+
1563
1564=== modified file 'tests/mir_test_framework/using_stub_client_platform.cpp'
1565--- tests/mir_test_framework/using_stub_client_platform.cpp 2014-01-28 18:21:14 +0000
1566+++ tests/mir_test_framework/using_stub_client_platform.cpp 2014-03-13 07:39:32 +0000
1567@@ -40,8 +40,17 @@
1568
1569 void mir_connection_release_override(MirConnection *connection)
1570 {
1571- auto wait_handle = connection->disconnect();
1572- wait_handle->wait_for_all();
1573+ try
1574+ {
1575+ auto wait_handle = connection->disconnect();
1576+ wait_handle->wait_for_all();
1577+ }
1578+ catch (std::exception const&)
1579+ {
1580+ // Really, we want try/finally, but that's not C++11
1581+ delete connection;
1582+ throw;
1583+ }
1584 delete connection;
1585 }
1586
1587
1588=== modified file 'tests/unit-tests/CMakeLists.txt'
1589--- tests/unit-tests/CMakeLists.txt 2014-03-06 06:05:17 +0000
1590+++ tests/unit-tests/CMakeLists.txt 2014-03-13 07:39:32 +0000
1591@@ -11,12 +11,9 @@
1592 test_asio_main_loop.cpp
1593 shared_library_test.cpp
1594 test_raii.cpp
1595+ test_udev_wrapper.cpp
1596 )
1597
1598-if (UMOCKDEV_REQUIRED)
1599- list(APPEND UNIT_TEST_SOURCES test_udev_wrapper.cpp)
1600-endif ()
1601-
1602 add_subdirectory(options/)
1603 add_subdirectory(client/)
1604 add_subdirectory(compositor/)
1605@@ -58,14 +55,12 @@
1606 ${GMOCK_LIBRARY}
1607 ${GMOCK_MAIN_LIBRARY}
1608 ${Boost_LIBRARIES}
1609+ ${UMOCKDEV_LIBRARIES}
1610 ${CMAKE_THREAD_LIBS_INIT} # Link in pthread.
1611 )
1612
1613-if (UMOCKDEV_REQUIRED)
1614- target_link_libraries(mir_unit_tests ${UMOCKDEV_LIBRARIES})
1615- # Umockdev uses glib, which uses the deprecated "register" allocation specifier
1616- set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Dregister=")
1617-endif ()
1618+# Umockdev uses glib, which uses the deprecated "register" allocation specifier
1619+set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Dregister=")
1620
1621 CMAKE_DEPENDENT_OPTION(
1622 MIR_RUN_UNIT_TESTS
1623@@ -75,11 +70,7 @@
1624 OFF)
1625
1626 if (MIR_RUN_UNIT_TESTS)
1627- if (UMOCKDEV_REQUIRED)
1628- mir_discover_tests(mir_unit_tests LD_PRELOAD=libumockdev-preload.so.0)
1629- else ()
1630- mir_discover_tests(mir_unit_tests)
1631- endif ()
1632+ mir_discover_tests(mir_unit_tests LD_PRELOAD=libumockdev-preload.so.0 G_SLICE=always-malloc G_DEBUG=gc-friendly)
1633 endif (MIR_RUN_UNIT_TESTS)
1634
1635 install(
1636
1637=== modified file 'tests/unit-tests/android_input/CMakeLists.txt'
1638--- tests/unit-tests/android_input/CMakeLists.txt 2014-03-06 06:05:17 +0000
1639+++ tests/unit-tests/android_input/CMakeLists.txt 2014-03-13 07:39:32 +0000
1640@@ -5,6 +5,7 @@
1641 ${CMAKE_CURRENT_SOURCE_DIR}/property_map.cpp
1642 ${CMAKE_CURRENT_SOURCE_DIR}/string8.cpp
1643 ${CMAKE_CURRENT_SOURCE_DIR}/sha1.cpp
1644+ ${CMAKE_CURRENT_SOURCE_DIR}/test_eventhub.cpp
1645 )
1646
1647 set(
1648
1649=== added file 'tests/unit-tests/android_input/test_eventhub.cpp'
1650--- tests/unit-tests/android_input/test_eventhub.cpp 1970-01-01 00:00:00 +0000
1651+++ tests/unit-tests/android_input/test_eventhub.cpp 2014-03-13 07:39:32 +0000
1652@@ -0,0 +1,125 @@
1653+/*
1654+ * Copyright © 2014 Canonical Ltd.
1655+ *
1656+ * This program is free software: you can redistribute it and/or modify
1657+ * it under the terms of the GNU General Public License version 3 as
1658+ * published by the Free Software Foundation.
1659+ *
1660+ * This program is distributed in the hope that it will be useful,
1661+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
1662+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
1663+ * GNU General Public License for more details.
1664+ *
1665+ * You should have received a copy of the GNU General Public License
1666+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
1667+ *
1668+ * Authored by: Christopher James Halse Rogers <christopher.halse.rogers@canonical.com>
1669+ */
1670+
1671+#include <EventHub.h>
1672+
1673+#include "src/server/report/null_report_factory.h"
1674+
1675+#include <umockdev.h>
1676+#include "mir_test_framework/udev_environment.h"
1677+
1678+#include <gtest/gtest.h>
1679+#include <gmock/gmock.h>
1680+
1681+namespace mi = mir::input;
1682+
1683+class EventHubDeviceEnumerationTest : public ::testing::TestWithParam<std::string>
1684+{
1685+ // Don't actually need any shared state at the moment
1686+};
1687+
1688+TEST_P(EventHubDeviceEnumerationTest, ScansOnConstruction)
1689+{
1690+ mir::mir_test_framework::UdevEnvironment env;
1691+ env.add_standard_device(GetParam());
1692+
1693+ auto hub = android::sp<android::EventHub>{new android::EventHub{mir::report::null_input_report()}};
1694+
1695+ android::RawEvent buffer[10];
1696+ memset(buffer, 0, sizeof(buffer));
1697+ auto num_events = hub->getEvents(0, buffer, 10);
1698+
1699+ EXPECT_EQ(static_cast<size_t>(3), num_events);
1700+ EXPECT_EQ(android::EventHub::DEVICE_ADDED, buffer[0].type);
1701+ EXPECT_EQ(android::VIRTUAL_KEYBOARD_ID, buffer[0].deviceId);
1702+ EXPECT_EQ(android::EventHub::DEVICE_ADDED, buffer[1].type);
1703+ EXPECT_EQ(1, buffer[1].deviceId);
1704+ EXPECT_EQ(android::EventHub::FINISHED_DEVICE_SCAN, buffer[2].type);
1705+}
1706+
1707+TEST_P(EventHubDeviceEnumerationTest, GeneratesDeviceAddedOnHotplug)
1708+{
1709+ mir::mir_test_framework::UdevEnvironment env;
1710+
1711+ auto hub = android::sp<android::EventHub>{new android::EventHub{mir::report::null_input_report()}};
1712+
1713+ android::RawEvent buffer[10];
1714+ memset(buffer, 0, sizeof(buffer));
1715+ auto num_events = hub->getEvents(0, buffer, 10);
1716+
1717+ EXPECT_EQ(static_cast<size_t>(2), num_events);
1718+ EXPECT_EQ(android::EventHub::DEVICE_ADDED, buffer[0].type);
1719+ EXPECT_EQ(android::VIRTUAL_KEYBOARD_ID, buffer[0].deviceId);
1720+ EXPECT_EQ(android::EventHub::FINISHED_DEVICE_SCAN, buffer[1].type);
1721+
1722+ env.add_standard_device(GetParam());
1723+
1724+ memset(buffer, 0, sizeof(buffer));
1725+ num_events = hub->getEvents(0, buffer, 10);
1726+
1727+ EXPECT_EQ(static_cast<size_t>(2), num_events);
1728+ EXPECT_EQ(android::EventHub::DEVICE_ADDED, buffer[0].type);
1729+ EXPECT_EQ(1, buffer[0].deviceId);
1730+ EXPECT_EQ(android::EventHub::FINISHED_DEVICE_SCAN, buffer[1].type);
1731+}
1732+
1733+TEST_P(EventHubDeviceEnumerationTest, GeneratesDeviceRemovedOnHotunplug)
1734+{
1735+ mir::mir_test_framework::UdevEnvironment env;
1736+ env.add_standard_device(GetParam());
1737+
1738+ auto hub = android::sp<android::EventHub>{new android::EventHub{mir::report::null_input_report()}};
1739+
1740+ android::RawEvent buffer[10];
1741+ // Flush out initial events.
1742+ auto num_events = hub->getEvents(0, buffer, 10);
1743+
1744+ mir::udev::Enumerator devices{std::make_shared<mir::udev::Context>()};
1745+ devices.scan_devices();
1746+
1747+ for (auto& device : devices)
1748+ {
1749+ /*
1750+ * Remove just the device providing dev/input/event*
1751+ * If we remove more, it's possible that we'll remove the parent of the
1752+ * /dev/input device, and umockdev will not generate a remove event
1753+ * in that case.
1754+ */
1755+ if (device.devnode() && (std::string(device.devnode()).find("input/event") != std::string::npos))
1756+ {
1757+ env.remove_device((std::string("/sys") + device.devpath()).c_str());
1758+ }
1759+ }
1760+
1761+ memset(buffer, 0, sizeof(buffer));
1762+ num_events = hub->getEvents(0, buffer, 10);
1763+
1764+ EXPECT_EQ(static_cast<size_t>(2), num_events);
1765+ EXPECT_EQ(android::EventHub::DEVICE_REMOVED, buffer[0].type);
1766+ EXPECT_EQ(1, buffer[0].deviceId);
1767+ EXPECT_EQ(android::EventHub::FINISHED_DEVICE_SCAN, buffer[1].type);
1768+
1769+}
1770+
1771+INSTANTIATE_TEST_CASE_P(VariousDevices,
1772+ EventHubDeviceEnumerationTest,
1773+ ::testing::Values(std::string("synaptics-touchpad"),
1774+ std::string("usb-keyboard"),
1775+ std::string("usb-mouse"),
1776+ std::string("laptop-keyboard"),
1777+ std::string("bluetooth-magic-trackpad")));
1778
1779=== modified file 'tests/unit-tests/client/test_mir_connection.cpp'
1780--- tests/unit-tests/client/test_mir_connection.cpp 2014-03-06 06:05:17 +0000
1781+++ tests/unit-tests/client/test_mir_connection.cpp 2014-03-13 07:39:32 +0000
1782@@ -540,6 +540,9 @@
1783 wait_handle = connection->release_surface(surface, &surface_callback, nullptr);
1784 wait_handle->wait_for_all();
1785
1786+ wait_handle = connection->disconnect();
1787+ wait_handle->wait_for_all();
1788+
1789 EXPECT_TRUE(unfocused_received);
1790 }
1791
1792@@ -575,6 +578,9 @@
1793 wait_handle = connection->release_surface(surface, &surface_callback, nullptr);
1794 wait_handle->wait_for_all();
1795
1796+ wait_handle = connection->disconnect();
1797+ wait_handle->wait_for_all();
1798+
1799 EXPECT_FALSE(unfocused_received);
1800 }
1801
1802
1803=== modified file 'tests/unit-tests/input/android/test_android_input_window_handle.cpp'
1804--- tests/unit-tests/input/android/test_android_input_window_handle.cpp 2014-03-06 06:05:17 +0000
1805+++ tests/unit-tests/input/android/test_android_input_window_handle.cpp 2014-03-13 07:39:32 +0000
1806@@ -26,6 +26,8 @@
1807 #include "mir_test_doubles/mock_input_surface.h"
1808 #include "mir_test_doubles/stub_surface_builder.h"
1809
1810+#include "mir/raii.h"
1811+
1812 #include <cstdlib>
1813 #include <cstring>
1814
1815@@ -64,12 +66,21 @@
1816 geom::Point const default_surface_top_left = geom::Point{geom::X{10}, geom::Y{10}};
1817 std::string const testing_surface_name = "Test";
1818
1819- // We need a real open fd, as InputWindowHandle's constructor will fcntl() it, and
1820- // InputWindowHandle's destructor will close() it.
1821- char *filename = strdup("/tmp/mir_unit_test_XXXXXX");
1822- int const testing_server_fd = mkstemp(filename);
1823- // We don't actually need the file to exist after this test.
1824- unlink(filename);
1825+ int testing_server_fd;
1826+ auto fd_wrapper = mir::raii::paired_calls([&testing_server_fd]()
1827+ {
1828+ // We need a real open fd, as InputWindowHandle's constructor will fcntl() it, and
1829+ // InputWindowHandle's destructor will close() it.
1830+ char *filename = strdup("/tmp/mir_unit_test_XXXXXX");
1831+ testing_server_fd = mkstemp(filename);
1832+ // We don't actually need the file to exist after this test.
1833+ unlink(filename);
1834+ free(filename);
1835+ },
1836+ [&testing_server_fd]()
1837+ {
1838+ if (testing_server_fd > 0) close(testing_server_fd);
1839+ });
1840
1841 MockInputChannel mock_channel;
1842 mtd::MockInputSurface mock_surface;
1843@@ -108,6 +119,4 @@
1844 EXPECT_EQ(info->frameTop, info->touchableRegionTop);
1845 EXPECT_EQ(info->frameRight, info->touchableRegionRight);
1846 EXPECT_EQ(info->frameBottom, info->touchableRegionBottom);
1847-
1848- free(filename);
1849 }
1850
1851=== modified file 'tools/valgrind_suppressions_armhf'
1852--- tools/valgrind_suppressions_armhf 2014-03-06 06:05:17 +0000
1853+++ tools/valgrind_suppressions_armhf 2014-03-13 07:39:32 +0000
1854@@ -27,6 +27,13 @@
1855 obj:/lib/arm-linux-gnueabihf/ld-2.*.so
1856 }
1857
1858+{
1859+ ld_stat64
1860+ Memcheck:Param
1861+ stat64(file_name)
1862+ obj:/lib/arm-linux-gnueabihf/ld-2.*.so
1863+}
1864+
1865 # Android libs
1866
1867 {
1868@@ -98,6 +105,14 @@
1869 ...
1870 }
1871
1872+{
1873+ dlopen_cond
1874+ Memcheck:Cond
1875+ fun:calloc
1876+ fun:_dl_new_object
1877+ ...
1878+}
1879+
1880 # mir::SharedLibrary
1881 # Valgrind thinks that dlopen returns an uninitialized
1882 # value, so all checks using that value cause spurious
1883@@ -109,3 +124,18 @@
1884 fun:_ZN3mir13SharedLibraryC1EPKc
1885 ...
1886 }
1887+
1888+# glib is not valgrind-friendly
1889+
1890+{
1891+ glib_create_type_instance
1892+ Memcheck:Addr4
1893+ fun:g_type_create_instance
1894+}
1895+
1896+{
1897+ glib_slice_alloc0
1898+ Memcheck:Addr4
1899+ fun:memset
1900+ fun:g_slice_alloc0
1901+}
1902
1903=== added file 'tools/valgrind_suppressions_generic'
1904--- tools/valgrind_suppressions_generic 1970-01-01 00:00:00 +0000
1905+++ tools/valgrind_suppressions_generic 2014-03-13 07:39:32 +0000
1906@@ -0,0 +1,7 @@
1907+{
1908+ Supress incorrect unaddressable memory warning about EVIOCSSUSPENDBLOCK ioctl
1909+ Memcheck:Param
1910+ ioctl(generic)
1911+ fun:ioctl
1912+ fun:ioctl
1913+}

Subscribers

People subscribed via source and target branches