1# Copyright 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 5from autotest_lib.client.common_lib import error 6from autotest_lib.client.common_lib import utils 7 8AUTHOR = 'Chromium OS team' 9NAME = 'tast.generic-servo' 10TIME = 'MEDIUM' 11TEST_TYPE = 'Server' 12DEPENDENCIES = 'servo_state:WORKING' 13# This test belongs to no suite; it is intended mainly for manual invocation 14# via test_that. 15ATTRIBUTES = '' 16MAX_RESULT_SIZE_KB = 256 * 1024 17 18# tast.py uses binaries installed from autotest_server_package.tar.bz2. 19REQUIRE_SSP = True 20 21DOC = ''' 22Run arbitrary Tast tests with servo support. 23 24Tast is an integration-testing framework analagous to the test-running portion 25of Autotest. See https://chromium.googlesource.com/chromiumos/platform/tast/ for 26more information. 27 28This test runs arbitary Tast-based tests specified by args given to test_that. 29This test might be useful on debugging to simulate Tast test runs invoked via 30Autotest. 31 32Examples: 33 test_that --args="tast_expr=example.ServoEcho servo_host=${SERVO_HOST} 34 servo_port=${SERVO_PORT}" ${DUT} tast.generic-servo 35 test_that --args="tast_expr='(\"group:mainline\")' servo_host=${SERVO_HOST} 36 servo_port=${SERVO_PORT}" ${DUT} tast.generic-servo 37 test_that --args=tast_expr='("group:mainline")' ${DUT} tast.generic-servo 38''' 39 40args_dict = utils.args_to_dict(args) 41assert 'servo_state:WORKING' in DEPENDENCIES 42servo_args = hosts.CrosHost.get_servo_arguments(args_dict) 43 44try: 45 expr = args_dict['tast_expr'] 46except KeyError: 47 raise error.TestFail( 48 'Attribute expression is unspecified; set --args=tast_expr=...') 49 50def run(machine): 51 job.run_test('tast', 52 host=hosts.create_host(machine, servo_args=servo_args), 53 test_exprs=[expr], 54 ignore_test_failures=False, max_run_sec=3600, 55 command_args=args) 56 57parallel_simple(run, machines) 58