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 = 'tast.storage-qual-quick' 9TIME = 'MEDIUM' 10TEST_TYPE = 'Server' 11ATTRIBUTES = 'suite:storage_qual_v2_quick' 12MAX_RESULT_SIZE_KB = 1024 * 1024 13PY_VERSION = 3 14 15# tast.py uses binaries installed from autotest_server_package.tar.bz2. 16REQUIRE_SSP = True 17 18DOC = ''' 19Run the Tast-based storage qualification quick test. 20 21Tast is an integration-testing framework analagous to the test-running portion 22of Autotest. See https://chromium.googlesource.com/chromiumos/platform/tast/ for 23more information. 24 25See http://go/tast-failures for information about investigating failures. 26''' 27 28import tempfile 29import yaml 30 31utils.write_keyval(job.resultdir, { 32 'storage_qual_version': 2, 33 'bug_id': bug_id, 34 'part_id': part_id 35}) 36 37def run(machine): 38 args_dict = globals().get('args_dict', {}) 39 test_exprs = args_dict.get('test_exprs', 'storage.QuickStress.*').split(',') 40 max_run_sec = args_dict.get('max_run_sec', 12 * 60 * 60) 41 42 with tempfile.NamedTemporaryFile(suffix='.yaml') as temp_file: 43 # Writing test arguments to yaml file except for wrapper-related arguments. 44 test_args = dict() 45 tast_prefix = 'tast_' 46 for key, value in args_dict.items(): 47 # TODO(b/185932989): get rid of 'tast_' prefix for var names. 48 if key.startswith(tast_prefix): 49 test_args[key] = value 50 yaml.dump(test_args, stream=temp_file, default_flow_style=False) 51 52 job.run_test('tast', 53 host=hosts.create_host(machine), 54 test_exprs=test_exprs, 55 ignore_test_failures=False, 56 max_run_sec=max_run_sec, 57 command_args=args, 58 varsfiles=[temp_file.name]) 59 60parallel_simple(run, machines) 61