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
1diff --git a/checkbox_support/parsers/tests/test_udevadm.py b/checkbox_support/parsers/tests/test_udevadm.py
2index d5c5e02..4fa8ac8 100644
3--- a/checkbox_support/parsers/tests/test_udevadm.py
4+++ b/checkbox_support/parsers/tests/test_udevadm.py
5@@ -375,6 +375,7 @@ E: UDEV_LOG=3
6 self.assertEqual(self.count(devices, "WIRELESS"), 1)
7 self.assertEqual(self.count(devices, "DISK"), 2)
8 self.assertEqual(self.count(devices, "NETWORK"), 1)
9+ self.assertEqual(self.count(devices, "ACCELEROMETER"), 1)
10
11 def test_TOSHIBA_NVME(self):
12 devices = self.parse("TOSHIBA_NVME")
13@@ -390,6 +391,7 @@ E: UDEV_LOG=3
14 self.assertEqual(self.count(devices, "WIRELESS"), 2)
15 self.assertEqual(self.count(devices, "DISK"), 1)
16 self.assertEqual(self.count(devices, "NETWORK"), 1)
17+ self.assertEqual(self.count(devices, "ACCELEROMETER"), 1)
18
19 def test_HOME_MADE(self):
20 devices = self.parse("HOME_MADE")
21diff --git a/checkbox_support/parsers/udevadm.py b/checkbox_support/parsers/udevadm.py
22index f382a1a..7f5acc7 100644
23--- a/checkbox_support/parsers/udevadm.py
24+++ b/checkbox_support/parsers/udevadm.py
25@@ -380,6 +380,8 @@ class UdevadmDevice(object):
26 return "CARDREADER"
27 if self.driver == "rts_pstor":
28 return "CARDREADER"
29+ if self.driver == "smo8800":
30+ return "ACCELEROMETER"
31 # See http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=702145
32 if self.driver.startswith("rtsx"):
33 return "CARDREADER"

Subscribers

People subscribed via source and target branches