Lines Matching full:host
22 def extract_from_image(host, image_name, dest_dir): argument
26 @param host: The DUT to execute the command on
32 if not host.path_exists('/var/lib/imageloader/%s' % image_name):
33 raise Exception('Image %s not found on host %s' % (image_name, host))
50 host.run(['rm', '-rf', dest_dir])
51 host.run(['mkdir', '-p', '--mode', '0755', dest_dir, image_mount_point])
55 host.run([
61 host.run(['cp', '-r', '%s/*' % image_mount_point, '%s/' % dest_dir])
64 'Error extracting content from image %s on host %s ' %
65 (image_name, host), e)
68 host.run([
72 host.run(['rm', '-rf', image_mount_point])
75 def _stop_chrome_if_necessary(host): argument
79 @param host: The DUT to execute the command on
84 status = host.run_output('status ui')
86 return host.run('stop ui', ignore_status=True).exit_status == 0
91 def _mount_chrome(host, chrome_dir, chrome_mount_point): argument
95 @param host: The DUT to execute the command on
101 chrome_stopped = _stop_chrome_if_necessary(host)
102 _umount_chrome(host, chrome_mount_point)
106 host.run(['mount', '--rbind', chrome_dir, chrome_mount_point])
109 host.run(SET_MOUNT_FLAGS_CMD % chrome_mount_point)
115 host.run(DBUS_RELOAD_COMMAND, ignore_status=True)
118 host.run('start ui', ignore_status=True)
121 def _umount_chrome(host, chrome_mount_point): argument
125 @param host: The DUT to execute the command on
129 chrome_stopped = _stop_chrome_if_necessary(host)
133 host.run(FORCED_UMOUNT_DIR_IF_MOUNTPOINT_CMD %
136 raise Exception('Exception during cleanup on host %s' % host, e)
139 host.run('start ui', ignore_status=True)
142 def setup_host(host, chrome_dir, chrome_mount_point): argument
144 Perform setup on host.
153 @param host: The DUT to execute the command on
159 logging.info("Setting up host:%s", host)
161 extract_from_image(host, 'lacros', chrome_dir)
163 _mount_chrome(host, '%s/out/Release' % chrome_dir,
167 'Exception while mounting %s on host %s' %
168 (chrome_mount_point, host), e)
171 def cleanup_host(host, chrome_dir, chrome_mount_point): argument
175 @param host: The DUT to execute the command on
181 logging.info("Unmounting chrome on host: %s", host)
184 _umount_chrome(host, chrome_mount_point)
185 host.run(['rm', '-rf', chrome_dir])
187 raise Exception('Exception during cleanup on host %s' % host, e)
190 def get_tast_expr_from_file(host, args_dict, results_dir, base_path=None): argument
207 @param host: Host having the provisioned lacros image with the file
220 if not host.path_exists(tast_expr_file_name):
228 host.get_file(tast_expr_file_name, local_file_name, delete_dest=True)