generic_ec_component_accel_examples

Examples for testing ec_component_accel components. ec_component_accel is called “Accelerometer/IMU” in AVL.

Inherit

BaseAccelerometersCalibrationByEC

run_if

not constants.has_device_data or device.component.has_base_accelerometer

pytest_name

spatial_sensor_calibration

args

device_name
"cros-ec-accel"
device_location
"base"
raw_entry_template
"in_accel_%s_raw"
calibbias_entry_template
"in_accel_%s_calibbias"
vpd_entry_template
"in_accel_%s_base_calibbias"

BaseAccelerometersLooserLimits

run_if

not constants.has_device_data or device.component.has_base_accelerometer

pytest_name

accelerometers

args

location
"base"
limits
{
  "x": [
    -1.0,
    1.0
  ],
  "y": [
    -1.0,
    1.0
  ],
  "z": [
    8.0,
    11.0
  ]
}

GoToTabletModeAndGoBack

run_if

not constants.has_device_data or device.component.has_tabletmode

pytest_name

tablet_mode

args

timeout_secs
3600
prompt_flip_tablet
true
prompt_flip_notebook
true
lid_filter
"cros_ec_buttons"

GoToTabletModeAndGoBackSetLid

run_if

not constants.has_device_data or device.component.has_tabletmode

pytest_name

tablet_mode

args

timeout_secs
3600
prompt_flip_tablet
true
prompt_flip_notebook
true
lid_filter
"Lid Switch"

GyroscopeCalibrationByEC

run_if

not constants.has_device_data or device.component.has_base_gyroscope

pytest_name

spatial_sensor_calibration

args

device_name
"cros-ec-gyro"
device_location
"base"
raw_entry_template
"in_anglvel_%s_raw"
calibbias_entry_template
"in_anglvel_%s_calibbias"
vpd_entry_template
"in_anglvel_%s_base_calibbias"

LidAccelerometersCalibrationByEC

run_if

not constants.has_device_data or device.component.has_lid_accelerometer

pytest_name

spatial_sensor_calibration

args

device_name
"cros-ec-accel"
device_location
"lid"
raw_entry_template
"in_accel_%s_raw"
calibbias_entry_template
"in_accel_%s_calibbias"
vpd_entry_template
"in_accel_%s_lid_calibbias"

SetHasBaseAccelerometer

pytest_name

exec_shell

args

commands
"factory device-data component.has_base_accelerometer=1"

SetHasBaseGyroscope

pytest_name

exec_shell

args

commands
"factory device-data component.has_base_gyroscope=1"

SetHasLidAccelerometer

pytest_name

exec_shell

args

commands
"factory device-data component.has_lid_accelerometer=1"

SetHasTabletmode

pytest_name

exec_shell

args

commands
"factory device-data component.has_tabletmode=1"

TabletRotationBase

run_if

constants.has_device_data and device.component.has_base_accelerometer

pytest_name

tablet_rotation

args

spec_offset
[
  1.5,
  1.5
]
timeout_secs
3600
degrees_to_orientations
{
  "base": {
    "0": {
      "in_accel_x": 0,
      "in_accel_y": -1,
      "in_accel_z": 0
    },
    "180": {
      "in_accel_x": 0,
      "in_accel_y": 1,
      "in_accel_z": 0
    },
    "270": {
      "in_accel_x": -1,
      "in_accel_y": 0,
      "in_accel_z": 0
    },
    "90": {
      "in_accel_x": 1,
      "in_accel_y": 0,
      "in_accel_z": 0
    }
  }
}

TabletRotationLid

run_if

constants.has_device_data and device.component.has_lid_accelerometer

pytest_name

tablet_rotation

args

spec_offset
[
  1.5,
  1.5
]
timeout_secs
3600
degrees_to_orientations
{
  "lid": {
    "0": {
      "in_accel_x": 0,
      "in_accel_y": 1,
      "in_accel_z": 0
    },
    "180": {
      "in_accel_x": 0,
      "in_accel_y": -1,
      "in_accel_z": 0
    },
    "270": {
      "in_accel_x": -1,
      "in_accel_y": 0,
      "in_accel_z": 0
    },
    "90": {
      "in_accel_x": 1,
      "in_accel_y": 0,
      "in_accel_z": 0
    }
  }
}

UnsetHasBaseAccelerometer

pytest_name

exec_shell

args

commands
"factory device-data component.has_base_accelerometer=0"

UnsetHasBaseGyroscope

pytest_name

exec_shell

args

commands
"factory device-data component.has_base_gyroscope=0"

UnsetHasLidAccelerometer

pytest_name

exec_shell

args

commands
"factory device-data component.has_lid_accelerometer=0"

UnsetHasTabletmode

pytest_name

exec_shell

args

commands
"factory device-data component.has_tabletmode=0"

AccelerometerIMUTests

Serial subtests

ScreenRotation

run_if

not constants.has_device_data or device.component.has_tabletmode

Serial subtests