blob: d430cdea9874e1e577409731043f1f76c1f0506b [file] [log] [blame]
Aviv Keshet7cd12312013-07-25 10:25:55 -07001# Copyright (c) 2012 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
5AUTHOR = "akeshet, chromeos-lab-infrastructure"
6NAME = "test_that_wrapper"
7PURPOSE = "Wrapper for ad-hoc suites kicked of by test_that tool."
8CRITERIA = "All tests must pass."
9
10TIME = "SHORT"
11TEST_CATEGORY = "General"
12TEST_CLASS = "suite"
13TEST_TYPE = "Server"
14
15DOC = """
16This is a wrapper suite for lab jobs that get kicked off by developers
17running the test_that tool on their desks, but targetting devices in the lab.
18
19@param build: The name of the image to test.
20 Ex: x86-mario-release/R17-1412.33.0-a1-b29
21@param board: The board to test on. Ex: x86-mario
22@param pool: The pool of machines to utilize for scheduling. If pool=None
23 board is used.
24@param check_hosts: require appropriate live hosts to exist in the lab.
25@param SKIP_IMAGE: (optional) If present and True, don't re-image devices.
26"""
27
28import logging, shlex
29
30import common
31from autotest_lib.server.cros.dynamic_suite import dynamic_suite
32from autotest_lib.site_utils import test_that
33from autotest_lib.server.cros import provision
34
35# Values specified in this bug template will override default values when
36# filing bugs on tests that are a part of this suite. If left unspecified
37# the bug filer will fallback to it's defaults.
38_BUG_TEMPLATE = {
39 'labels': ['test_that_wrapper'],
40 'owner': '',
41 'status': None,
42 'summary': None,
43 'title': None,
44 'ccs': ['beeps@chromium.org']
45}
46
47
48try:
49 arguments = test_that.parse_arguments(shlex.split(suite_args))
50except SystemExit:
51 logging.error('Unable to parse test_that arguments %s, suite aborting',
52 shlex.split(suite_args))
53 raise
54
55parsed_test_arguments = [test_that.get_predicate_for_test_arg(test_arg)
56 for test_arg in arguments.tests]
57sub_predicates, descriptions = zip(*parsed_test_arguments)
58
59logging.info('This is a test_that triggered suite, consisting of:')
60for desc in descriptions:
61 logging.info('A %s.', desc)
62
63combined_predicate = lambda test: any(f(test) for f in sub_predicates)
64
65dynamic_suite.reimage_and_run(
66 build=build, board=board, name=NAME, job=job, pool=pool,
67 check_hosts=check_hosts, add_experimental=True, num=num,
Simran Basi07511372013-11-26 11:22:52 -080068 file_bugs=file_bugs, priority=priority, timeout_mins=timeout_mins,
Aviv Keshet7cd12312013-07-25 10:25:55 -070069 max_runtime_mins=20, bug_template=_BUG_TEMPLATE,
70 devserver_url=devserver_url, version_prefix=provision.CROS_VERSION_PREFIX,
Fang Deng70a9ead2014-05-16 16:57:39 -070071 predicate=combined_predicate, wait_for_results=wait_for_results,
Fang Deng7c48ecb2015-01-06 11:08:32 -080072 job_retry=job_retry, max_retries=max_retries)