Skip to content

Commit

Permalink
tests: fix test for mouse+keyboard devices
Browse files Browse the repository at this point in the history
On fc23-based dom0 a single mouse+keyboard device is listed as two
devices (one in "pointer" section, other as "keyboard"). This confuses
'xinput list', so add explicit request for device type.

QubesOS/qubes-issues#1618
  • Loading branch information
marmarek committed Jun 20, 2016
1 parent 8fd2269 commit 9e4acc2
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion qubesinputproxy/tests.py
Expand Up @@ -178,6 +178,9 @@ def find_device_and_start_listener(self, expected_name=None):
self.assertIsNotNone(device_id,
"Devive '{}' not found".format(expected_name))

# terminate old listener if there was one
if hasattr(self, 'event_listener'):
self.event_listener.terminate()
self.event_listener = subprocess.Popen(
['xinput', 'test-xi2', '--root', device_id],
stdout=subprocess.PIPE)
Expand Down Expand Up @@ -261,7 +264,8 @@ def test_040_mouse_keyboard(self):
self.qrexec_policy('qubes.InputMouse', self.vm.name, 'dom0')
self.qrexec_policy('qubes.InputKeyboard', self.vm.name, 'dom0')
self.setUpDevice(mouse_events + keyboard_events)
self.find_device_and_start_listener()
self.find_device_and_start_listener(
'pointer:{}: {}'.format(self.vm.name, 'Test input device'))
self.emit_event('REL_X', 1)
self.emit_event('REL_X', 1)
self.emit_event('REL_Y', 1)
Expand All @@ -275,6 +279,9 @@ def test_040_mouse_keyboard(self):
self.assertEvent(['RawButtonPress', '1', {}])
self.assertEvent(['RawButtonRelease', '1', {}])

self.find_device_and_start_listener(
'keyboard:{}: {}'.format(self.vm.name, 'Test input device'))

self.emit_click('KEY_A')
self.emit_click('KEY_B')
self.emit_click('KEY_C')
Expand Down

0 comments on commit 9e4acc2

Please sign in to comment.