Test Cases

A test case is a set of conditions or variables under which a tester will determine whether an application or system is working correctly. It may take many test cases to determine that a software program or system is considered sufficiently scrutinized to be released. Test cases are often referred to as test scripts, particularly when written. Written test cases are usually collected into test suites.

cros-ec-accel

class cros.tests.cros_ec_accel.TestCrosECAccel(methodName='runTest')[source]
test_cros_ec_accel_iio_abi()[source]

Checks the cros-ec accelerometer IIO ABI.

test_cros_ec_accel_iio_data_is_valid()[source]

Validates accelerometer data by computing the magnitude. If the magnitude is not closed to 1G, that means data are invalid or the machine is in movement or there is a earth quake.

cros-ec-extcon

class cros.tests.cros_ec_extcon.TestCrosECextcon(methodName='runTest')[source]
test_cros_ec_extcon_usbc_abi()[source]

Checks the cros-ec extcon ABI.

cros-ec-gyro

class cros.tests.cros_ec_gyro.TestCrosECGyro(methodName='runTest')[source]
test_cros_ec_gyro_iio_abi()[source]

Checks the cros-ec gyroscope IIO ABI.

cros-ec-mcu

class cros.tests.cros_ec_mcu.TestCrosECMCU(methodName='runTest')[source]
test_cros_ec_abi()[source]

Checks the standard ABI for the main Embedded Controller.

test_cros_ec_chardev()[source]

Checks the main Embedded controller character device.

test_cros_ec_hello()[source]

Checks basic comunication with the main Embedded controller.

test_cros_fp_abi()[source]

Checks the standard ABI for the Fingerprint EC.

test_cros_fp_hello()[source]

Checks basic comunication with the fingerprint controller.

test_cros_fp_reboot()[source]

Test reboot command on Fingerprint MCU.

Coming out of reset, the MCU boot into its RO firmware and jumps to the RW version after validate its signature. If the protocol used in RO version is different of the RW version, when a reboot is issued the AP still uses the protocol version queried before transition, this causes the AP to no communicate correctly with the RO firmware and thus it doesn’t switches to RW firmware.

This test detects the that situation and reports a failure when the embedded controller is not able to transition from RO to RW, which is an indication that there is a problem.

The above issue was fixed with the kernel patch 241a69ae8ea8 (“platform/chrome: cros_ec: Query EC protocol version if EC transitions between RO/RW).

test_cros_pd_abi()[source]

Checks the standard ABI for the Power Delivery EC.

test_cros_pd_hello()[source]

Checks basic comunication with the power delivery controller.

test_cros_tp_abi()[source]

Checks the standard ABI for the Touchpad EC.

test_cros_tp_hello()[source]

Checks basic comunication with the touchpad controller.

cros-ec-power

class cros.tests.cros_ec_power.TestCrosECPower(methodName='runTest')[source]
test_cros_ec_battery_abi()[source]

Check the cros battery ABI.

test_cros_ec_usbpd_charger_abi()[source]

Check the cros USBPD charger ABI.

cros-ec-pwm

class cros.tests.cros_ec_pwm.TestCrosECPWM(methodName='runTest')[source]
test_cros_ec_pwm_backlight()[source]

Check that the backlight is connected to a pwm of the EC and that programming a brightness level to the backlight affects the PWM duty cycle.

cros-ec-rtc

class cros.tests.cros_ec_rtc.TestCrosECRTC(methodName='runTest')[source]
test_cros_ec_rtc_abi()[source]

Check the cros RTC ABI.