Lines Matching refs:host

79     def __init__(self, host=None):  argument
80 self.host = host
97 def get_client_autodir_paths(cls, host): argument
103 def get_installed_autodir(cls, host): argument
109 autodir = host.get_autodir()
114 for path in Autotest.get_client_autodir_paths(host):
117 host.run('test -x %s' % utils.sh_escape(autotest_binary))
118 host.run('test -w %s' % utils.sh_escape(path))
123 host.hostname)
128 def get_install_dir(cls, host): argument
137 install_dir = cls.get_installed_autodir(host)
139 install_dir = cls._find_installable_dir(host)
142 return host.get_tmp_dir(parent=install_dir)
147 def _find_installable_dir(cls, host): argument
148 client_autodir_paths = cls.get_client_autodir_paths(host)
151 host.run('mkdir -p %s' % utils.sh_escape(path))
152 host.run('test -w %s' % utils.sh_escape(path))
158 fields={'dut_host_name': host.hostname})
172 def install(self, host=None, autodir=None, use_packaging=True): argument
173 self._install(host=host, autodir=autodir, use_packaging=use_packaging)
176 def install_full_client(self, host=None, autodir=None): argument
177 self._install(host=host, autodir=autodir, use_autoserv=False,
181 def install_no_autoserv(self, host=None, autodir=None): argument
182 self._install(host=host, autodir=autodir, use_autoserv=False)
185 def _install_using_packaging(self, host, autodir): argument
190 pkgmgr = packages.PackageManager(autodir, hostname=host.hostname,
193 run_function=host.run,
200 host.run('cd %s && ls | grep -v "^packages$"'
207 def _install_using_send_file(self, host, autodir): argument
213 host.send_file(light_files, autodir, delete_dest=True)
222 host.run(';'.join(commands))
225 def _install(self, host=None, autodir=None, use_autoserv=True, argument
241 if not host:
242 host = self.host
245 host.wait_up(timeout=30)
246 host.setup()
247 logging.info("Installing autotest on %s", host.hostname)
251 autodir = self.get_install_dir(host)
253 host.set_autodir(autodir)
254 host.run('mkdir -p %s' % utils.sh_escape(autodir))
258 host.run('rm -rf %s/*' % utils.sh_escape(results_path),
264 self._install_using_packaging(host, autodir)
277 host.run(command)
286 self._install_using_send_file(host, autodir)
288 host.send_file(self.source_material, autodir, delete_dest=True)
297 host.name)
299 host.run('svn checkout %s %s' % (AUTOTEST_SVN, autodir))
301 host.run('svn checkout %s %s' % (AUTOTEST_HTTP, autodir))
306 def uninstall(self, host=None): argument
315 if not host:
316 host = self.host
317 autodir = host.get_autodir()
322 host.run("rm -rf %s" % utils.sh_escape(autodir), ignore_status=True)
323 host.set_autodir(None)
343 def run(self, control_file, results_dir='.', host=None, timeout=None, argument
368 host = self._get_host_and_setup(host, use_packaging=use_packaging)
370 host.hostname)
374 client_disconnect_timeout = host.DEFAULT_REBOOT_TIMEOUT
379 atrun = _Run(host, results_dir, tag, parallel_flag, background)
380 self._do_run(control_file, results_dir, host, atrun, timeout,
384 def _get_host_and_setup(self, host, use_packaging=True): argument
385 if not host:
386 host = self.host
388 self.install(host, use_packaging=use_packaging)
390 host.wait_up(timeout=30)
391 return host
394 def _do_run(self, control_file, results_dir, host, atrun, timeout, argument
400 host.hostname)
401 self.install(host)
414 host.run(cmd, ignore_status=True)
440 running_profilers = host.job.profilers.add_log.iteritems()
453 state_file = host.job.preprocess_client_state()
454 host.send_file(state_file, atrun.remote_control_file + '.init.state')
458 host.send_file(tmppath, atrun.remote_control_file)
468 def _check_client_test_result(cls, host, test_name): argument
476 client_result_dir = '%s/results/default' % host.autodir
478 status = host.run(command).stdout.strip()
484 def run_timed_test(self, test_name, results_dir='.', host=None, argument
491 if not host:
492 host = self.host
494 self.install(host)
498 self.run(control, results_dir, host, timeout=timeout,
503 self._check_client_test_result(host, test_name)
506 def run_test(self, test_name, results_dir='.', host=None, argument
509 self.run_timed_test(test_name, results_dir, host, timeout=None,
523 def __init__(self, host, results_dir, tag, parallel_flag, background): argument
524 self.host = host
526 self.env = host.env
530 self.autodir = Autotest.get_installed_autodir(self.host)
542 self.host.run('ls %s > /dev/null 2>&1' % binary)
550 self.host.run('umount %s' % tmpdir, ignore_status=True)
551 self.host.run('umount %s' % download, ignore_status=True)
560 if self.host.job.use_external_logging():
562 if self.host.hostname:
563 args.append('--hostname=%s' % self.host.hostname)
564 args.append('--user=%s' % self.host.job.user)
614 self.host.send_file(client_config_file, self.config_file)
644 fd, path = tempfile.mkstemp(dir=self.host.job.tmpdir)
686 if utils.ping(self.host.hostname, tries=1, deadline=1) != 0:
692 new_boot_id = self.host.get_boot_id(timeout=60)
726 self.host.job.record('END ABORT', None, None, str(e))
735 self.host.job.push_execution_context(self.results_dir)
737 result = self.host.run(full_cmd, ignore_status=True,
742 self.host.job.pop_execution_context()
762 monitor_dir = self.host.get_tmp_dir()
773 self.host.job.push_execution_context(self.results_dir)
775 self.host.run(daemon_cmd, ignore_status=True, timeout=timeout)
781 result = self.host.run(monitor_cmd, ignore_status=True,
807 elif not self.host.wait_up(client_disconnect_timeout):
812 self.host.job.pop_execution_context()
851 if not self.host.wait_down(self.host.WAIT_DOWN_REBOOT_TIMEOUT,
854 err %= (self.host.hostname, self.host.WAIT_DOWN_REBOOT_TIMEOUT)
857 if not self.host.wait_up(self.host.DEFAULT_REBOOT_TIMEOUT):
862 warning %= self.host.hostname
865 self.host.hardreset(wait=False)
868 warning %= self.host.hostname
871 (self.host.hostname,
872 self.host.DEFAULT_REBOOT_TIMEOUT))
873 self.host.reboot_followup()
878 collector = log_collector(self.host, self.tag, self.results_dir)
879 hostname = self.host.hostname
882 self.host.job.add_client_log(hostname, remote_results,
884 job_record_context = self.host.job.get_record_context()
889 logger = client_logger(self.host, self.tag, self.results_dir)
896 boot_id = self.host.get_boot_id()
909 self.host.job.record("ABORT", None, "reboot", str(e))
910 self.host.job.record("END ABORT", None, None, str(e))
930 self.host.job.record('FAIL', None, None, str(e))
931 self.host.job.record('END FAIL', None, None)
932 self.host.job.record('END GOOD', None, None)
933 self.host.job.failed_with_device_error = True
936 self.host.job.record('ABORT', None, None, str(e))
937 self.host.job.record('END ABORT', None, None)
940 self.host.wait_up(
941 self.host.HOURS_TO_WAIT_FOR_RECOVERY * 3600)
943 "client on %s: %s\n") % (self.host.hostname, last)
955 self.host.job.postprocess_client_state(state_path)
956 self.host.job.remove_client_log(hostname, remote_results,
968 def __init__(self, host, client_tag, results_dir): argument
969 self.host = host
972 self.client_results_dir = os.path.join(host.get_autodir(), "results",
985 self.host.wait_up(timeout=30)
995 fields={'dut_host_name': self.host.hostname}):
996 self.host.get_file(
1033 def __init__(self, host, tag, server_results_dir): argument
1034 self.host = host
1035 self.job = host.job
1036 self.log_collector = log_collector(host, tag, server_results_dir)
1125 self.host.run("echo A > %s" % fifo_path)
1140 self.host.run("echo B > %s" % fifo_path)
1179 self.host.send_file(tarball_path, remote_dest)