Merge ~sylvain-pineau/checkbox-support:fix-pidvid-wireless-without-iface into checkbox-support:master

Proposed by Sylvain Pineau
Status: Merged
Approved by: Sylvain Pineau
Approved revision: ecd83a126a471dc3cb5faa20ac17d2c2fab646f1
Merged at revision: c363ae1ab199320ca003acf768dea218ce177742
Proposed branch: ~sylvain-pineau/checkbox-support:fix-pidvid-wireless-without-iface
Merge into: checkbox-support:master
Diff against target: 26 lines (+3/-1)
2 files modified
checkbox_support/parsers/tests/test_udevadm.py (+1/-1)
checkbox_support/parsers/udevadm.py (+2/-0)
Reviewer Review Type Date Requested Status
Sylvain Pineau (community) Approve
Review via email: mp+321447@code.launchpad.net

Description of the change

Fix the udev parser to properly report product/vendor ids when there's no interfaces for wireless devices. In that case the parser erroneously gave parent ids to the device (often pci root hub)

To post a comment you must log in.
Revision history for this message
Sylvain Pineau (sylvain-pineau) wrote :

tested on systems with two wifi devices

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1diff --git a/checkbox_support/parsers/tests/test_udevadm.py b/checkbox_support/parsers/tests/test_udevadm.py
2index cc06e4a..4764aa2 100644
3--- a/checkbox_support/parsers/tests/test_udevadm.py
4+++ b/checkbox_support/parsers/tests/test_udevadm.py
5@@ -378,7 +378,7 @@ E: UDEV_LOG=3
6
7 def test_TOSHIBA_NVME(self):
8 devices = self.parse("TOSHIBA_NVME")
9- self.assertEqual(len(devices), 127)
10+ self.assertEqual(len(devices), 128)
11 self.assertEqual(self.count(devices, "VIDEO"), 2)
12 self.assertEqual(self.count(devices, "AUDIO"), 2)
13 self.assertEqual(self.count(devices, "KEYBOARD"), 1)
14diff --git a/checkbox_support/parsers/udevadm.py b/checkbox_support/parsers/udevadm.py
15index 46e26ac..3954252 100644
16--- a/checkbox_support/parsers/udevadm.py
17+++ b/checkbox_support/parsers/udevadm.py
18@@ -1076,6 +1076,8 @@ class UdevadmParser(object):
19 ]
20 if dev_interface:
21 dev_interface = dev_interface.pop()
22+ if dev_interface.interface == 'UNKNOWN':
23+ continue
24 dev_interface.bus = device.bus
25 dev_interface.product_id = device.product_id
26 dev_interface.vendor_id = device.vendor_id

Subscribers

People subscribed via source and target branches