summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rwxr-xr-xsrc/linux/integration-test.py22
-rw-r--r--src/linux/tests/usb-headset.device327
2 files changed, 349 insertions, 0 deletions
diff --git a/src/linux/integration-test.py b/src/linux/integration-test.py
index e0f9ad7..7b50827 100755
--- a/src/linux/integration-test.py
+++ b/src/linux/integration-test.py
@@ -2409,6 +2409,28 @@ class Tests(dbusmock.DBusTestCase):
}
})
+ def test_headset_detection(self):
+ 'Detect USB wireless headsets and other audio devices'
+
+ self.testbed.add_from_file(os.path.join(edir, 'tests/usb-headset.device'))
+ self.start_daemon()
+
+ self.assertDevs({
+ 'battery_hidpp_battery_0': {
+ 'NativePath': 'hidpp_battery_0',
+ 'Model': 'G935 Gaming Headset',
+ 'Type': UP_DEVICE_KIND_HEADSET,
+ 'PowerSupply': False,
+ 'HasHistory': True,
+ 'Percentage': 3.0,
+ 'IsPresent': True,
+ 'State': UP_DEVICE_STATE_DISCHARGING,
+ 'IsRechargeable': True,
+ }
+ })
+
+ self.stop_daemon()
+
def test_remove(self):
'Test removing when parent ID lookup stops working'
diff --git a/src/linux/tests/usb-headset.device b/src/linux/tests/usb-headset.device
new file mode 100644
index 0000000..2ee1df8
--- /dev/null
+++ b/src/linux/tests/usb-headset.device
@@ -0,0 +1,327 @@
+P: /devices/pci0000:00/0000:00:14.0/usb1/1-8
+E: DEVPATH=/devices/pci0000:00/0000:00:14.0/usb1/1-8
+E: SUBSYSTEM=usb
+E: DEVNAME=/dev/bus/usb/001/005
+E: DEVTYPE=usb_device
+E: DRIVER=usb
+E: PRODUCT=46d/a87/112
+E: TYPE=0/0/0
+E: BUSNUM=001
+E: DEVNUM=005
+E: MAJOR=189
+E: MINOR=4
+E: USEC_INITIALIZED=11086369
+E: ID_BUS=usb
+E: ID_MODEL=G935_Gaming_Headset
+E: ID_MODEL_ENC=G935\x20Gaming\x20Headset
+E: ID_MODEL_ID=0a87
+E: ID_SERIAL=Logitech_G935_Gaming_Headset
+E: ID_VENDOR=Logitech
+E: ID_VENDOR_ENC=Logitech
+E: ID_VENDOR_ID=046d
+E: ID_REVISION=0112
+E: ID_USB_MODEL=G935_Gaming_Headset
+E: ID_USB_MODEL_ENC=G935\x20Gaming\x20Headset
+E: ID_USB_MODEL_ID=0a87
+E: ID_USB_SERIAL=Logitech_G935_Gaming_Headset
+E: ID_USB_VENDOR=Logitech
+E: ID_USB_VENDOR_ENC=Logitech
+E: ID_USB_VENDOR_ID=046d
+E: ID_USB_REVISION=0112
+E: ID_USB_INTERFACES=:010100:010200:030000:
+E: ID_VENDOR_FROM_DATABASE=Logitech, Inc.
+E: ID_PATH=pci-0000:00:14.0-usb-0:8
+E: ID_PATH_TAG=pci-0000_00_14_0-usb-0_8
+E: ID_FOR_SEAT=usb-pci-0000_00_14_0-usb-0_8
+E: TAGS=:seat:
+E: CURRENT_TAGS=:seat:
+
+P: /devices/pci0000:00/0000:00:14.0/usb1/1-8/1-8:1.0
+E: DEVPATH=/devices/pci0000:00/0000:00:14.0/usb1/1-8/1-8:1.0
+E: SUBSYSTEM=usb
+E: DEVTYPE=usb_interface
+E: DRIVER=snd-usb-audio
+E: PRODUCT=46d/a87/112
+E: TYPE=0/0/0
+E: INTERFACE=1/1/0
+E: MODALIAS=usb:v046Dp0A87d0112dc00dsc00dp00ic01isc01ip00in00
+E: USEC_INITIALIZED=11136922
+E: ID_VENDOR_FROM_DATABASE=Logitech, Inc.
+
+P: /devices/pci0000:00/0000:00:14.0/usb1/1-8/1-8:1.0/sound/card0
+E: DEVPATH=/devices/pci0000:00/0000:00:14.0/usb1/1-8/1-8:1.0/sound/card0
+E: SUBSYSTEM=sound
+E: USEC_INITIALIZED=11967897
+E: NVME_HOST_IFACE=none
+E: ID_PATH=pci-0000:00:14.0-usb-0:8:1.0
+E: ID_PATH_TAG=pci-0000_00_14_0-usb-0_8_1_0
+E: ID_FOR_SEAT=sound-pci-0000_00_14_0-usb-0_8_1_0
+E: SOUND_INITIALIZED=1
+E: ID_VENDOR_FROM_DATABASE=Logitech, Inc.
+E: ID_BUS=usb
+E: ID_MODEL=G935_Gaming_Headset
+E: ID_MODEL_ENC=G935\x20Gaming\x20Headset
+E: ID_MODEL_ID=0a87
+E: ID_SERIAL=Logitech_G935_Gaming_Headset
+E: ID_VENDOR=Logitech
+E: ID_VENDOR_ENC=Logitech
+E: ID_VENDOR_ID=046d
+E: ID_REVISION=0112
+E: ID_TYPE=audio
+E: ID_USB_MODEL=G935_Gaming_Headset
+E: ID_USB_MODEL_ENC=G935\x20Gaming\x20Headset
+E: ID_USB_MODEL_ID=0a87
+E: ID_USB_SERIAL=Logitech_G935_Gaming_Headset
+E: ID_USB_VENDOR=Logitech
+E: ID_USB_VENDOR_ENC=Logitech
+E: ID_USB_VENDOR_ID=046d
+E: ID_USB_REVISION=0112
+E: ID_USB_TYPE=audio
+E: ID_USB_INTERFACES=:010100:010200:030000:
+E: ID_USB_INTERFACE_NUM=00
+E: ID_USB_DRIVER=snd-usb-audio
+E: ID_ID=usb-Logitech_G935_Gaming_Headset-00
+E: SOUND_FORM_FACTOR=headset
+E: TAGS=:seat:
+E: CURRENT_TAGS=:seat:
+
+P: /devices/pci0000:00/0000:00:14.0/usb1/1-8/1-8:1.0/sound/card0/controlC0
+S: snd/by-id/usb-Logitech_G935_Gaming_Headset-00
+S: snd/by-path/pci-0000:00:14.0-usb-0:8:1.0
+E: DEVPATH=/devices/pci0000:00/0000:00:14.0/usb1/1-8/1-8:1.0/sound/card0/controlC0
+E: SUBSYSTEM=sound
+E: DEVNAME=/dev/snd/controlC0
+E: MAJOR=116
+E: MINOR=4
+E: USEC_INITIALIZED=11978600
+E: ID_BUS=usb
+E: ID_MODEL=G935_Gaming_Headset
+E: ID_MODEL_ENC=G935\x20Gaming\x20Headset
+E: ID_MODEL_ID=0a87
+E: ID_SERIAL=Logitech_G935_Gaming_Headset
+E: ID_VENDOR=Logitech
+E: ID_VENDOR_ENC=Logitech
+E: ID_VENDOR_ID=046d
+E: ID_REVISION=0112
+E: ID_TYPE=audio
+E: ID_USB_MODEL=G935_Gaming_Headset
+E: ID_USB_MODEL_ENC=G935\x20Gaming\x20Headset
+E: ID_USB_MODEL_ID=0a87
+E: ID_USB_SERIAL=Logitech_G935_Gaming_Headset
+E: ID_USB_VENDOR=Logitech
+E: ID_USB_VENDOR_ENC=Logitech
+E: ID_USB_VENDOR_ID=046d
+E: ID_USB_REVISION=0112
+E: ID_USB_TYPE=audio
+E: ID_USB_INTERFACES=:010100:010200:030000:
+E: ID_USB_INTERFACE_NUM=00
+E: ID_USB_DRIVER=snd-usb-audio
+E: ID_PATH=pci-0000:00:14.0-usb-0:8:1.0
+E: ID_PATH_TAG=pci-0000_00_14_0-usb-0_8_1_0
+E: SYSTEMD_WANTS=sound.target
+E: SYSTEMD_USER_WANTS=sound.target
+E: DEVLINKS=/dev/snd/by-id/usb-Logitech_G935_Gaming_Headset-00 /dev/snd/by-path/pci-0000:00:14.0-usb-0:8:1.0
+E: TAGS=:systemd:uaccess:
+E: CURRENT_TAGS=:systemd:uaccess:
+
+P: /devices/pci0000:00/0000:00:14.0/usb1/1-8/1-8:1.0/sound/card0/pcmC0D0c
+E: DEVPATH=/devices/pci0000:00/0000:00:14.0/usb1/1-8/1-8:1.0/sound/card0/pcmC0D0c
+E: SUBSYSTEM=sound
+E: DEVNAME=/dev/snd/pcmC0D0c
+E: DEVTYPE=pcm
+E: MAJOR=116
+E: MINOR=3
+E: USEC_INITIALIZED=11976269
+E: TAGS=:uaccess:
+E: CURRENT_TAGS=:uaccess:
+
+P: /devices/pci0000:00/0000:00:14.0/usb1/1-8/1-8:1.0/sound/card0/pcmC0D0p
+E: DEVPATH=/devices/pci0000:00/0000:00:14.0/usb1/1-8/1-8:1.0/sound/card0/pcmC0D0p
+E: SUBSYSTEM=sound
+E: DEVNAME=/dev/snd/pcmC0D0p
+E: DEVTYPE=pcm
+E: MAJOR=116
+E: MINOR=2
+E: USEC_INITIALIZED=11973216
+E: TAGS=:uaccess:
+E: CURRENT_TAGS=:uaccess:
+
+P: /devices/pci0000:00/0000:00:14.0/usb1/1-8/1-8:1.1
+E: DEVPATH=/devices/pci0000:00/0000:00:14.0/usb1/1-8/1-8:1.1
+E: SUBSYSTEM=usb
+E: DEVTYPE=usb_interface
+E: DRIVER=snd-usb-audio
+E: PRODUCT=46d/a87/112
+E: TYPE=0/0/0
+E: INTERFACE=1/2/0
+E: MODALIAS=usb:v046Dp0A87d0112dc00dsc00dp00ic01isc02ip00in01
+E: USEC_INITIALIZED=11141119
+E: ID_VENDOR_FROM_DATABASE=Logitech, Inc.
+
+P: /devices/pci0000:00/0000:00:14.0/usb1/1-8/1-8:1.2
+E: DEVPATH=/devices/pci0000:00/0000:00:14.0/usb1/1-8/1-8:1.2
+E: SUBSYSTEM=usb
+E: DEVTYPE=usb_interface
+E: DRIVER=snd-usb-audio
+E: PRODUCT=46d/a87/112
+E: TYPE=0/0/0
+E: INTERFACE=1/2/0
+E: MODALIAS=usb:v046Dp0A87d0112dc00dsc00dp00ic01isc02ip00in02
+E: USEC_INITIALIZED=11144379
+E: ID_VENDOR_FROM_DATABASE=Logitech, Inc.
+
+P: /devices/pci0000:00/0000:00:14.0/usb1/1-8/1-8:1.3
+E: DEVPATH=/devices/pci0000:00/0000:00:14.0/usb1/1-8/1-8:1.3
+E: SUBSYSTEM=usb
+E: DEVTYPE=usb_interface
+E: DRIVER=usbhid
+E: PRODUCT=46d/a87/112
+E: TYPE=0/0/0
+E: INTERFACE=3/0/0
+E: MODALIAS=usb:v046Dp0A87d0112dc00dsc00dp00ic03isc00ip00in03
+E: USEC_INITIALIZED=11125344
+E: ID_VENDOR_FROM_DATABASE=Logitech, Inc.
+E: NVME_HOST_IFACE=none
+
+P: /devices/pci0000:00/0000:00:14.0/usb1/1-8/1-8:1.3/0003:046D:0A87.0004
+E: DEVPATH=/devices/pci0000:00/0000:00:14.0/usb1/1-8/1-8:1.3/0003:046D:0A87.0004
+E: SUBSYSTEM=hid
+E: DRIVER=logitech-hidpp-device
+E: HID_ID=0003:0000046D:00000A87
+E: HID_NAME=Logitech G935 Gaming Headset
+E: HID_PHYS=usb-0000:00:14.0-8/input3
+E: HID_UNIQ=
+E: MODALIAS=hid:b0003g0001v0000046Dp00000A87
+
+P: /devices/pci0000:00/0000:00:14.0/usb1/1-8/1-8:1.3/0003:046D:0A87.0004/hidraw/hidraw3
+E: DEVPATH=/devices/pci0000:00/0000:00:14.0/usb1/1-8/1-8:1.3/0003:046D:0A87.0004/hidraw/hidraw3
+E: SUBSYSTEM=hidraw
+E: DEVNAME=/dev/hidraw3
+E: MAJOR=243
+E: MINOR=3
+E: USEC_INITIALIZED=11206489
+E: ID_PATH=pci-0000:00:14.0-usb-0:8:1.3
+E: ID_PATH_TAG=pci-0000_00_14_0-usb-0_8_1_3
+E: ID_FOR_SEAT=hidraw-pci-0000_00_14_0-usb-0_8_1_3
+E: TAGS=:uaccess:seat:
+E: CURRENT_TAGS=:uaccess:seat:
+
+P: /devices/pci0000:00/0000:00:14.0/usb1/1-8/1-8:1.3/0003:046D:0A87.0004/input/input12
+E: DEVPATH=/devices/pci0000:00/0000:00:14.0/usb1/1-8/1-8:1.3/0003:046D:0A87.0004/input/input12
+E: SUBSYSTEM=input
+E: PRODUCT=3/46d/a87/111
+E: NAME="Logitech G935 Gaming Headset"
+E: PHYS="usb-0000:00:14.0-8/input3"
+E: UNIQ=""
+E: PROP=0
+E: EV=1b
+E: KEY=100000000000000 0 c000000000000 0
+E: ABS=10000000000
+E: MSC=10
+E: MODALIAS=input:b0003v046Dp0A87e0111-e0,1,3,4,k72,73,F8,ra28,m4,lsfw
+E: USEC_INITIALIZED=11174082
+E: ID_INPUT=1
+E: ID_INPUT_KEY=1
+E: ID_BUS=usb
+E: ID_MODEL=G935_Gaming_Headset
+E: ID_MODEL_ENC=G935\x20Gaming\x20Headset
+E: ID_MODEL_ID=0a87
+E: ID_SERIAL=Logitech_G935_Gaming_Headset
+E: ID_VENDOR=Logitech
+E: ID_VENDOR_ENC=Logitech
+E: ID_VENDOR_ID=046d
+E: ID_REVISION=0112
+E: ID_TYPE=hid
+E: ID_USB_MODEL=G935_Gaming_Headset
+E: ID_USB_MODEL_ENC=G935\x20Gaming\x20Headset
+E: ID_USB_MODEL_ID=0a87
+E: ID_USB_SERIAL=Logitech_G935_Gaming_Headset
+E: ID_USB_VENDOR=Logitech
+E: ID_USB_VENDOR_ENC=Logitech
+E: ID_USB_VENDOR_ID=046d
+E: ID_USB_REVISION=0112
+E: ID_USB_TYPE=hid
+E: ID_USB_INTERFACES=:010100:010200:030000:
+E: ID_USB_INTERFACE_NUM=03
+E: ID_USB_DRIVER=usbhid
+E: ID_PATH=pci-0000:00:14.0-usb-0:8:1.3
+E: ID_PATH_TAG=pci-0000_00_14_0-usb-0_8_1_3
+E: ID_FOR_SEAT=input-pci-0000_00_14_0-usb-0_8_1_3
+E: TAGS=:seat:
+E: CURRENT_TAGS=:seat:
+
+P: /devices/pci0000:00/0000:00:14.0/usb1/1-8/1-8:1.3/0003:046D:0A87.0004/input/input12/event7
+S: input/by-path/pci-0000:00:14.0-usb-0:8:1.3-event
+S: input/by-id/usb-Logitech_G935_Gaming_Headset-event-if03
+E: DEVPATH=/devices/pci0000:00/0000:00:14.0/usb1/1-8/1-8:1.3/0003:046D:0A87.0004/input/input12/event7
+E: SUBSYSTEM=input
+E: DEVNAME=/dev/input/event7
+E: MAJOR=13
+E: MINOR=71
+E: USEC_INITIALIZED=11421774
+E: ID_INPUT=1
+E: ID_INPUT_KEY=1
+E: ID_BUS=usb
+E: ID_MODEL=G935_Gaming_Headset
+E: ID_MODEL_ENC=G935\x20Gaming\x20Headset
+E: ID_MODEL_ID=0a87
+E: ID_SERIAL=Logitech_G935_Gaming_Headset
+E: ID_VENDOR=Logitech
+E: ID_VENDOR_ENC=Logitech
+E: ID_VENDOR_ID=046d
+E: ID_REVISION=0112
+E: ID_TYPE=hid
+E: ID_USB_MODEL=G935_Gaming_Headset
+E: ID_USB_MODEL_ENC=G935\x20Gaming\x20Headset
+E: ID_USB_MODEL_ID=0a87
+E: ID_USB_SERIAL=Logitech_G935_Gaming_Headset
+E: ID_USB_VENDOR=Logitech
+E: ID_USB_VENDOR_ENC=Logitech
+E: ID_USB_VENDOR_ID=046d
+E: ID_USB_REVISION=0112
+E: ID_USB_TYPE=hid
+E: ID_USB_INTERFACES=:010100:010200:030000:
+E: ID_USB_INTERFACE_NUM=03
+E: ID_USB_DRIVER=usbhid
+E: ID_PATH=pci-0000:00:14.0-usb-0:8:1.3
+E: ID_PATH_TAG=pci-0000_00_14_0-usb-0_8_1_3
+E: LIBINPUT_DEVICE_GROUP=3/46d/a87:usb-0000:00:14.0-8
+E: DEVLINKS=/dev/input/by-path/pci-0000:00:14.0-usb-0:8:1.3-event /dev/input/by-id/usb-Logitech_G935_Gaming_Headset-event-if03
+E: TAGS=:power-switch:
+E: CURRENT_TAGS=:power-switch:
+
+P: /devices/pci0000:00/0000:00:14.0/usb1/1-8/1-8:1.3/0003:046D:0A87.0004/power_supply/hidpp_battery_0
+E: DEVPATH=/devices/pci0000:00/0000:00:14.0/usb1/1-8/1-8:1.3/0003:046D:0A87.0004/power_supply/hidpp_battery_0
+E: SUBSYSTEM=power_supply
+E: POWER_SUPPLY_NAME=hidpp_battery_0
+E: POWER_SUPPLY_TYPE=Battery
+E: POWER_SUPPLY_ONLINE=1
+E: POWER_SUPPLY_STATUS=Discharging
+E: POWER_SUPPLY_SCOPE=Device
+E: POWER_SUPPLY_MODEL_NAME=G935 Gaming Headset
+E: POWER_SUPPLY_MANUFACTURER=Logitech
+E: POWER_SUPPLY_SERIAL_NUMBER=
+E: POWER_SUPPLY_CAPACITY=3
+E: POWER_SUPPLY_VOLTAGE_NOW=3468000
+E: USEC_INITIALIZED=49310511
+E: NVME_HOST_IFACE=none
+A: type=Battery\n
+A: model_name=G935 Gaming Headset\n
+A: status=Discharging\n
+A: scope=Device\n
+A: capacity=3\n
+
+P: /devices/pci0000:00/0000:00:14.0/usb1/1-8/1-8:1.3/0003:046D:0A87.0004/power_supply/hidpp_battery_0/hwmon1
+E: DEVPATH=/devices/pci0000:00/0000:00:14.0/usb1/1-8/1-8:1.3/0003:046D:0A87.0004/power_supply/hidpp_battery_0/hwmon1
+E: SUBSYSTEM=hwmon
+
+P: /devices/pci0000:00/0000:00:14.0/usb1/1-8/1-8:1.3/0003:046D:0A87.0004/power_supply/hidpp_battery_0/wakeup25
+E: DEVPATH=/devices/pci0000:00/0000:00:14.0/usb1/1-8/1-8:1.3/0003:046D:0A87.0004/power_supply/hidpp_battery_0/wakeup25
+E: SUBSYSTEM=wakeup
+
+P: /devices/pci0000:00/0000:00:14.0/usb1/1-8/1-8:1.3/usbmisc/hiddev2
+E: DEVPATH=/devices/pci0000:00/0000:00:14.0/usb1/1-8/1-8:1.3/usbmisc/hiddev2
+E: SUBSYSTEM=usbmisc
+E: DEVNAME=/dev/usb/hiddev2
+E: MAJOR=180
+E: MINOR=98