blob: 715dbd5fff795370d3b8a4ab176e9820e88be1b1 [file] [log] [blame]
Shuqian Zhaod28312f2015-05-11 13:56:10 -07001# Copyright 2015 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 = "shuqianz, chromeos-infra"
6NAME = "suite_attr_wrapper"
7
8TIME = "SHORT"
9TEST_CATEGORY = "General"
10TEST_CLASS = "suite"
11TEST_TYPE = "Server"
12
13DOC = """
14This is a wrapper suite to trigger tests that satisfy any attribute boolean
15expression.
16
17@param build: The name of the image to test.
18 Ex: x86-mario-release/R17-1412.33.0-a1-b29
19@param board: The board to test on. Ex: x86-mario
20@param pool: The pool of machines to utilize for scheduling. If pool=None
21 board is used.
22@param check_hosts: require appropriate live hosts to exist in the lab.
23@param SKIP_IMAGE: (optional) If present and True, don't re-image devices.
24"""
Allen Lie21ed7e2017-07-11 11:59:40 -070025import logging
Shuqian Zhaod28312f2015-05-11 13:56:10 -070026
27import common
28from autotest_lib.server.cros.dynamic_suite import dynamic_suite
29from autotest_lib.server.cros.dynamic_suite import suite
Shuqian Zhaod28312f2015-05-11 13:56:10 -070030
Shuqian Zhaod28312f2015-05-11 13:56:10 -070031# Get the predicate object from attr_filter argument
Allen Li3c0d6cb2017-08-21 17:05:57 -070032
Shuqian Zhaod28312f2015-05-11 13:56:10 -070033try:
Allen Lie21ed7e2017-07-11 11:59:40 -070034 attr = args_dict['attr_filter']
Shuqian Zhaod28312f2015-05-11 13:56:10 -070035 attr_predicate = suite.Suite.matches_attribute_expression_predicate(attr)
36except KeyError:
37 logging.error('Unable to find the attribute boolean expression used to '
38 'trigger tests in suite_args %s, please use attr_filter '
Allen Lie21ed7e2017-07-11 11:59:40 -070039 'keyword to specify it. suite aborting' % args_dict)
Shuqian Zhaod28312f2015-05-11 13:56:10 -070040 raise
41
Shuqian Zhaod28312f2015-05-11 13:56:10 -070042args_dict['predicate'] = attr_predicate
43args_dict.setdefault('name', NAME)
Shuqian Zhao24785cc2015-06-01 16:32:18 -070044args_dict['job'] = job
Shuqian Zhaod28312f2015-05-11 13:56:10 -070045
Shuqian Zhao24785cc2015-06-01 16:32:18 -070046dynamic_suite.reimage_and_run(**args_dict)