Lines Matching +full:is +full:- +full:arguments
3 # Use of this source code is governed by a BSD-style license that can be
57 'Cannot determine board, please specify a --board option.')
67 'Cannot determine model, please specify a --model option.')
73 def validate_arguments(arguments): argument
75 Validates parsed arguments.
77 @param arguments: arguments object, as parsed by ParseArguments
78 @raises: ValueError if arguments were invalid.
80 if arguments.remote == ':lab:':
81 if arguments.args:
82 raise ValueError('--args flag not supported when running against '
84 if arguments.pretend:
85 raise ValueError('--pretend flag not supported when running '
87 if arguments.ssh_verbosity:
88 raise ValueError('--ssh_verbosity flag not supported when running '
90 if not arguments.board or arguments.build == test_runner_utils.NO_BUILD:
91 raise ValueError('--board and --build are both required when '
94 if arguments.web:
95 raise ValueError('--web flag not supported when running locally')
98 json.loads(arguments.host_attributes)
100 raise ValueError("--host_attributes must be quoted dict, got: %s" %
101 arguments.host_attributes)
106 Parse command line arguments
109 @returns: parsed arguments
110 @raises SystemExit if arguments are malformed, or required arguments
118 Parse command line arguments
121 @returns: tuple of parsed arguments and argv suitable for remote runs
122 @raises SystemExit if arguments are malformed, or required arguments
134 'package for the build specified with --build, '
138 parser.add_argument('-b', '--board', metavar='BOARD',
142 parser.add_argument('-m',
143 '--model',
147 parser.add_argument('-i', '--build', metavar='BUILD',
152 'link-paladin/R34-5222.0.0-rc2, '
153 'lumpy-release/R34-5205.0.0')
154 parser.add_argument('-p', '--pool', metavar='POOL', default='suites',
156 'Default is "suites"')
157 parser.add_argument('--autotest_dir', metavar='AUTOTEST_DIR',
160 parser.add_argument('--no-quickmerge', action='store_true', default=False,
163 'as it currently is. May result in un-merged '
165 'run. If using --autotest_dir, this flag is '
167 parser.add_argument('--allow-chrome-crashes',
174 parser.add_argument('--ssh_private_key', action='store',
178 '--companion_hosts',
182 parser.add_argument('--dut_servers',
186 parser.add_argument('--minus',
191 parser.add_argument('--py_version',
196 parser.add_argument('--CFT',
201 parser.add_argument('--host_attributes',
205 parser.add_argument('--host_labels',
209 parser.add_argument('--label',
218 Strips out arguments that are not to be passed through to runs.
220 Add any arguments that should not be passed to remote test_that runs here.
226 parser.add_argument('-w', '--web', dest='web', default=None,
228 parser.add_argument('-x', '--max_runtime_mins', type=int,
231 parser.add_argument('--no-retries', '--no-retry',
239 def perform_bootstrap_into_autotest_root(arguments, autotest_path, argv): argument
243 This function is to be called from test_that's main() script, when
244 test_that is executed from the source tree location. It runs
245 autotest_quickmerge to update the sysroot unless arguments.no_quickmerge
246 is set. It then executes and waits on the version of test_that.py
249 @param arguments: A parsed arguments object, as returned from
252 @param argv: The arguments list, as passed to main(...)
260 verbose=arguments.debug)
261 if arguments.no_quickmerge:
265 command = [_QUICKMERGE_SCRIPTNAME, '--board='+arguments.board]
277 logging.info('Re-running test_that script in %s copy of autotest.',
287 #pylint: disable-msg=C0111
298 def _main_for_local_run(argv, arguments): argument
302 @param argv: Script command line arguments.
303 @param arguments: Parsed command line arguments.
306 arguments.results_dir, arguments.board)
308 arguments.ssh_private_key)
309 arguments.results_dir = results_directory
311 # If the board and/or model is not specified through --board and/or
312 # --model, and is not set in the default_board file, determine the board by
313 # ssh-ing into the host. Also prepend it to argv so we can re-use it when we
315 arguments.board, arguments.model = _get_info_from_host(
316 arguments.remote,
317 arguments.board,
318 arguments.model,
319 ssh_options=arguments.ssh_options)
320 argv = ['--board=%s' % (arguments.board, )] + argv
321 argv = ['--model=%s' % (arguments.model, )] + argv
323 if arguments.autotest_dir:
324 autotest_path = arguments.autotest_dir
325 arguments.no_quickmerge = True
327 sysroot_path = os.path.join('/build', arguments.board, '')
342 '--autotest_dir, make sure it points to '
350 # a quickmerge if necessary and then re-execute
351 # the sysroot version of script with the same arguments.
354 arguments, autotest_path, argv)
359 arguments.tests,
360 arguments.remote,
361 build=arguments.build,
362 board=arguments.board,
363 model=arguments.model,
364 args=arguments.args,
365 ignore_deps=not arguments.enforce_deps,
367 ssh_verbosity=arguments.ssh_verbosity,
368 ssh_options=arguments.ssh_options,
369 iterations=arguments.iterations,
370 fast_mode=arguments.fast_mode,
371 debug=arguments.debug,
372 allow_chrome_crashes=arguments.allow_chrome_crashes,
373 pretend=arguments.pretend,
374 job_retry=arguments.retry,
375 companion_hosts=arguments.companion_hosts,
376 minus=arguments.minus,
377 dut_servers=arguments.dut_servers,
378 is_cft=arguments.CFT,
379 host_attributes=json.loads(arguments.host_attributes),
380 host_labels=arguments.host_labels,
381 label=arguments.label)
384 def _main_for_lab_run(argv, arguments): argument
388 @param argv: Script command line arguments.
389 @param arguments: Parsed command line arguments.
397 '--board=%s' % (arguments.board,),
398 '--build=%s' % (arguments.build,),
399 '--model=%s' % (arguments.model,),
400 '--suite_name=%s' % 'test_that_wrapper',
401 '--pool=%s' % (arguments.pool,),
402 '--max_runtime_mins=%s' % str(arguments.max_runtime_mins),
403 '--suite_args=%s'
405 if arguments.web:
406 command.extend(['--web=%s' % (arguments.web,)])
415 This is passed in suite_args to run_suite for running a test in the
418 @param argv: Remote Script command line arguments.
420 arguments = parse_arguments(argv)
421 return arguments.tests
428 @param argv: arguments list
430 arguments, remote_argv = _parse_arguments_internal(argv)
432 validate_arguments(arguments)
434 print(('Invalid arguments. %s' % str(err)), file=sys.stderr)
437 if arguments.remote == ':lab:':
438 return _main_for_lab_run(remote_argv, arguments)
440 return _main_for_local_run(argv, arguments)