button¶
Source code: button.py
Tests button functionality.
Description¶
This test verifies if a button is working properly by checking if its state is changed per given instruction.
You can specify the button in different ways using the button_key_name
argument:
Key Name |
Description |
---|---|
|
A GPIO button. |
|
A |
|
A value for |
|
An |
Test Procedure¶
When started, the test will prompt operator to press and release given button N times, and fail if not finished in given timeout.
Dependency¶
Depends on the driver of specified button source: GPIO, crossystem
,
ectool
, or evdev
(which also needs /dev/input
and evtest
).
Examples¶
To test the recovery button 1 time in 30 seconds, add this in test list:
{
"pytest_name": "button",
"args": {
"button_key_name": "crossystem:recoverysw_cur"
}
}
To test volume down button (using evdev
) 3 times in 10 seconds:
{
"pytest_name": "button",
"args": {
"timeout_secs": 10,
"button_key_name": "KEY_VOLUMEDOWN",
"repeat_times": 3
}
}
Test Arguments¶
Name |
Type |
Description |
---|---|---|
timeout_secs |
int |
(optional; default: |
button_key_name |
str |
Button key name. |
device_filter |
int, str, None |
(optional; default: |
repeat_times |
int |
(optional; default: |
bft_fixture |
dict, None |
(optional; default:
The default value of |
bft_button_name |
str, None |
(optional; default: |
button_name |
str, dict |
The name of the button. |