From e8e20ac64a6476612300136dab1184e5811f7ea3 Mon Sep 17 00:00:00 2001 From: Bastien Nocera Date: Tue, 24 Jan 2017 14:14:36 +0100 Subject: [PATCH] linux: Parent Bluetooth mouse test devices properly --- src/linux/integration-test | 45 ++++++++++++++++++++++++++++---------- 1 file changed, 34 insertions(+), 11 deletions(-) diff --git a/src/linux/integration-test b/src/linux/integration-test index 8388793..fe84233 100755 --- a/src/linux/integration-test +++ b/src/linux/integration-test @@ -767,21 +767,31 @@ class Tests(unittest.TestCase): def test_bluetooth_hid_mouse(self): '''bluetooth HID mouse battery''' - self.testbed.add_device('hid', - 'usb1/bluetooth/hci0/hci0:01', - None, - [], []) - - self.testbed.add_device( - 'input', - 'usb1/bluetooth/hci0/hci0:01/input/input2/mouse3', + dev = self.testbed.add_device( + 'bluetooth', + '/devices/pci0000:00/0000:00:14.0/usb2/2-7/2-7:1.0/bluetooth/hci0', None, - [], ['DEVNAME', 'input/mouse3', 'ID_INPUT_MOUSE', '1']) + [], []) + parent = dev + dev = self.testbed.add_device( + 'bluetooth', + 'hci0:256', + parent, + [], ['DEVTYPE', 'link']) + + parent = dev + dev = self.testbed.add_device( + 'hid', + '0005:046D:B00D.0002', + parent, + [], ['HID_NAME', 'Fancy BT Mouse']) + + parent = dev self.testbed.add_device( 'power_supply', - 'usb1/bluetooth/hci0/hci0:01/1/power_supply/hid-00:11:22:33:44:55-battery', - None, + 'power_supply/hid-00:1f:20:96:33:47-battery', + parent, ['type', 'Battery', 'scope', 'Device', 'present', '1', @@ -791,6 +801,19 @@ class Tests(unittest.TestCase): 'model_name', 'Fancy BT mouse'], []) + dev = self.testbed.add_device( + 'input', + 'input/input22', + parent, + [], ['ID_INPUT_MOUSE', '1']) + + parent = dev + self.testbed.add_device( + 'input', + 'mouse1', + parent, + [], ['ID_INPUT_MOUSE', '1']) + self.start_daemon() devs = self.proxy.EnumerateDevices() self.assertEqual(len(devs), 1)