stylus_garage

Source code: stylus_garage.py

Tests stylus garage detection functionality.

Description

Verifies if stylus garage is functional by asking operator to insert and remove the stylus.

Test Procedure

  1. Operator inserts the stylus into the stylus garage.

  2. Operator removes the stylus from the stylus garage.

Dependency

  • Based on Linux evdev.

Examples

To run default test:

{
  "pytest_name": "stylus_garage",
  "label": "Stylus Garage",
  "run_if": "not constants.has_device_data or device.component.has_stylus_garage",
  "related_components": [
    "test_tags.TestCategory.EMR_IC",
    "test_tags.TestCategory.USI_CONTROLLER"
  ]
}

To test both of the stylus and the garage with a test group:

{
  "label": "Stylus And Garage",
  "subtests": [
    {
      "pytest_name": "stylus_garage",
      "label": "Remove stylus",
      "run_if": "not constants.has_device_data or device.component.has_stylus_garage",
      "related_components": [
        "test_tags.TestCategory.EMR_IC",
        "test_tags.TestCategory.USI_CONTROLLER"
      ],
      "args": {
        "target_state": "ejected"
      }
    },
    {
      "pytest_name": "stylus",
      "label": "Stylus",
      "run_if": "not constants.has_device_data or device.component.has_stylus",
      "related_components": [
        "test_tags.TestCategory.EMR_IC",
        "test_tags.TestCategory.USI_CONTROLLER"
      ]
    },
    {
      "pytest_name": "stylus_garage",
      "label": "Insert stylus",
      "run_if": "not constants.has_device_data or device.component.has_stylus_garage",
      "related_components": [
        "test_tags.TestCategory.EMR_IC",
        "test_tags.TestCategory.USI_CONTROLLER"
      ],
      "args": {
        "target_state": "inserted"
      }
    }
  ]
}

Test Arguments

Name

Type

Description

timeout_secs

int

(optional; default: 180) Timeout value for the test.

device_filter

int, str, None

(optional; default: None) Event ID or name for evdev. None for auto probe.

garage_is_stylus

bool

(optional; default: True) Deprecated. No effect. Leave for compatibility.

target_state

[‘ejected’, ‘inserted’], None

(optional; default: None) The test passes when reaches the target state. If not specified, pass after an insertion and then an ejection or an ejection and then an insertion.