Lines Matching refs:host
32 def __init__(self, host): argument
33 self.host = host
41 self.tmpdir = (self.host
47 self.host.run('rm -rf %s' % (pipes.quote(self.tmpdir),))
50 def _collect_log_file_with_summary(host, source_path, dest_path): argument
58 summary_created = result_tools_runner.run_on_client(host, source_path)
62 host.get_file(source_path, dest_path, preserve_perm=False)
74 host, source_path, dest_path,
78 def collect_log_file(host, log_path, dest_path, use_tmp=False, clean=False, argument
104 if not host.check_cached_up_status():
106 'file %s.', host.hostname, log_path)
109 file_stats = _get_file_stats(host, log_path)
121 _collect_log_file_with_tmpdir(host, log_path, dest_path)
123 _collect_log_file_with_summary(host, log_path, dest_path)
133 host.run('rm -rf %s' % path_to_delete, ignore_status=True)
140 def _collect_log_file_with_tmpdir(host, log_path, dest_path): argument
148 with _RemoteTempDir(host) as tmpdir:
149 host.run('cp -rp %s %s' % (pipes.quote(log_path), pipes.quote(tmpdir)))
152 _collect_log_file_with_summary(host, source_path, dest_path)
155 def _get_file_stats(host, path): argument
166 output = host.run(cmd).stdout
169 'Default its size to 0', path, host, e)
175 'File may not exist.', output, path, host)
188 lambda host, test_start_time: None)
191 lambda host, test_start_time: None)
194 lambda host: None)
197 lambda host, host_resultdir: None)
200 lambda host: None)
205 def get_crashdumps(host, test_start_time): argument
206 get_site_crashdumps(host, test_start_time)
211 def get_crashinfo(host, test_start_time): argument
219 get_crashdumps(host, test_start_time)
221 if wait_for_machine_to_recover(host):
223 get_site_crashinfo(host, test_start_time)
225 crashinfo_dir = get_crashinfo_dir(host, 'crashinfo')
226 collect_messages(host)
227 collect_command(host, "dmesg", os.path.join(crashinfo_dir, "dmesg"))
228 collect_uncollected_logs(host)
233 collect_log_file(host, constants.LOG_DIR, log_path)
239 collect_log_file(host, pstore_dir, log_path, use_tmp=True,
246 collect_log_file(host, constants.LOG_I915_ERROR_STATE,
255 def wait_for_machine_to_recover(host, hours_to_wait=HOURS_TO_WAIT): argument
264 if host.is_up():
265 logging.info("%s already up, collecting crash info", host.hostname)
269 hours_to_wait, host.hostname, current_time)
270 if not host.wait_up(timeout=hours_to_wait * 3600):
274 host.hostname)
277 logging.info("%s is back up, collecting crash info", host.hostname)
281 def get_crashinfo_dir(host, dir_prefix): argument
289 host_resultdir = getattr(getattr(host, "job", None), "resultdir", None)
294 infodir = os.path.join(infodir, "%s.%s" % (dir_prefix, host.hostname))
300 def collect_command(host, command, dest_path): argument
314 result = host.run(command, stdout_tee=None).stdout
320 def collect_uncollected_logs(host): argument
325 if host.job:
327 logs = host.job.get_client_logs()
329 if hostname == host.hostname:
332 collect_log_file(host, remote_path + '/', local_path + '/')
338 def collect_messages(host): argument
348 crashinfo_dir = get_crashinfo_dir(host, 'crashinfo')
357 collect_log_file(host, host.VAR_LOG_MESSAGES_COPY_PATH,
359 collect_log_file(host, "/var/log/messages", messages_raw)