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

test_cros_ec_rtc_abi: Test RTC ABI

The script checks the RTC ABI that all required files are present.
Signed-off-by: default avatarFabien Lahoudere <fabien.lahoudere@collabora.com>
Signed-off-by: default avatarEnric Balletbo i Serra <enric.balletbo@collabora.com>
parent 477efc90
......@@ -321,6 +321,22 @@ class TestCrosEC(unittest.TestCase):
if match == 0:
self.skipTest("No extcon device found, skipping")
def test_cros_ec_rtc_abi(self):
if not is_feature_supported(EC_FEATURE_RTC):
self.skipTest("EC_FEATURE_RTC not supported, skipping")
match = 0
for devname in os.listdir("/sys/class/rtc"):
fd = open("/sys/class/rtc/" + devname + "/name", 'r')
devtype = fd.read()
fd.close()
if devtype.startswith("cros-ec-rtc"):
files = [ "date", "hctosys", "max_user_freq", "since_epoch",
"time", "wakealarm" ]
match += 1
for filename in files:
self.assertEqual(os.path.exists("/sys/class/rtc/" + devname + "/" + filename), 1)
self.assertNotEqual(match,0)
if __name__ == '__main__':
unittest.main(testRunner=LavaTestRunner(),
# these make sure that some options that are not applicable
......
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