diff options
author | Fabien Lahoudere <fabien.lahoudere@collabora.com> | 2019-11-28 13:59:41 +0100 |
---|---|---|
committer | Enric Balletbo i Serra <enric.balletbo@collabora.com> | 2019-12-06 09:23:50 +0100 |
commit | 796da36ea2d728849362a69dcafe9eeeb050479e (patch) | |
tree | 67d949a36ae33f611c3cb3febe16bde3b8e89ce9 | |
parent | 1209c77d75d4df17f572ea8e514bf6d2f2f770d2 (diff) | |
download | cros-ec-tests-796da36ea2d728849362a69dcafe9eeeb050479e.tar.gz |
test_cros_ec_gyro_iio_abi: Add a condition for frequency attribute
Frequency sysfs attribute have been replaced by the
standard sampling_frequency after 5.4.0. We need to check
the version of running kernel to decide if we must check it.
Signed-off-by: Fabien Lahoudere <fabien.lahoudere@collabora.com>
Signed-off-by: Enric Balletbo i Serra <enric.balletbo@collabora.com>
-rwxr-xr-x | test-cros-ec.py | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/test-cros-ec.py b/test-cros-ec.py index 1d3bd54..8a77dcf 100755 --- a/test-cros-ec.py +++ b/test-cros-ec.py @@ -322,17 +322,17 @@ class TestCrosEC(unittest.TestCase): self.skipTest("No accelerometer found, skipping") def test_cros_ec_gyro_iio_abi(self): - 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", + files = [ "buffer/", "calibrate", "current_timestamp_clock", "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/"] sysfs_check_attributes_exists( self, "/sys/bus/iio/devices", "cros-ec-gyro", files, True) - + if kernel_greater_than(5,4,0): + sysfs_check_attributes_exists( self, "/sys/bus/iio/devices", "cros-ec-gyro", ["frequency"], True) def test_cros_ec_usbpd_charger_abi(self): files = [ "current_max", "input_current_limit", |