Lines Matching full:host
6 Framework for host verification and repair in Autotest.
8 The framework provides implementation code in support of `Host.verify()`
9 and `Host.repair()` used in Verify and Repair special tasks.
38 _HOSTNAME_PATTERN = 'chromeos[0-9]-row[0-9]+[a-z]?-rack[0-9]+[a-z]?-host[0-9]+'
63 conclude the target host is in a bad state.
188 def _is_applicable(self, host): argument
190 Check if the action is applicable to target host. Subclasses
193 @param host Target host to check.
198 def _record(self, host, silent, status_code, *record_args): argument
200 Log a status record for `host`.
202 Call `host.record()` using the given status_code, and
206 @param host Host which will record the status record.
210 `host.record()`.
212 `host.record()`.
215 host.record(status_code, None, self._record_tag,
218 def _record_good(self, host, silent): argument
221 @param host Host which will record the status record.
225 self._record(host, silent, 'GOOD')
227 def _record_fail(self, host, silent, exc): argument
230 @param host Host which will record the status record.
235 self._record(host, silent, 'FAIL', str(exc))
237 def _verify_list(self, host, verifiers, silent): argument
239 Test a list of verifiers against a given host.
253 @param host The host to be tested against the verifiers.
255 @param silent If true, don't log host status records.
263 v._verify_host(host, silent)
274 def _verify_dependencies(self, host, silent): argument
276 Verify that all of this node's dependencies pass for a host.
278 @param host The host to be verified.
279 @param silent If true, don't log host status records.
282 self._verify_list(host, self._dependency_list, silent)
343 determine a host's fitness for testing. Failure indicates that the
372 Host is available via ssh
400 def _verify_host(self, host, silent): argument
412 @param host The host to be tested for a problem.
413 @param silent If true, don't log host status records.
415 self._verify_dependencies(host, silent)
417 if not self._is_applicable(host):
420 self.tag, self.description, host.hostname)
436 self.verify(host)
437 self._record_good(host, silent)
444 self._record_fail(host, silent, e)
446 # available to the host class.
447 if hasattr(host, 'health_profile') and host.health_profile:
448 host.health_profile.insert_failed_verifier(self.tag)
455 def verify(self, host): argument
460 host. Implementations should follow these guidelines:
487 @param host The host to be tested for a problem.
557 def _record_start(self, host, silent): argument
560 @param host Host which will record the status record.
564 self._record(host, silent, 'START')
566 def _record_end_good(self, host, silent): argument
569 @param host Host which will record the status record.
573 self._record(host, silent, 'END GOOD')
576 def _record_end_fail(self, host, silent, status, *args): argument
579 @param host Host which will record the status record.
584 self._record(host, silent, 'END FAIL', *args)
587 def _send_failure_metrics(self, host, error, stage): argument
590 @param host Host which this RepairAction targeted to.
604 'hostname': _filter_metrics_hostname(host),
631 def _repair_host(self, host, silent): argument
644 @param host The host to be repaired.
645 @param silent If true, don't log host status records.
654 self._verify_dependencies(host, silent)
656 self._send_failure_metrics(host, e, 'dep')
661 if not self._is_applicable(host):
674 self._verify_list(host, self._trigger_list, silent)
679 self._send_failure_metrics(host, e, 'pre')
680 self._record_start(host, silent)
682 self.repair(host)
684 # available to the host class.
685 if hasattr(host, 'health_profile') and host.health_profile:
686 host.health_profile.insert_succeed_repair_action(self.tag)
689 self._record_fail(host, silent, e)
690 self._record_end_fail(host, silent, 'repair_failure')
691 self._send_failure_metrics(host, e, 'repair')
693 # available to the host class.
694 if hasattr(host, 'health_profile') and host.health_profile:
695 host.health_profile.insert_failed_repair_action(self.tag)
700 self._verify_list(host, self._trigger_list, silent)
701 self._record_end_good(host, silent)
706 self._record_end_fail(host, silent, 'verify_failure')
707 self._send_failure_metrics(host, e, 'post')
714 self._record_end_fail(host, silent, 'unknown',
716 self._send_failure_metrics(host, e, 'post')
723 def repair(self, host): argument
725 Apply this repair action to the given host.
744 @param host The host to be repaired.
759 def verify(self, host): argument
764 return 'All host verification checks pass'
892 class of host this repair strategy target
927 def _send_strategy_metrics(self, host, result): argument
930 @param host The target to be repaired.
934 info = host.host_info_store.get()
940 'hostname': _filter_metrics_hostname(host),
946 def _send_action_metrics(self, host, ra): argument
949 @param host The target to be repaired.
955 'hostname': _filter_metrics_hostname(host),
960 def verify(self, host, silent=False): argument
962 Run the verifier DAG on the given host.
964 @param host The target to be verified.
965 @param silent If true, don't log host status records.
968 self._verify_root._verify_host(host, silent)
970 def repair(self, host, silent=False): argument
972 Run the repair list on the given host.
974 @param host The target to be repaired.
975 @param silent If true, don't log host status records.
982 ra._repair_host(host, silent)
988 self._send_action_metrics(host, ra)
995 self._verify_root._verify_host(host, silent)
1002 self._send_strategy_metrics(host, result)
1046 def _filter_metrics_hostname(host): argument
1050 @param host An host instance(i.e. ServoHost, CrosHost)
1052 if re.match(_HOSTNAME_PATTERN, host.hostname):
1053 return host.hostname