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 6from 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. 11SERVO_HOST_ATTR = 'servo_host' 12SERVO_HOST_SSH_PORT_ATTR = 'servo_host_ssh_port' 13SERVO_PORT_ATTR = 'servo_port' 14SERVO_BOARD_ATTR = 'servo_board' 15# Model is inferred from host labels. 16SERVO_MODEL_ATTR = 'servo_model' 17SERVO_SERIAL_ATTR = 'servo_serial' 18SERVOD_DOCKER_ATTR = 'servod_docker' 19# Indicates what type of servo setup, example value: REGULAR or DUAL_V4. 20SERVO_SETUP_ATTR = 'servo_setup' 21SERVO_FW_CHANNEL_ATTR = 'servo_fw_channel' 22SERVO_SETUP_VALUE_DUAL_V4 = 'DUAL_V4' 23SERVO_RECOVERY_MODE = 'servo_recovery' 24SERVO_ATTR_KEYS = ( 25 SERVO_BOARD_ATTR, 26 SERVO_HOST_ATTR, 27 SERVOD_DOCKER_ATTR, 28 SERVO_HOST_SSH_PORT_ATTR, 29 SERVO_PORT_ATTR, 30 SERVO_SERIAL_ATTR, 31 SERVO_SETUP_ATTR, 32 SERVO_FW_CHANNEL_ATTR, 33) 34 35# Additional args that will be appended to servod start command. 36ADDITIONAL_SERVOD_ARGS = 'additional_servod_args' 37 38# Timeout value for stop/start servod process. 39SERVOD_TEARDOWN_TIMEOUT = 3 40SERVOD_QUICK_STARTUP_TIMEOUT = 20 41SERVOD_STARTUP_TIMEOUT = 60 42 43# Prefix of pools that require servod cr50 config. 44CR50_CONFIG_POOL_PREFIX = 'faft-cr50' 45 46ENABLE_SSH_TUNNEL_FOR_SERVO = _CONFIG.get_config_value( 47 'CROS', 'enable_ssh_tunnel_for_servo', type=bool, default=False) 48 49SERVO_TYPE_LABEL_PREFIX = 'servo_type' 50SERVO_STATE_LABEL_PREFIX = 'servo_state' 51 52# constants to support whole list of states for servo 53SERVO_STATE_UNKNOWN = 'UNKNOWN' 54SERVO_STATE_MISSING_CONFIG = 'MISSING_CONFIG' 55SERVO_STATE_WRONG_CONFIG = 'WRONG_CONFIG' 56SERVO_STATE_NO_SSH = 'NO_SSH' 57SERVO_STATE_SERVO_HOST_ISSUE = 'SERVO_HOST_ISSUE' 58SERVO_STATE_NOT_CONNECTED = 'NOT_CONNECTED' 59SERVO_STATE_SERIAL_MISMATCH = 'SERVO_SERIAL_MISMATCH' 60SERVO_STATE_SERVO_UPDATER_ISSUE = 'SERVO_UPDATER_ISSUE' 61SERVO_STATE_SERVOD_DUT_CONTROLLER_MISSING = 'SERVOD_DUT_CONTROLLER_MISSING' 62SERVO_STATE_NEED_REPLACEMENT = 'NEED_REPLACEMENT' 63SERVO_STATE_CR50_CONSOLE_MISSING = 'CR50_CONSOLE_MISSING' 64SERVO_STATE_CCD_TESTLAB_ISSUE = 'CCD_TESTLAB_ISSUE' 65SERVO_STATE_SERVOD_ISSUE = 'SERVOD_ISSUE' 66SERVO_STATE_SERVOD_PROXY_ISSUE = 'SERVOD_PROXY_ISSUE' 67SERVO_STATE_LID_OPEN_FAILED = 'LID_OPEN_FAILED' 68SERVO_STATE_BAD_RIBBON_CABLE = 'BAD_RIBBON_CABLE' 69SERVO_STATE_TOPOLOGY_ISSUE = 'TOPOLOGY_ISSUE' 70SERVO_STATE_SBU_LOW_VOLTAGE = 'SBU_LOW_VOLTAGE' 71SERVO_STATE_CR50_NOT_ENUMERATED = 'CR50_NOT_ENUMERATED' 72SERVO_STATE_DUT_NOT_CONNECTED = 'DUT_NOT_CONNECTED' 73SERVO_STATE_EC_BROKEN = 'EC_BROKEN' 74SERVO_STATE_BROKEN = 'BROKEN' 75SERVO_STATE_WORKING = 'WORKING' 76 77# constants to support reset servo via smart usbhub. 78SMART_USBHUB_LABEL = 'smart_usbhub' 79SERVO_RESET_TIMEOUT_SECONDS = 20 80ERROR_MESSAGE_USB_HUB_NOT_COMPATIBLE = ('Be sure the hub is a supported' 81 ' smart hub') 82# a servo serial number should be fed to this constant 83ERROR_MESSAGE_DEVICE_NOT_FOUND = 'Device with serial \'%s\' not found.'