Garry Wang | 11b5e87 | 2020-03-11 15:14:08 -0700 | [diff] [blame] | 1 | # Copyright (c) 2020 The Chromium OS Authors. All rights reserved. |
| 2 | # Use of this source code is governed by a BSD-style license that can be |
| 3 | # found in the LICENSE file. |
| 4 | |
| 5 | |
| 6 | from autotest_lib.client.common_lib import global_config |
| 7 | _CONFIG = global_config.global_config |
| 8 | |
| 9 | # Names of the host attributes in the database that represent the values for |
| 10 | # the servo_host and servo_port for a servo connected to the DUT. |
| 11 | SERVO_HOST_ATTR = 'servo_host' |
| 12 | SERVO_PORT_ATTR = 'servo_port' |
| 13 | SERVO_BOARD_ATTR = 'servo_board' |
| 14 | # Model is inferred from host labels. |
| 15 | SERVO_MODEL_ATTR = 'servo_model' |
| 16 | SERVO_SERIAL_ATTR = 'servo_serial' |
| 17 | SERVO_ATTR_KEYS = ( |
| 18 | SERVO_BOARD_ATTR, |
| 19 | SERVO_HOST_ATTR, |
| 20 | SERVO_PORT_ATTR, |
| 21 | SERVO_SERIAL_ATTR, |
| 22 | ) |
| 23 | |
| 24 | # Timeout value for stop/start servod process. |
| 25 | SERVOD_TEARDOWN_TIMEOUT = 3 |
| 26 | SERVOD_QUICK_STARTUP_TIMEOUT = 20 |
| 27 | SERVOD_STARTUP_TIMEOUT = 60 |
| 28 | |
| 29 | # pools that support dual v4. (go/cros-fw-lab-strategy) |
| 30 | POOLS_SUPPORT_DUAL_V4 = {'faft-cr50', |
| 31 | 'faft-cr50-experimental', |
| 32 | 'faft-cr50-tot', |
| 33 | 'faft-cr50-debug', |
| 34 | 'faft_cr50_debug' |
| 35 | 'faft-pd-debug', |
| 36 | 'faft_pd_debug'} |
| 37 | |
| 38 | ENABLE_SSH_TUNNEL_FOR_SERVO = _CONFIG.get_config_value( |
| 39 | 'CROS', 'enable_ssh_tunnel_for_servo', type=bool, default=False) |
| 40 | |
Otabek Kasimov | e756528 | 2020-04-14 13:26:12 -0700 | [diff] [blame] | 41 | SERVO_TYPE_LABEL_PREFIX = 'servo_type' |
Garry Wang | 11b5e87 | 2020-03-11 15:14:08 -0700 | [diff] [blame] | 42 | SERVO_STATE_LABEL_PREFIX = 'servo_state' |
| 43 | SERVO_STATE_WORKING = 'WORKING' |
| 44 | SERVO_STATE_BROKEN = 'BROKEN' |
| 45 | SERVO_STATE_NOT_CONNECTED = 'NOT_CONNECTED' |
| 46 | SERVO_STATE_WRONG_CONFIG = 'WRONG_CONFIG' |
| 47 | SERVO_STATE_UNKNOWN = 'UNKNOWN' |
Garry Wang | ffbd216 | 2020-04-17 16:13:48 -0700 | [diff] [blame] | 48 | |
| 49 | # constants to support reset servo via smart usbhub. |
Garry Wang | 000c6c0 | 2020-05-11 21:27:23 -0700 | [diff] [blame^] | 50 | SMART_USBHUB_LABEL = 'smart_usbhub' |
Garry Wang | ffbd216 | 2020-04-17 16:13:48 -0700 | [diff] [blame] | 51 | SERVO_RESET_TIMEOUT_SECONDS = 20 |
Garry Wang | 000c6c0 | 2020-05-11 21:27:23 -0700 | [diff] [blame^] | 52 | ERROR_MESSAGE_USB_HUB_NOT_COMPATIBLE = 'No compatible smart hubs detected' |
Garry Wang | ffbd216 | 2020-04-17 16:13:48 -0700 | [diff] [blame] | 53 | # a servo serial number should be fed to this constant |
| 54 | ERROR_MESSAGE_DEVICE_NOT_FOUND = 'Device with serial \'%s\' not found.' |