1*9c5db199SXin Li# Copyright 2020 The Chromium OS Authors. All rights reserved. 2*9c5db199SXin Li# Use of this source code is governed by a BSD-style license that can be 3*9c5db199SXin Li# found in the LICENSE file. 4*9c5db199SXin Li 5*9c5db199SXin Lifrom autotest_lib.client.common_lib import error 6*9c5db199SXin Lifrom autotest_lib.client.common_lib import utils 7*9c5db199SXin Lifrom autotest_lib.server.site_tests.tast import tast 8*9c5db199SXin Li 9*9c5db199SXin LiAUTHOR = 'Chromium OS team' 10*9c5db199SXin LiNAME = 'tast.generic' 11*9c5db199SXin LiTIME = 'MEDIUM' 12*9c5db199SXin LiTEST_TYPE = 'Server' 13*9c5db199SXin Li# This test belongs to no suite; it is intended mainly for manual invocation 14*9c5db199SXin Li# via test_that. 15*9c5db199SXin LiATTRIBUTES = '' 16*9c5db199SXin LiMAX_RESULT_SIZE_KB = 256 * 1024 17*9c5db199SXin LiPY_VERSION = 3 18*9c5db199SXin Li 19*9c5db199SXin Li# tast.py uses binaries installed from autotest_server_package.tar.bz2. 20*9c5db199SXin LiREQUIRE_SSP = True 21*9c5db199SXin Li 22*9c5db199SXin LiDOC = ''' 23*9c5db199SXin LiRun arbitrary Tast tests. 24*9c5db199SXin Li 25*9c5db199SXin LiTast is an integration-testing framework analagous to the test-running portion 26*9c5db199SXin Liof Autotest. See https://chromium.googlesource.com/chromiumos/platform/tast/ for 27*9c5db199SXin Limore information. 28*9c5db199SXin Li 29*9c5db199SXin LiThis test runs arbitary Tast-based tests specified by args given to test_that. 30*9c5db199SXin LiThis test might be useful on debugging to simulate Tast test runs invoked via 31*9c5db199SXin LiAutotest. 32*9c5db199SXin Li 33*9c5db199SXin LiExamples: 34*9c5db199SXin Li test_that --args=tast_expr=example.Pass ${DUT} tast.generic 35*9c5db199SXin Li test_that --args=tast_expr='("group:mainline")' ${DUT} tast.generic 36*9c5db199SXin Li test_that --args='tast_expr=example.RuntimeVars tast.example.strvar="Hello_World"' ${DUT} tast.generic 37*9c5db199SXin Li''' 38*9c5db199SXin Li 39*9c5db199SXin Licommand_args, varslist = tast.split_arguments(args) 40*9c5db199SXin Li 41*9c5db199SXin Lidef run(machine): 42*9c5db199SXin Li args_dict = utils.args_to_dict(command_args) 43*9c5db199SXin Li try: 44*9c5db199SXin Li expr = args_dict['tast_expr'] 45*9c5db199SXin Li except KeyError: 46*9c5db199SXin Li raise error.TestFail( 47*9c5db199SXin Li 'Attribute expression is unspecified; set --args=tast_expr=...') 48*9c5db199SXin Li job.run_test('tast', 49*9c5db199SXin Li host=hosts.create_host(machine), 50*9c5db199SXin Li test_exprs=[expr], 51*9c5db199SXin Li ignore_test_failures=False, max_run_sec=3600, 52*9c5db199SXin Li command_args=command_args, 53*9c5db199SXin Li varslist=varslist, 54*9c5db199SXin Li is_cft=is_cft) 55*9c5db199SXin Li 56*9c5db199SXin Liparallel_simple(run, machines) 57