Commit ef8c029e authored by Fabien Lahoudere's avatar Fabien Lahoudere Committed by Enric Balletbo i Serra

cros_ec_extcon: Check also the cable API

The test was buggy and only checked the device name and state. Now, we
also check all the cable names and states.
Signed-off-by: default avatarFabien Lahoudere <fabien.lahoudere@collabora.com>
Signed-off-by: default avatarEnric Balletbo i Serra <enric.balletbo@collabora.com>
parent 77716af3
......@@ -15,12 +15,19 @@ class TestCrosECextcon(unittest.TestCase):
os.path.exists("/sys/class/extcon/" + devname + "/state"), 1
)
for cable in os.listdir("/sys/class/extcon/" + devname):
self.assertEqual(
os.path.exists("/sys/class/extcon/" + devname + "/name"), 1
)
self.assertEqual(
os.path.exists("/sys/class/extcon/" + devname + "/state"), 1
)
match += 1
if cable.startswith("cable"):
self.assertEqual(
os.path.exists(
"/sys/class/extcon/" + devname + "/" + cable + "/name"
),
1,
)
self.assertEqual(
os.path.exists(
"/sys/class/extcon/" + devname + "/" + cable + "/state"
),
1,
)
match += 1
if match == 0:
self.skipTest("No extcon device found, skipping")
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment