Merge ~sylvain-pineau/checkbox-support:smo8800 into checkbox-support:master

Proposed by Sylvain Pineau
Status: Merged
Approved by: Sylvain Pineau
Approved revision: a634b8861ce9fb2b2316ba0d44fffaa901ab3b42
Merged at revision: ceb14496ba0ad36391365687999420045efb5e64
Proposed branch: ~sylvain-pineau/checkbox-support:smo8800
Merge into: checkbox-support:master
Diff against target: 33 lines (+4/-0)
2 files modified
checkbox_support/parsers/tests/test_udevadm.py (+2/-0)
checkbox_support/parsers/udevadm.py (+2/-0)
Reviewer Review Type Date Requested Status
Sylvain Pineau Approve
Review via email: mp+326989@code.launchpad.net

Description of the change

Improve ACCELEROMETER auto detection by reporting device with smo8800 driver as ACCELEROMETERs.

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

tested with the udevadm input Sam gave me (http://pastebin.ubuntu.com/25037927/)

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 d5c5e02..4fa8ac8 100644
--- a/checkbox_support/parsers/tests/test_udevadm.py
+++ b/checkbox_support/parsers/tests/test_udevadm.py
@@ -375,6 +375,7 @@ E: UDEV_LOG=3
375 self.assertEqual(self.count(devices, "WIRELESS"), 1)375 self.assertEqual(self.count(devices, "WIRELESS"), 1)
376 self.assertEqual(self.count(devices, "DISK"), 2)376 self.assertEqual(self.count(devices, "DISK"), 2)
377 self.assertEqual(self.count(devices, "NETWORK"), 1)377 self.assertEqual(self.count(devices, "NETWORK"), 1)
378 self.assertEqual(self.count(devices, "ACCELEROMETER"), 1)
378379
379 def test_TOSHIBA_NVME(self):380 def test_TOSHIBA_NVME(self):
380 devices = self.parse("TOSHIBA_NVME")381 devices = self.parse("TOSHIBA_NVME")
@@ -390,6 +391,7 @@ E: UDEV_LOG=3
390 self.assertEqual(self.count(devices, "WIRELESS"), 2)391 self.assertEqual(self.count(devices, "WIRELESS"), 2)
391 self.assertEqual(self.count(devices, "DISK"), 1)392 self.assertEqual(self.count(devices, "DISK"), 1)
392 self.assertEqual(self.count(devices, "NETWORK"), 1)393 self.assertEqual(self.count(devices, "NETWORK"), 1)
394 self.assertEqual(self.count(devices, "ACCELEROMETER"), 1)
393395
394 def test_HOME_MADE(self):396 def test_HOME_MADE(self):
395 devices = self.parse("HOME_MADE")397 devices = self.parse("HOME_MADE")
diff --git a/checkbox_support/parsers/udevadm.py b/checkbox_support/parsers/udevadm.py
index f382a1a..7f5acc7 100644
--- a/checkbox_support/parsers/udevadm.py
+++ b/checkbox_support/parsers/udevadm.py
@@ -380,6 +380,8 @@ class UdevadmDevice(object):
380 return "CARDREADER"380 return "CARDREADER"
381 if self.driver == "rts_pstor":381 if self.driver == "rts_pstor":
382 return "CARDREADER"382 return "CARDREADER"
383 if self.driver == "smo8800":
384 return "ACCELEROMETER"
383 # See http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=702145385 # See http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=702145
384 if self.driver.startswith("rtsx"):386 if self.driver.startswith("rtsx"):
385 return "CARDREADER"387 return "CARDREADER"

Subscribers

People subscribed via source and target branches