# Copyright 2020 The Chromium OS Authors. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. from autotest_lib.client.common_lib import utils AUTHOR = 'abergman, chromeos-engprod-platform-syd' NAME = '{name}' ATTRIBUTES = '{attributes}' TIME = '{length}' TEST_CATEGORY = 'Stress' TEST_CLASS = 'Hardware' TEST_TYPE = 'Server' PY_VERSION = 3 PRIORITY = {priority} MAX_RESULT_SIZE_KB = 1024 * 1024 JOB_RETRIES = 0 REQUIRE_SSP = True FAST = False DEPENDENCIES = '{dependency}' DOC = ''' Run the Tast-based storage qualification quick test. Tast is an integration-testing framework analogous to the test-running portion of Autotest. See https://chromium.googlesource.com/chromiumos/platform/tast/ for more information. See http://go/tast-failures for information about investigating failures. ''' import tempfile import yaml keyval = dict() keyval['storage_qual_version'] = {version} keyval['bug_id'] = bug_id keyval['part_id'] = part_id utils.write_keyval(job.resultdir, keyval) def run(machine): args_dict = globals().get('args_dict', dict()) with tempfile.NamedTemporaryFile(suffix='.yaml', mode='w+', encoding='utf-8') as temp_file: # Writing test arguments to yaml file except for wrapper-related arguments. test_args = dict() for key in args_dict: if key.startswith('tast_'): test_args[key] = args_dict[key] yaml.safe_dump(test_args, stream=temp_file, default_flow_style=False, allow_unicode=True) job.run_test('tast', host=hosts.create_host(machine), test_exprs=['{test_exprs}'], ignore_test_failures=False, max_run_sec={duration}, command_args=args, varsfiles=[temp_file.name]) parallel_simple(run, machines)