Lines Matching refs:host
34 def __init__(self, host): argument
35 self.host = host
43 self.tmpdir = (self.host
49 self.host.run('rm -rf %s' % (pipes.quote(self.tmpdir),))
52 def _collect_log_file_with_summary(host, source_path, dest_path): argument
60 summary_created = result_tools_runner.run_on_client(host, source_path)
64 host.get_file(source_path, dest_path, preserve_perm=False)
76 host, source_path, dest_path,
80 def collect_log_file(host, log_path, dest_path, use_tmp=False, clean=False, argument
106 if not host.check_cached_up_status():
108 'file %s.', host.hostname, log_path)
111 file_stats = _get_file_stats(host, log_path)
123 _collect_log_file_with_tmpdir(host, log_path, dest_path)
125 _collect_log_file_with_summary(host, log_path, dest_path)
135 host.run('rm -rf %s' % path_to_delete, ignore_status=True)
142 def _collect_log_file_with_tmpdir(host, log_path, dest_path): argument
150 with _RemoteTempDir(host) as tmpdir:
151 host.run('cp -rp %s %s' % (pipes.quote(log_path), pipes.quote(tmpdir)))
154 _collect_log_file_with_summary(host, source_path, dest_path)
157 def _get_file_stats(host, path): argument
168 output = host.run(cmd).stdout
171 'Default its size to 0', path, host, e)
177 'File may not exist.', output, path, host)
190 lambda host, test_start_time: None)
193 lambda host, test_start_time: None)
196 lambda host: None)
199 lambda host, host_resultdir: None)
202 lambda host: None)
207 def get_crashdumps(host, test_start_time): argument
208 get_site_crashdumps(host, test_start_time)
213 def get_crashinfo(host, test_start_time): argument
221 get_crashdumps(host, test_start_time)
223 if wait_for_machine_to_recover(host):
225 get_site_crashinfo(host, test_start_time)
227 crashinfo_dir = get_crashinfo_dir(host, 'crashinfo')
228 collect_messages(host)
229 collect_command(host, "dmesg", os.path.join(crashinfo_dir, "dmesg"))
230 collect_uncollected_logs(host)
235 collect_log_file(host, constants.LOG_DIR, log_path)
241 collect_log_file(host, pstore_dir, log_path, use_tmp=True,
248 collect_log_file(host, constants.LOG_I915_ERROR_STATE,
257 def wait_for_machine_to_recover(host, hours_to_wait=HOURS_TO_WAIT): argument
266 if host.is_up():
267 logging.info("%s already up, collecting crash info", host.hostname)
271 hours_to_wait, host.hostname, current_time)
272 if not host.wait_up(timeout=hours_to_wait * 3600):
276 host.hostname)
279 logging.info("%s is back up, collecting crash info", host.hostname)
283 def get_crashinfo_dir(host, dir_prefix): argument
291 host_resultdir = getattr(getattr(host, "job", None), "resultdir", None)
296 infodir = os.path.join(infodir, "%s.%s" % (dir_prefix, host.hostname))
302 def collect_command(host, command, dest_path): argument
316 result = host.run(command, stdout_tee=None).stdout
322 def collect_uncollected_logs(host): argument
327 if host.job:
329 logs = host.job.get_client_logs()
331 if hostname == host.hostname:
334 collect_log_file(host, remote_path + '/', local_path + '/')
340 def collect_messages(host): argument
350 crashinfo_dir = get_crashinfo_dir(host, 'crashinfo')
359 collect_log_file(host, host.VAR_LOG_MESSAGES_COPY_PATH,
361 collect_log_file(host, "/var/log/messages", messages_raw)