1# Copyright 2022 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 7from autotest_lib.server.site_tests.tast import tast 8 9AUTHOR = 'Chromium OS team' 10NAME = 'tast.generic-list' 11TIME = 'MEDIUM' 12TEST_TYPE = 'Server' 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 17PY_VERSION = 3 18 19# tast.py uses binaries installed from autotest_server_package.tar.bz2. 20REQUIRE_SSP = True 21 22DOC = ''' 23Run arbitrary Tast tests in a comma seperated list 24 25Tast is an integration-testing framework analagous to the test-running portion 26of Autotest. See https://chromium.googlesource.com/chromiumos/platform/tast/ for 27more information. 28 29This test runs arbitary Tast-based tests specified by args given to test_that. 30This test might be useful on debugging to simulate Tast test runs invoked via 31Autotest. Tests run with this wrapper will report skipped tests using the 32autotest TEST NA status. 33 34Examples: 35 test_that --args=tast_list=tast.test_1,tast.test_2 ${DUT} tast.generic_list 36''' 37 38command_args, varslist = tast.split_arguments(args) 39 40def run(machine): 41 args_dict = utils.args_to_dict(command_args) 42 try: 43 tast_list = args_dict['tast_list'] 44 except KeyError: 45 raise error.TestFail( 46 'Attribute expression is unspecified; set --args=tast_list=...') 47 expr = tast_list.split(',') 48 job.run_test('tast', 49 host=hosts.create_host(machine), 50 test_exprs=expr, 51 ignore_test_failures=True, max_run_sec=3600, 52 command_args=command_args, 53 varslist=varslist, 54 exclude_missing=True, 55 report_skipped=True) 56 57parallel_simple(run, machines) 58