| # Copyright 2020 The Chromium OS Authors. All rights reserved. |
| # Use of this source code is governed by a BSD-style license that can be |
| # found in the LICENSE file. |
| |
| # This file is not auto-generated. Don't delete it. |
| |
| # Boring. |
| import logging |
| import pprint |
| from autotest_lib.client.bin import utils |
| |
| usage = """ |
| 1) To run agains a particular $DUT use |
| test_that --args="module=CtsDeqpTestCases test=dEQP-GLES31.functional.image_load_store.2d_array.atomic#exchange_r32f_return_value" $DUT cheets_CTS_R.tradefed-run-test |
| test_that --args="module=CtsViewTestCases test=android.view.cts.SurfaceViewSyncTest#testVideoSurfaceViewCornerCoverage retry=0 revision=6714044" 100.90.29.152 cheets_CTS_R.tradefed-run-test |
| |
| 2) To run against a lab pool use |
| run_suite.py --board=eve --build=$TRYJOB_BUILD --suite_name arc-cts-test --pool cts --no_wait True --priority CQ --timeout_mins 6160 --retry False --num 1 --suite_min_duts 1 --test_args="{'module' : 'CtsDeqpTestCases', 'test' : 'dEQP-GLES31.functional.image_load_store.2d_array.atomic#exchange_r32f_return_value'}" |
| """ |
| |
| def usage_error(): |
| logging.info('Example usage:') |
| logging.info(usage) |
| raise SystemExit |
| |
| pp = pprint.PrettyPrinter() |
| logging.info( |
| '***********************************************************************') |
| |
| # Define the variables that we are going to use and set sensible defaults. |
| cts_abi = 'arm' |
| cts_module = '' |
| cts_retry = 5 |
| cts_revision = None |
| cts_test = '' |
| cts_timeout = 600 |
| |
| # Pull parameters either from run_suite or test_that. |
| if 'args_dict' in vars(): |
| logging.info('Raw test options from run_suite:') |
| pp.pprint(args_dict) |
| elif args: |
| logging.info('Raw test options from test_that:') |
| pp.pprint(args) |
| args_dict = utils.args_to_dict(args) |
| else: |
| usage_error() |
| |
| cts_abi = args_dict.get('abi', cts_abi) |
| cts_module = args_dict.get('module', cts_module) |
| cts_revision = args_dict.get('revision', cts_revision) |
| cts_test = args_dict.get('test', cts_test) |
| cts_timeout = float(args_dict.get('timeout', cts_timeout)) |
| cts_retry = int(args_dict.get('max_retry', cts_retry)) |
| |
| # Basic checks for option validity. |
| logging.error('Running module %s with test %s on abi %s and revision %s', |
| cts_module, cts_test, cts_abi, cts_revision) |
| if not cts_abi or not cts_module or not cts_test: |
| usage_error() |
| |
| # And we are getting ready for tradefed. |
| uri = ('gs://chromeos-arc-images/cts/bundle/R/android-cts-' + cts_revision + |
| '-linux_x86-' + cts_abi + '.zip') if cts_revision else 'LATEST' |
| run_template = ['run', 'commandAndExit', 'cts', |
| '--include-filter', cts_module + ' ' + cts_test, |
| '--logcat-on-failure'] |
| retry_template = ['run', 'commandAndExit', 'retry', |
| '--retry', '{session_id}'] |
| # Unfortunately super long test names can cause problems. Try to get the |
| # rightmost element and use that as a simplified name. |
| # TODO(ihf): fix pipeline so it works with super long names. |
| simplified_test = cts_test |
| if '#' in cts_test: |
| simplified_test = cts_test.split('#')[-1] |
| elif '.' in cts_test: |
| simplified_test = cts_test.split('.')[-1] |
| tag = 'tradefed-run-test.%s.%s' % (cts_module, simplified_test) |
| |
| # The usual testing stanza. We are suppressing some DEPENDENCIES on purpose. |
| AUTHOR = 'ARC++ Team' |
| NAME = 'cheets_CTS_R.tradefed-run-test' |
| ATTRIBUTES = '' |
| DEPENDENCIES = 'arc' |
| JOB_RETRIES = 0 |
| TEST_TYPE = 'server' |
| TIME = 'LONG' |
| MAX_RESULT_SIZE_KB = 256000 |
| DOC = 'Run a test of the Android Compatibility Test Suite (CTS) in ARC++' |
| |
| # And launch. |
| def run_TS(machine): |
| host_list = [hosts.create_host(machine)] |
| job.run_test( |
| 'cheets_CTS_R', |
| hosts=host_list, |
| iterations=1, |
| max_retry=cts_retry, |
| needs_push_media=True, |
| tag=tag, |
| test_name=NAME, |
| run_template=run_template, |
| retry_template=retry_template, |
| target_module=None, |
| target_plan=None, |
| bundle=cts_abi, |
| use_jdk9=True, |
| uri=uri, |
| timeout=cts_timeout) |
| |
| parallel_simple(run_TS, machines) |