Lines Matching defs:servo

9 """This file provides core logic for servo verify/repair process."""
30 from autotest_lib.server.cros.servo import servo
37 # the servo_host and servo_port for a servo connected to the DUT.
49 """Raised when servo verification fails."""
54 """Raised when a repair method fails to repair a servo host."""
64 """Raised if all attempts to repair a servo host fail."""
69 """Given a DUT's hostname, return the hostname of its servo.
73 @return hostname of the DUT's servo.
77 host_parts[0] = host_parts[0] + '-servo'
82 """Host class for a host that controls a servo, e.g. beaglebone."""
86 # Timeout for rebooting servo host.
93 # Timeout for initializing servo signals.
104 A ServoHost instance represents a host that controls a servo.
109 @param required_by_test: True if servo is required by test.
110 @param is_in_lab: True if the servo host is in Cros Lab. Default is set
112 called to check if the servo host is in Cros lab.
124 # Commands on the servo host must be run by the superuser. Our account
147 """Check whether the servo host is a lab device.
149 @returns: True if the servo host is in Cros Lab, otherwise False.
156 """Checks whether the servo host points to localhost.
188 """Check if a servo host is running chromeos.
190 @return: True if the servo host is running chromeos.
252 |dest| on the remote servo host.
264 """Run a command on the servo host.
266 Extends method `run` in SSHHost. If the servo host is a remote device,
268 If the servo host is 'localhost', it will call utils.system_output.
291 when servo host is not 'localhost'.
334 servo is working. The servo could be attached to a board not supported
346 logging.info('Ignoring servo config check failure, either %s '
358 If servod is not running, there is no need to verify if servo is
361 If the servo host is set to localhost, failure of servod status check
362 will be ignored, as servo call may use ssh tunnel.
373 logging.info('Ignoring servod status check failure. servo host '
374 'is set to localhost, servo call may use ssh '
396 """Update the image on the servo host, if needed.
405 from the default for servo Hosts, trigger an update, but
455 # will log reboot failure if servo does not come back. The logged
457 # require servo, we don't want servo failure to fail the test with
459 # If servo does not come back after reboot, exception needs to be
460 # raised, so test requires servo should fail.
464 logging.info('servo host %s back from reboot, with build %s',
468 'servo host %s failed to come back from reboot.' %
472 logging.info('servo host %s already processing an update, update '
476 'servo host %s, from %s to %s', url, self.hostname,
498 logging.info('servo host %s does not require an update.',
503 """Update the servo host and verify it's in a good state.
507 1) Whether basic servo command can run successfully.
510 @raises ServoHostVerifyFailure if servo host does not pass the checks.
513 logging.info('Applying an update to the servo host, if necessary.')
518 # If servo is already initialized, we don't need to do it again, call
523 self._servo = servo.Servo(servo_host=self)
529 logging.info('Sanity checks pass on servo host %s', self.hostname)
543 """Return whether or not the servo host is powered by PoE."""
545 # For now, assume all servo hosts in the lab have power.
553 servo host.
569 """Power cycle the servo host using PoE.
571 @raises ServoHostRepairFailure if it fails to fix the servo host.
595 """Attempt to repair servo host.
605 logging.warning('Skip repairing servo host %s: Not a lab device.',
608 logging.info('Attempting to repair servo host %s.', self.hostname)
609 # Reset the cache to guarantee servo initialization being called later.
627 logging.warning('Failed to repair servo: %s', e)
633 'All attempts at repairing the servo failed:\n%s' %
638 """Get the cached servo.Servo object.
640 @return: a servo.Servo object.
667 @param dut: host name of the host that servo connects. It can be used to
668 lookup the servo in test lab using naming convention.
713 # Technically, this duplicates the SSH ping done early in the servo
717 # when our servo DNS name resolves, but there is no host at that IP.
719 # fixed. Autotest should not try to verify servo if servo is
724 logging.info('Pinging servo at %s', lab_servo_hostname)