diff options
author | Fabien Lahoudere <fabien.lahoudere@collabora.com> | 2020-01-22 13:28:55 +0100 |
---|---|---|
committer | Enric Balletbo i Serra <enric.balletbo@collabora.com> | 2020-01-23 14:56:26 +0100 |
commit | 53015aba43167533675a077bb5c04677c131e823 (patch) | |
tree | 4f680bab42270a7f9e29578ff4e060b3f3790cd7 | |
parent | 8bfff085df88311c0c4d84e243c11365b68b38cf (diff) | |
download | cros-ec-tests-53015aba43167533675a077bb5c04677c131e823.tar.gz |
test_cros_ec_abi: Use complete device name instead of a suffix
To check the sysfs ABI, we use only the suffix ec, fp, pd and tp as
name. We will have in the future, though, other embedded controllers
that will not start with the "cros_" prefix, like the "wilco_ec". To
solve those cases change the code to use the full device name.
Signed-off-by: Fabien Lahoudere <fabien.lahoudere@collabora.com>
Signed-off-by: Enric Balletbo i Serra <enric.balletbo@collabora.com>
-rw-r--r-- | cros/helpers/mcu.py | 4 | ||||
-rw-r--r-- | cros/tests/cros_ec_mcu.py | 9 |
2 files changed, 6 insertions, 7 deletions
diff --git a/cros/helpers/mcu.py b/cros/helpers/mcu.py index 6ea7b28..2a876dd 100644 --- a/cros/helpers/mcu.py +++ b/cros/helpers/mcu.py @@ -130,11 +130,11 @@ def check_mcu_abi(s, name): """ Checks that the MCU character device exists in /dev and then verifies the standard MCU ABI in /sys/class/chromeos. """ - if not os.path.exists("/dev/cros_" + name): + if not os.path.exists("/dev/" + name): s.skipTest("MCU " + name + " not supported, skipping") files = ["flashinfo", "reboot", "version"] sysfs_check_attributes_exists( - s, "/sys/class/chromeos/", "cros_" + name, files, False + s, "/sys/class/chromeos/", name, files, False ) diff --git a/cros/tests/cros_ec_mcu.py b/cros/tests/cros_ec_mcu.py index aed158a..3b161f1 100644 --- a/cros/tests/cros_ec_mcu.py +++ b/cros/tests/cros_ec_mcu.py @@ -9,19 +9,19 @@ import unittest class TestCrosECMCU(unittest.TestCase): def test_cros_ec_abi(self): """ Checks the standard ABI for the main Embedded Controller. """ - check_mcu_abi(self, "ec") + check_mcu_abi(self, "cros_ec") def test_cros_fp_abi(self): """ Checks the standard ABI for the Fingerprint EC. """ - check_mcu_abi(self, "fp") + check_mcu_abi(self, "cros_fp") def test_cros_tp_abi(self): """ Checks the standard ABI for the Touchpad EC. """ - check_mcu_abi(self, "tp") + check_mcu_abi(self, "cros_tp") def test_cros_pd_abi(self): """ Checks the standard ABI for the Power Delivery EC. """ - check_mcu_abi(self, "pd") + check_mcu_abi(self, "cros_pd") def test_cros_ec_chardev(self): """ Checks the main Embedded controller character device. """ @@ -42,4 +42,3 @@ class TestCrosECMCU(unittest.TestCase): def test_cros_pd_hello(self): """ Checks basic comunication with the power delivery controller. """ mcu_hello(self, "cros_pd") - |