start

Source code: start.py

A test to make sure everything is set for the following test in test list.

Description

This test checks everything is set for the following tests in the test list, including make sure an external power supplier is presence, checking factory software is installed, etc.

Normally, this test should be placed as the first one in a test list, to make sure everything is set before performing any other tests.

Test Procedure

It checks several conditions as specified by the options, and ask the operator to press a key to pass.

Dependency

If argument require_external_power is set, it reads /sys/class/power_supply/ to determine if an external power supply is connected.

Examples

To initialize shared data, then ask the operator to press a key to continue, add this in test list:

{
  "pytest_name": "start"
}

Ask the operator to press power button to continue, add this in test list:

{
  "pytest_name": "start",
  "args": {
    "key_to_continue": "HW_BUTTON",
    "button_key_name": "KEY_POWER",
    "button_name": "i18n! Power Button"
  }
}

Show custom message:

{
  "pytest_name": "start",
  "args": {
    "prompt": "i18n! Some message..."
  }
}

To also ensure if an external power supply is connected, and check factory toolkit is properly installed:

{
  "pytest_name": "start",
  "args": {
    "check_factory_install_complete": true,
    "require_external_power": true
  }
}

Test Arguments

Name

Type

Description

key_to_continue

[‘HW_BUTTON’, ‘NONE’, ‘SPACE’]

(optional; default: <_KeyType.SPACE: 'SPACE'>) The key which need to be pressed to continue. “NONE” means don’t need to press key to continue.

button_key_name

str, None

(optional; default: None) The key name to identify the button.

button_name

str, dict, None

(optional; default: None) The name of the button to be shown.

require_external_power

bool

(optional; default: False) Prompts and waits for external power to be applied.

check_factory_install_complete

bool, None

(optional; default: None) Check factory install process was complete.

prompt

str, dict, None

(optional; default: None) Message to be shown to the operator when prompting for input.

init_shared_data

dict

(optional; default: {}) The shared data to be initialized.