Lines Matching +full:is +full:- +full:arguments
3 # Use of this source code is governed by a BSD-style license that can be
10 case is for deployment of DUTs that have just been placed in the lab
11 for the first time. The second use case is for use after repairing
29 servo is generally in good order.
30 * For the full deployment case, install dev-signed RO firmware
39 * Every servo host is up and running, and accessible via SSH.
40 * There is a known, working test image that can be staged and
84 _LOG_FORMAT = '%(asctime)s | %(levelname)-10s | %(message)s'
92 _LOG_BUCKET_NAME = 'chromeos-install-logs'
94 _OMAHA_STATUS = 'gs://chromeos-build-release-console/omaha_status.json'
109 """Exception when there is no servo port stored in the AFE."""
135 def _get_upload_log_path(arguments): argument
138 name=arguments.upload_basename)
148 utils.run(['gsutil', 'cp', '-r', '--', dirpath, gspath])
156 describes what version Omaha is currently serving for all boards
163 R##-####.#.#. Will return `None` if no Beta channel
164 entry is found.
166 ret = utils.run(['gsutil', 'cat', '--', _OMAHA_STATUS])
168 omaha_board = board.replace('_', '-')
174 return 'R%s-%s' % (milestone, build)
179 def _update_build(afe, report_log, arguments): argument
180 raise RuntimeError("site_utils.deployment::_update_build is intentionally deleted")
187 This host object is used to update AFE label information for the DUT, but
207 The lock action is logged regardless of success; failures are
228 The unlock action is logged regardless of success; failures are
308 The given `afe_host` is currently locked. If there's a special task
315 @return A true value if the host is idle at return, or a false value
325 # guaranteed to post-date the call to lock the DUT.
337 def _get_afe_host(afe, hostname, host_attrs, arguments): argument
340 If the host is found in the database, return the object
343 If no host is found, create one with appropriate servo
350 @param arguments Command line arguments with options.
369 # This host was pre-existing; if the user didn't supply
372 if host_attrs and not arguments.labstation:
379 if not arguments.labstation:
382 # Correct board/model label is critical to installation. Always ensure user
384 _ensure_label_in_afe(afe_host, 'board', arguments.board)
385 _ensure_label_in_afe(afe_host, 'model', arguments.model)
398 @raises InstallFailedError if supplied board is different from existing
418 def _create_host_for_installation(host, arguments): argument
421 The host object yielded by the returned context manager is agnostic of the
426 @param arguments: Parsed commandline arguments for this script.
433 return preparedut.create_cros_host(host.hostname, arguments.board,
434 arguments.model, s_host, s_port,
435 s_serial, arguments.logdir)
439 def _install_test_image(host, arguments): argument
446 @param arguments Command line arguments with options.
450 if arguments.dry_run:
452 if arguments.stageusb:
458 if arguments.install_test_image:
463 raise Exception('chromeos-install failed')
464 if arguments.install_firmware:
466 if arguments.using_servo:
470 logging.debug('Install FW by chromeos-firmwareupdate.')
475 'Flashing firmware using servo' if arguments.using_servo
476 else 'chromeos-firmwareupdate')
478 if arguments.reinstall_test_image:
483 raise Exception('chromeos-install failed')
484 if arguments.install_test_image and arguments.install_firmware:
496 def _install_and_update_afe(afe, hostname, host_attrs, arguments): argument
499 First, lock the host if it exists and is unlocked. Then,
504 If installation succeeds, make sure the DUT is in the AFE,
511 @param arguments Command line arguments with options.
514 arguments)
518 if arguments.labstation:
521 with _create_host_for_installation(host, arguments) as target_host:
522 _install_test_image(target_host, arguments)
525 if ((arguments.install_test_image or arguments.reinstall_test_image)
526 and not arguments.dry_run):
538 if version and not arguments.dry_run:
545 if host is not None:
553 def _install_dut(arguments, host_attr_dict, hostname): argument
556 @param arguments Command line arguments with options.
569 # we make any AFE calls. Note that this is reasonable because we're
572 logpath = os.path.join(arguments.logdir, hostname + '.log')
577 afe = frontend.AFE(server=arguments.web)
581 arguments)
596 @param report_log File-like object for logging report
614 def _report_results(afe, report_log, hostnames, results, arguments): argument
622 @param report_log File-like object for logging report output.
627 @param arguments Command line arguments with options.
633 if result is None:
647 if arguments.labstation:
717 @returns a free servo port if servo_hostname is non-empty, otherwise an
724 # inferred from the dut hostname (by appending '-servo' to it). We only
737 # Range is taken from servod.py in hdctools.
739 end_port = start_port - 99
741 for port in xrange(start_port, end_port - 1, -1):
760 @raises _NoAFEServoPortError: When there is no stored host info or servo
790 # dict of lists where the key is the servo_host and the val is a list of
796 # servo host hostname and the servo port is set, use that port.
822 def install_duts(arguments): argument
827 the main difference is that full deployment includes flashing
828 dev-signed firmware on the DUT prior to installing the test
831 @param arguments Command line arguments with options, as
834 arguments = cmdvalidate.validate_arguments(arguments)
835 if arguments is None:
837 sys.stderr.write('Installation output logs in %s\n' % arguments.logdir)
848 logging_file_path = os.path.join(arguments.logdir, 'debug.log')
852 report_log_path = os.path.join(arguments.logdir, 'report.log')
855 afe = frontend.AFE(server=arguments.web)
856 if arguments.dry_run:
857 report_log.write('Dry run - installation and most testing '
859 host_attr_dict = _get_host_attributes(arguments.host_info_list, afe)
860 install_pool = multiprocessing.Pool(len(arguments.hostnames))
861 install_function = functools.partial(_install_dut, arguments,
863 results_list = install_pool.map(install_function, arguments.hostnames)
864 _report_results(afe, report_log, arguments.hostnames, results_list,
865 arguments)
867 if arguments.upload:
869 gspath = _get_upload_log_path(arguments)
871 _upload_logs(arguments.logdir, gspath)
873 upload_failure_log_path = os.path.join(arguments.logdir,
906 raise InstallFailedError('Current OS on host %s is not a labstation'
910 ' this can be caused by host is unsshable.')
914 # as well, which is currently obtained from repair job.
920 serial_number = host.run('vpd -g serial_number',