Test Helpers

kernel

cros.helpers.kernel.current_kernel_version()[source]

Returns the current kernel version as an integer you can compare.

cros.helpers.kernel.kernel_greater_than(version, major, minor)[source]

Returns true if the given version is greater than the running kernel version.

cros.helpers.kernel.kernel_lower_than(version, major, minor)[source]

Returns true if the given version is lower than the running kernel version.

cros.helpers.kernel.version_to_int(version, major, minor)[source]

Return an integer from kernel version to allow to compare with others.

mcu

cros.helpers.mcu.check_mcu_abi(s, name)[source]

Checks that the MCU character device exists in /dev and then verifies the standard MCU ABI in /sys/class/chromeos.

class cros.helpers.mcu.cros_ec_command[source]
class cros.helpers.mcu.ec_params_get_features[source]
class cros.helpers.mcu.ec_params_hello[source]
class cros.helpers.mcu.ec_response_get_features[source]
class cros.helpers.mcu.ec_response_get_version[source]
class cros.helpers.mcu.ec_response_hello[source]
cros.helpers.mcu.is_feature_supported(feature)[source]

Returns true if the Embedded Controller supports the specified ‘feature’.

cros.helpers.mcu.mcu_hello(s, name)[source]

Checks basic comunication with MCU.

sysfs

cros.helpers.sysfs.read_file(name)[source]

Returns the content of the file named ‘name’.

cros.helpers.sysfs.sysfs_check_attributes_exists(s, path, name, files, check_devtype)[source]

Checks that all attributes listed in ‘files’ for a given ‘path’ exists. Note that the ‘name’ parameter is used to define a pattern to match before checking a device path.