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 utils 6 7AUTHOR = 'abergman, chromeos-engprod-platform-syd' 8NAME = '{name}' 9ATTRIBUTES = '{attributes}' 10TIME = '{length}' 11TEST_CATEGORY = 'Stress' 12TEST_CLASS = 'Hardware' 13TEST_TYPE = 'Server' 14PY_VERSION = 3 15PRIORITY = {priority} 16MAX_RESULT_SIZE_KB = 1024 * 1024 17JOB_RETRIES = 0 18REQUIRE_SSP = True 19FAST = False 20DEPENDENCIES = '{dependency}' 21 22DOC = ''' 23Run the Tast-based storage qualification quick test. 24 25Tast is an integration-testing framework analogous to the test-running portion 26of Autotest. See https://chromium.googlesource.com/chromiumos/platform/tast/ for 27more information. 28 29See http://go/tast-failures for information about investigating failures. 30''' 31import tempfile 32import yaml 33 34keyval = dict() 35keyval['storage_qual_version'] = {version} 36keyval['bug_id'] = bug_id 37keyval['part_id'] = part_id 38utils.write_keyval(job.resultdir, keyval) 39 40def run(machine): 41 args_dict = globals().get('args_dict', dict()) 42 43 with tempfile.NamedTemporaryFile(suffix='.yaml', mode='w+', encoding='utf-8') as temp_file: 44 # Writing test arguments to yaml file except for wrapper-related arguments. 45 test_args = dict() 46 for key in args_dict: 47 if key.startswith('tast_'): 48 test_args[key] = args_dict[key] 49 yaml.safe_dump(test_args, 50 stream=temp_file, 51 default_flow_style=False, 52 allow_unicode=True) 53 54 job.run_test('tast', 55 host=hosts.create_host(machine), 56 test_exprs=['{test_exprs}'], 57 ignore_test_failures=False, 58 max_run_sec={duration}, 59 command_args=args, 60 varsfiles=[temp_file.name]) 61 62parallel_simple(run, machines) 63