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

test_cros_ec_gyro_iio_abi: Test gyrsocope ABI

The scripts checks the IIO gyroscope ABI by verifying
that all required files are present.
Signed-off-by: default avatarFabien Lahoudere <>
Signed-off-by: default avatarEnric Balletbo i Serra <>
parent 9b820323
......@@ -253,6 +253,28 @@ class TestCrosEC(unittest.TestCase):
if match == 0:
self.skipTest("No accelerometer found, skipping")
def test_cros_ec_gyro_iio_abi(self):
match = 0
for devname in os.listdir("/sys/bus/iio/devices"):
fd = open("/sys/bus/iio/devices/" + devname + "/name", 'r')
devtype =
if devtype.startswith("cros-ec-gyro"):
files = [ "buffer/", "calibrate", "current_timestamp_clock",
"frequency", "id", "in_anglvel_x_calibbias",
"in_anglvel_x_calibscale", "in_anglvel_x_raw",
"in_anglvel_y_calibbias", "in_anglvel_y_calibscale",
"in_anglvel_y_raw", "in_anglvel_z_calibbias",
"in_anglvel_z_calibscale", "in_anglvel_z_raw",
"location", "sampling_frequency",
"sampling_frequency_available", "scale",
"scan_elements/", "trigger/"]
match += 1
for filename in files:
self.assertEqual(os.path.exists("/sys/bus/iio/devices/" + devname + "/" + filename), 1)
if match == 0:
self.skipTest("No gyroscope found, skipping")
if __name__ == '__main__':
# 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