Lines Matching refs:host

72     def __init__(self, host=None):  argument
73 self.host = host
90 def get_client_autodir_paths(cls, host): argument
96 def get_installed_autodir(cls, host): argument
102 autodir = host.get_autodir()
107 for path in Autotest.get_client_autodir_paths(host):
110 host.run('test -x %s' % utils.sh_escape(autotest_binary))
111 host.run('test -w %s' % utils.sh_escape(path))
116 host.hostname)
121 def get_install_dir(cls, host): argument
130 install_dir = cls.get_installed_autodir(host)
132 install_dir = cls._find_installable_dir(host)
135 return host.get_tmp_dir(parent=install_dir)
140 def _find_installable_dir(cls, host): argument
141 client_autodir_paths = cls.get_client_autodir_paths(host)
144 host.run('mkdir -p %s' % utils.sh_escape(path))
145 host.run('test -w %s' % utils.sh_escape(path))
150 'hostname': host.hostname}
166 def install(self, host=None, autodir=None, use_packaging=True): argument
167 self._install(host=host, autodir=autodir, use_packaging=use_packaging)
170 def install_full_client(self, host=None, autodir=None): argument
171 self._install(host=host, autodir=autodir, use_autoserv=False,
175 def install_no_autoserv(self, host=None, autodir=None): argument
176 self._install(host=host, autodir=autodir, use_autoserv=False)
179 def _install_using_packaging(self, host, autodir): argument
184 pkgmgr = packages.PackageManager(autodir, hostname=host.hostname,
187 run_function=host.run,
194 host.run('cd %s && ls | grep -v "^packages$"'
201 def _install_using_send_file(self, host, autodir): argument
207 host.send_file(light_files, autodir, delete_dest=True)
216 host.run(';'.join(commands))
219 def _install(self, host=None, autodir=None, use_autoserv=True, argument
235 if not host:
236 host = self.host
239 host.wait_up(timeout=30)
240 host.setup()
241 logging.info("Installing autotest on %s", host.hostname)
245 autodir = self.get_install_dir(host)
247 host.set_autodir(autodir)
248 host.run('mkdir -p %s' % utils.sh_escape(autodir))
252 host.run('rm -rf %s/*' % utils.sh_escape(results_path),
258 self._install_using_packaging(host, autodir)
271 host.run(command)
280 self._install_using_send_file(host, autodir)
282 host.send_file(self.source_material, autodir, delete_dest=True)
291 host.name)
293 host.run('svn checkout %s %s' % (AUTOTEST_SVN, autodir))
295 host.run('svn checkout %s %s' % (AUTOTEST_HTTP, autodir))
300 def uninstall(self, host=None): argument
309 if not host:
310 host = self.host
311 autodir = host.get_autodir()
316 host.run("rm -rf %s" % utils.sh_escape(autodir), ignore_status=True)
317 host.set_autodir(None)
337 def run(self, control_file, results_dir='.', host=None, timeout=None, argument
362 host = self._get_host_and_setup(host, use_packaging=use_packaging)
366 client_disconnect_timeout = host.DEFAULT_REBOOT_TIMEOUT
371 atrun = _Run(host, results_dir, tag, parallel_flag, background)
372 self._do_run(control_file, results_dir, host, atrun, timeout,
376 def _get_host_and_setup(self, host, use_packaging=True): argument
377 if not host:
378 host = self.host
380 self.install(host, use_packaging=use_packaging)
382 host.wait_up(timeout=30)
383 return host
386 def _do_run(self, control_file, results_dir, host, atrun, timeout, argument
392 host.hostname)
393 self.install(host)
406 host.run(cmd, ignore_status=True)
432 running_profilers = host.job.profilers.add_log.iteritems()
445 state_file = host.job.preprocess_client_state()
446 host.send_file(state_file, atrun.remote_control_file + '.init.state')
450 host.send_file(tmppath, atrun.remote_control_file)
459 def run_timed_test(self, test_name, results_dir='.', host=None, argument
466 if not host:
467 host = self.host
469 self.install(host)
473 self.run(control, results_dir, host, timeout=timeout,
478 def run_test(self, test_name, results_dir='.', host=None, argument
481 self.run_timed_test(test_name, results_dir, host, timeout=None,
495 def __init__(self, host, results_dir, tag, parallel_flag, background): argument
496 self.host = host
498 self.env = host.env
502 self.autodir = Autotest.get_installed_autodir(self.host)
514 self.host.run('ls %s > /dev/null 2>&1' % binary)
522 self.host.run('umount %s' % tmpdir, ignore_status=True)
523 self.host.run('umount %s' % download, ignore_status=True)
532 if self.host.job.use_external_logging():
534 if self.host.hostname:
535 args.append('--hostname=%s' % self.host.hostname)
536 args.append('--user=%s' % self.host.job.user)
586 self.host.send_file(client_config_file, self.config_file)
616 fd, path = tempfile.mkstemp(dir=self.host.job.tmpdir)
658 if utils.ping(self.host.hostname, tries=1, deadline=1) != 0:
664 new_boot_id = self.host.get_boot_id(timeout=60)
698 self.host.job.record('END ABORT', None, None, str(e))
707 self.host.job.push_execution_context(self.results_dir)
709 result = self.host.run(full_cmd, ignore_status=True,
714 self.host.job.pop_execution_context()
734 monitor_dir = self.host.get_tmp_dir()
745 self.host.job.push_execution_context(self.results_dir)
747 self.host.run(daemon_cmd, ignore_status=True, timeout=timeout)
753 result = self.host.run(monitor_cmd, ignore_status=True,
779 elif not self.host.wait_up(client_disconnect_timeout):
784 self.host.job.pop_execution_context()
823 if not self.host.wait_down(self.host.WAIT_DOWN_REBOOT_TIMEOUT,
826 err %= (self.host.hostname, self.host.WAIT_DOWN_REBOOT_TIMEOUT)
829 if not self.host.wait_up(self.host.DEFAULT_REBOOT_TIMEOUT):
834 warning %= self.host.hostname
837 self.host.hardreset(wait=False)
840 warning %= self.host.hostname
843 (self.host.hostname,
844 self.host.DEFAULT_REBOOT_TIMEOUT))
845 self.host.reboot_followup()
850 collector = log_collector(self.host, self.tag, self.results_dir)
851 hostname = self.host.hostname
854 self.host.job.add_client_log(hostname, remote_results,
856 job_record_context = self.host.job.get_record_context()
861 logger = client_logger(self.host, self.tag, self.results_dir)
868 boot_id = self.host.get_boot_id()
881 self.host.job.record("ABORT", None, "reboot", str(e))
882 self.host.job.record("END ABORT", None, None, str(e))
902 self.host.job.record('FAIL', None, None, str(e))
903 self.host.job.record('END FAIL', None, None)
904 self.host.job.record('END GOOD', None, None)
905 self.host.job.failed_with_device_error = True
908 self.host.job.record('ABORT', None, None, str(e))
909 self.host.job.record('END ABORT', None, None)
912 self.host.wait_up(
913 self.host.HOURS_TO_WAIT_FOR_RECOVERY * 3600)
915 "client on %s: %s\n") % (self.host.hostname, last)
925 self.host.job.postprocess_client_state(state_path)
926 self.host.job.remove_client_log(hostname, remote_results,
936 def __init__(self, host, client_tag, results_dir): argument
937 self.host = host
940 self.client_results_dir = os.path.join(host.get_autodir(), "results",
953 self.host.wait_up(timeout=30)
963 self.host.get_file(self.client_results_dir + '/',
1001 def __init__(self, host, tag, server_results_dir): argument
1002 self.host = host
1003 self.job = host.job
1004 self.log_collector = log_collector(host, tag, server_results_dir)
1093 self.host.run("echo A > %s" % fifo_path)
1108 self.host.run("echo B > %s" % fifo_path)
1147 self.host.send_file(tarball_path, remote_dest)