• Home
  • Raw
  • Download

Lines Matching full:host

5 """Provides a factory method to create a host object."""
32 # Default ssh options used in creating a host.
42 # A list of all the possible host types, ordered according to frequency of
43 # host types in the lab, so the more common hosts don't incur a repeated ssh
44 # overhead in checking for less common host types.
63 # Timeout for early connectivity check to the host, in seconds.
68 """Get parameters to construct a host object.
70 There are currently 2 use cases for creating a host.
75 the same defaults as used in the server job to create a host.
80 @return: A dictionary containing arguments for host specifically hostname,
133 """Detect host type.
135 Goes through all the possible host classes, calling check_host with a
136 basic host object. Currently this is an ssh host, but theoretically it
137 can be any host object that the check_host method of appropriate host
140 @param connectivity_class: connectivity class to use to talk to the host
142 @param hostname: A string representing the host name of the device.
144 the host class.
146 @returns: Class type of the first host class that returns True to the
154 with closing(connectivity_class(hostname, **args)) as host:
156 logging.info('Attempting to autodetect if host is of type %s',
158 if host_module.check_host(host, timeout=10):
162 logging.warning('Unable to apply conventional host detection methods, '
163 'defaulting to chromeos host.')
168 """Check the environmental variables to see if the host type has been set.
170 @param hostname: A string representing the host name of the device.
172 @returns: Class type of the host, if previously found & set in
184 @param ssh_port: SSH port to connect to the host.
186 @returns a connectivity host class.
195 """Verify connectivity to the host.
197 Any interaction with an unreachable host is guaranteed to fail later. By
204 with closing(ssh_host.SSHHost(hostname, **args)) as host:
205 host.run('test :', timeout=_CONNECTIVITY_CHECK_TIMEOUT_S,
211 """Wrapped for create_hosts for making host objects on companion duts.
215 @returns: A list of host objects for each host in companion_hosts
220 for host in companion_hosts:
221 hosts.append(create_host(host))
227 """Create a host object.
229 This method mixes host classes that are needed into a new subclass
237 @param host_class: Host class to use, if None, will attempt to detect
242 the new host class.
244 @returns: A host object which is an instance of the newly created
245 host class.
259 # Let's grab the os from the labels if we can for host class detection.
263 logging.debug('Detected host os: %s from info_store.', host_os)
267 # TODO(kevcheng): get rid of the host detection using host attributes.
279 # host autodetection logic. We should ideally just error out in this
290 logging.exception('Failed to verify connectivity to host.'
291 ' Skipping host auto detection logic.')
295 # create a custom host class for this machine and return an instance of it
302 logging.info('creating host class for {} w/ {}||'.format(hostname, args))
305 # call job_start if this is the first time this host is being used
344 """Create the target host, accounting for containers.
347 @param host_info_path: path to the host info file to create host_info
352 @yield: The target host object to be used for you :)
367 host = create_target_machine(machine, **kwargs)
368 if servo_uart_logs_dir and host.servo:
369 host.servo.uart_logs_dir = servo_uart_logs_dir
371 yield host
373 host.close()