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
diff --git a/checkbox_support/parsers/tests/test_udevadm.py b/checkbox_support/parsers/tests/test_udevadm.py
index cc06e4a..4764aa2 100644
--- a/checkbox_support/parsers/tests/test_udevadm.py
+++ b/checkbox_support/parsers/tests/test_udevadm.py
@@ -378,7 +378,7 @@ E: UDEV_LOG=3
378378
379 def test_TOSHIBA_NVME(self):379 def test_TOSHIBA_NVME(self):
380 devices = self.parse("TOSHIBA_NVME")380 devices = self.parse("TOSHIBA_NVME")
381 self.assertEqual(len(devices), 127)381 self.assertEqual(len(devices), 128)
382 self.assertEqual(self.count(devices, "VIDEO"), 2)382 self.assertEqual(self.count(devices, "VIDEO"), 2)
383 self.assertEqual(self.count(devices, "AUDIO"), 2)383 self.assertEqual(self.count(devices, "AUDIO"), 2)
384 self.assertEqual(self.count(devices, "KEYBOARD"), 1)384 self.assertEqual(self.count(devices, "KEYBOARD"), 1)
diff --git a/checkbox_support/parsers/udevadm.py b/checkbox_support/parsers/udevadm.py
index 46e26ac..3954252 100644
--- a/checkbox_support/parsers/udevadm.py
+++ b/checkbox_support/parsers/udevadm.py
@@ -1076,6 +1076,8 @@ class UdevadmParser(object):
1076 ]1076 ]
1077 if dev_interface:1077 if dev_interface:
1078 dev_interface = dev_interface.pop()1078 dev_interface = dev_interface.pop()
1079 if dev_interface.interface == 'UNKNOWN':
1080 continue
1079 dev_interface.bus = device.bus1081 dev_interface.bus = device.bus
1080 dev_interface.product_id = device.product_id1082 dev_interface.product_id = device.product_id
1081 dev_interface.vendor_id = device.vendor_id1083 dev_interface.vendor_id = device.vendor_id

Subscribers

People subscribed via source and target branches