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'
14PRIORITY = {priority}
15MAX_RESULT_SIZE_KB = 1024 * 1024
16JOB_RETRIES = 0
17REQUIRE_SSP = True
18
19DOC = '''
20Run the Tast-based storage qualification quick test.
21
22Tast is an integration-testing framework analogous to the test-running portion
23of Autotest. See https://chromium.googlesource.com/chromiumos/platform/tast/ for
24more information.
25
26See http://go/tast-failures for information about investigating failures.
27'''
28import tempfile
29import yaml
30
31keyval = dict()
32keyval['storage_qual_version'] = {version}
33keyval['bug_id'] = bug_id
34keyval['part_id'] = part_id
35utils.write_keyval(job.resultdir, keyval)
36
37def run(machine):
38    args_dict = globals().get('args_dict', dict())
39
40    with tempfile.NamedTemporaryFile(suffix='.yaml') as temp_file:
41        # Writing test arguments to yaml file except for wrapper-related arguments.
42        test_args = dict()
43        for key in args_dict:
44            if key.startswith('tast_'):
45                test_args[key] = args_dict[key]
46        yaml.dump(test_args, stream=temp_file, default_flow_style=False)
47
48        job.run_test('tast',
49                    host=hosts.create_host(machine),
50                    test_exprs=['{test_exprs}'],
51                    ignore_test_failures=False,
52                    max_run_sec={duration},
53                    command_args=args,
54                    varsfiles=[temp_file.name])
55
56parallel_simple(run, machines)
57