David Haddock | 1479fc6 | 2016-10-24 17:06:01 -0700 | [diff] [blame] | 1 | # Copyright 2016 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 | |
| 5 | AUTHOR = "ARC++ Team" |
| 6 | NAME = "gts" |
| 7 | PURPOSE = "GTS tests for ARC++" |
| 8 | CRITERIA = "All tests with SUITE=gts must pass." |
| 9 | |
| 10 | TIME = "SHORT" |
| 11 | TEST_CATEGORY = "General" |
| 12 | TEST_CLASS = "suite" |
| 13 | TEST_TYPE = "Server" |
| 14 | |
| 15 | DOC = """ |
| 16 | This suite wraps the current GTS bundle for autotest. |
| 17 | """ |
| 18 | |
| 19 | import common |
| 20 | from autotest_lib.server.cros import provision |
| 21 | from autotest_lib.server.cros.dynamic_suite import dynamic_suite |
| 22 | |
| 23 | |
Keith Haddow | 7e074d5 | 2017-05-23 11:51:52 -0700 | [diff] [blame] | 24 | def predicate(test): |
| 25 | if not hasattr(test, 'suite') or not hasattr(test, 'name'): |
| 26 | return False |
| 27 | if not test.suite == NAME: |
| 28 | return False |
| 29 | # Strip off the cheets_GTS. from the test name before comparing to args |
Allen Li | 5272c9e | 2017-08-23 18:42:05 -0700 | [diff] [blame] | 30 | name = test.name[test.name.find('.') + 1:] |
Allen Li | 3c0d6cb | 2017-08-21 17:05:57 -0700 | [diff] [blame] | 31 | # TODO(crbug.com/758427): suite_args needed to support being run by old Autotest |
| 32 | try: |
Allen Li | 905d6a3 | 2017-08-30 12:46:53 -0700 | [diff] [blame] | 33 | if suite_args and name not in suite_args: |
Allen Li | 3c0d6cb | 2017-08-21 17:05:57 -0700 | [diff] [blame] | 34 | return False |
| 35 | except NameError: |
| 36 | pass |
Allen Li | 905d6a3 | 2017-08-30 12:46:53 -0700 | [diff] [blame] | 37 | if 'tests' in args_dict and name not in args_dict['tests']: |
| 38 | return False |
Keith Haddow | 7e074d5 | 2017-05-23 11:51:52 -0700 | [diff] [blame] | 39 | return True |
| 40 | |
David Haddock | 1479fc6 | 2016-10-24 17:06:01 -0700 | [diff] [blame] | 41 | args_dict['name'] = NAME |
| 42 | args_dict['job'] = job |
| 43 | args_dict['add_experimental'] = True |
| 44 | args_dict['version_prefix'] = provision.CROS_VERSION_PREFIX |
Keith Haddow | 7e074d5 | 2017-05-23 11:51:52 -0700 | [diff] [blame] | 45 | args_dict['predicate'] = predicate |
David Haddock | 1479fc6 | 2016-10-24 17:06:01 -0700 | [diff] [blame] | 46 | dynamic_suite.reimage_and_run(**args_dict) |
| 47 | |