Lines Matching full:host
41 Decorator to ignore ControlUnavailableError if servo host is not cros host.
47 def wrapper(self, host): argument
52 func(self, host)
54 if host.is_cros_host():
56 logging.warning("Servo host is not cros host, ignore %s: %s",
63 Verifier to trigger a servo host update, if necessary.
71 def verify(self, host): argument
72 # First, only run this verifier if the host is in the physical lab.
76 if host.is_labstation():
77 logging.info("Skip update check because the host is a"
81 if host.is_in_lab() and host.job and host.job.in_lab:
83 not host.get_dut_host_info() or
84 not host.get_dut_host_info().servo_cros_stable_version
92 host.run('cgpt repair /dev/mmcblk0', ignore_status=True)
93 host.update_image()
102 return 'servo host software is up-to-date'
114 def _get_config_val(host, config_file, attr): argument
116 Get the `attr` for `host` from `config_file`.
118 @param host Host to be checked for `config_file`.
127 attr_val = host.run(getboard, ignore_status=True).stdout
131 def _validate_attr(host, val, expected_val, attr, config_file): argument
133 Check that the attr setting is valid for the host.
142 @param host Host to be checked for `config_file`.
157 def _get_config(self, host): argument
161 @param host Host object.
165 return '%s_%d' % (self.CONFIG_FILE, host.servo_port)
180 def verify(self, host): argument
182 Test whether the `host` has a `SERIAL` setting configured.
191 if not host.is_cros_host():
195 if host.servo_serial is None:
197 config = self._get_config(host)
198 serialval = self._get_config_val(host, config, self.ATTR)
202 % host.servo_serial
205 self._validate_attr(host, serialval, host.servo_serial, self.ATTR,
218 def verify(self, host): argument
220 Test whether the `host` has a `BOARD` setting configured.
231 if not host.is_cros_host():
233 config = self._get_config(host)
234 boardval = self._get_config_val(host, config, self.ATTR)
237 if host.servo_board is not None:
238 msg += '; should be %s' % host.servo_board
241 self._validate_attr(host, boardval, host.servo_board, self.ATTR,
251 def verify(self, host): argument
252 if not host.is_cros_host():
254 status_cmd = 'status servod PORT=%d' % host.servo_port
255 job_status = host.run(status_cmd, ignore_status=True).stdout
259 (host.hostname, host.servo_port))
272 def verify(self, host): argument
274 host.check_diskspace('/mnt/stateful_partition', 0.5)
291 def verify(self, host): argument
292 host.initilize_servo()
313 def verify(self, host): argument
315 host.initialize_dut_for_servo()
340 def verify(self, host): argument
343 if host.get_servo().has_control(command):
345 host.get_servo().get(command)
350 def _is_applicable(self, host): argument
353 return (host.get_servo()
354 and host.get_servo().get_main_servo_device() == 'ccd_cr50')
372 def verify(self, host): argument
373 if not host.get_servo().has_control('cr50_testlab'):
378 status = host.get_servo().get('cr50_testlab')
387 def _is_applicable(self, host): argument
390 return (host.get_servo()
391 and host.get_servo().get_main_servo_device() == 'ccd_cr50')
414 def verify(self, host): argument
415 if host.get_servo().get('servo_v4_role') == 'snk':
422 # do not pass host since host does not inherit from CrosHost.
424 host=None,
425 servo=host.get_servo(),
429 # if control makes it here, we successfully changed the host
440 result = host.get_servo().get('servo_v4_role')
444 'hostname': host.get_dut_hostname() or 'unknown',
446 'board': host.servo_board or 'unknown',
447 'model': host.servo_model or 'unknown'
453 def _is_applicable(self, host): argument
454 return (host.is_in_lab() and
455 host.get_servo().supports_built_in_pd_control())
472 def _is_usb_hub_connected(self, host): argument
485 val = host.get_servo().get('ppdut5_mv')
493 data = host._get_host_metrics_data()
502 def _is_ribbon_cable_connected(self, host): argument
514 if host.get_servo().get('cold_reset') == 'on':
518 host.get_servo().set('cold_reset', 'off')
526 def _is_dut_power_on(self, host): argument
530 return host.get_servo().get('ec_system_powerstate') == 'S0'
535 def _is_servo_v4_type_a(self, host): argument
536 return (host.is_labstation()
537 and host.get_servo().has_control('servo_v4_type')
538 and host.get_servo().get('servo_v4_type') == 'type-a')
540 def _is_servo_v4_type_c(self, host): argument
541 return (host.is_labstation()
542 and host.get_servo().has_control('servo_v4_type')
543 and host.get_servo().get('servo_v4_type') == 'type-c')
545 def _is_servo_v3(self, host): argument
546 return not host.is_labstation()
562 def verify(self, host): argument
563 if self._is_servo_v4_type_a(host):
564 if not self._is_ribbon_cable_connected(host):
567 elif self._is_servo_v4_type_c(host):
570 # if not self._is_usb_hub_connected(host):
573 elif self._is_servo_v3(host):
574 if not self._is_ribbon_cable_connected(host):
580 def _is_applicable(self, host): argument
581 if host.is_ec_supported():
600 def verify(self, host): argument
601 if self._is_servo_v4_type_a(host):
602 if (self._is_dut_power_on(host)
603 and not self._is_usb_hub_connected(host)):
607 def _is_applicable(self, host): argument
608 if host.is_ec_supported():
623 def verify(self, host): argument
624 topology = servo_topology.ServoTopology(host)
625 topology.read(host.get_dut_host_info())
632 dual_set=host.is_dual_setup(),
637 def _is_applicable(self, host): argument
638 if host.is_localhost():
642 if not host.is_servo_topology_supported():
667 def verify(self, host): argument
668 if host.servo_board in self._BOARDS_WO_PWR_BUTTON:
671 button = host.get_servo().get('pwr_button')
680 def _is_applicable(self, host): argument
681 return (host.get_servo() and host.get_servo().main_device_is_flex())
693 def verify(self, host): argument
695 servo = host.get_servo()
713 'board': host.servo_board or 'unknown',
714 'model': host.servo_model or 'unknown',
723 def _is_applicable(self, host): argument
724 if not host.is_ec_supported():
727 dut_info = host.get_dut_host_info()
729 host_info = host.get_dut_host_info()
733 servo = host.get_servo()
752 def verify(self, host): argument
754 lid_open = host.get_servo().get('lid_open')
775 def verify(self, host): argument
776 if host.is_ec_supported():
779 ec_board_name = host.get_servo().get_ec_board()
797 def repair(self, host): argument
798 if not host.is_cros_host():
803 host.restart_servod()
817 labstation host multiple servos and need do an synchronized reboot.
821 def repair(self, host): argument
822 super(_ServoRebootRepair, self).repair(host)
824 host.restart_servod()
826 def _is_applicable(self, host): argument
827 if host.is_localhost() or not host.is_cros_host():
832 if host.is_labstation():
833 host.request_reboot()
841 return 'Reboot the servo host.'
855 def repair(self, host): argument
856 host.stop_servod()
857 self._reset_usbc_pigtail_connection(host)
858 host.restart_servod()
860 def _is_applicable(self, host): argument
861 if host.is_localhost() or not host.is_labstation():
863 if not host.servo_serial:
865 return self._is_type_c(host)
867 def _is_type_c(self, host): argument
868 if host.get_dut_host_info():
869 servo_type = host.get_dut_host_info().get_label_value(
874 def _reset_usbc_pigtail_connection(self, host): argument
888 (cc_command, host.servo_serial))
889 resp = host.run(cmd, timeout=host.DEFAULT_TERMINAL_TIMEOUT)
915 def _is_applicable(self, host): argument
916 return (not host.is_localhost()) and host.is_ec_supported()
919 def repair(self, host): argument
920 host.get_servo().ec_reboot()
937 def repair(self, host): argument
938 host.get_servo().get_power_state_controller().reset()
940 lid_open = host.get_servo().get('lid_open')
963 def repair(self, host): argument
964 if host.is_localhost():
969 host.run('/usr/bin/find /var/log/servod_* -mtime +%d -print -delete'
974 host.run('rm %s' % path, ignore_status=True)
988 def repair(self, host): argument
989 if not host.is_cros_host():
994 servo = host.get_servo()
1000 servo_updater.update_servo_firmware(host,
1009 dhp = host.get_dut_health_profile()
1011 host.restart_servod()
1026 def _is_applicable(self, host): argument
1027 return (not host.is_localhost() and host.get_dut_health_profile()
1028 and self.is_time_to_try(host.get_dut_health_profile()))