Lines Matching +full:is +full:- +full:path +full:- +full:inside
2 # Use of this source code is governed by a BSD-style license that can be
33 target: config file's location inside container.
34 append: true to append the content of config file to existing file inside
35 container. If it's set to false, the existing file inside container will
37 permission: Permission to set to the config file inside container.
48 /etc/resolv.conf inside container.
54 target: the folder's location inside container.
55 mount: true to mount the source folder onto the target inside container.
56 A setting with false value of mount is invalid.
57 readonly: true if the mounted folder inside container should be readonly.
69 host to path "/usr/local/autotest/results/shared" inside the container. The
70 folder can be written to inside container. If the source folder doesn't exist,
71 it will be created as `force_create` is set to true.
74 For relative file path specified in ssp_deploy_config, AUTOTEST_DIR/containers
75 is the parent folder.
81 For SSP to work with none-lab servers, e.g., moblab and developer's workstation,
83 shadow_config to container when AUTOTEST_DIR/containers/ssp_deploy_config is not
103 # Path to ssp_deploy_config and ssp_deploy_shadow_config.
104 SSP_DEPLOY_CONFIG_FILE = os.path.join(common.autotest_dir,
106 SSP_DEPLOY_SHADOW_CONFIG_FILE = os.path.join(common.autotest_dir,
108 # A temp folder used to store files to be appended to the files inside
129 1. Copy given config files to specified location inside container.
130 2. Append the content of given config files to specific files inside
132 3. Make sure the config files have proper permission inside container.
142 @raise SSPDeployError: If any path in deploy config is invalid.
146 if not os.path.isabs(target):
147 raise SSPDeployError('Target path must be absolute path: %s' %
149 if not os.path.isabs(source):
151 # This is to handle the case that the script is run with sudo.
154 source = os.path.expanduser(inject_user_path)
156 source = os.path.join(common.autotest_dir, source)
157 # Update the source setting in deploy config with the updated path.
165 Deploy configs need to be validated and pre-processed, e.g.,
166 1. Target must be an absolute path.
167 2. Source must be updated to be an absolute path.
173 @raise SSPDeployError: If the deploy config is invalid.
184 Deploy configs need to be validated and pre-processed, e.g.,
185 1. Target must be an absolute path.
186 2. Source must be updated to be an absolute path.
193 @raise SSPDeployError: If the deploy config is invalid.
200 if not c.force_create and not os.path.exists(c.source):
212 # If shadow config is used, the deployment procedure will skip some
216 if config_file is None:
217 self.is_shadow_config = os.path.exists(
231 tmp_append = os.path.join(self.container.rootfs,
232 _APPEND_FOLDER.lstrip(os.path.sep))
235 commands = ['rm -rf "%s"' % tmp_append]
236 commands.append('mkdir -p "%s"' % tmp_append)
241 """Deploy a config before container is started.
243 Most configs can be deployed before the container is up. For configs
251 # Path to the target file relative to host.
253 target = os.path.join(_APPEND_FOLDER,
254 os.path.basename(deploy_config.target))
262 """Deploy a config after container is started.
265 they must be copied to a temp location before container is up (deployed
266 in function _deploy_config_pre_start). After the container is up, calls
274 source = os.path.join(_APPEND_FOLDER,
275 os.path.basename(deploy_config.target))
279 'chmod -R %s \'%s\'' %
286 This only applies when no shadow SSP deploy config is applied. For
287 default SSP deploy config, autotest shadow_config.ini is from autotest
292 1. Disable main ssh connection in shadow config, as it is not working
295 if any is set to localhost or 127.0.0.1. Otherwise, set it to be the
297 3. Update SSP/user, which is used as the user makes RPC inside the
298 container. This allows the RPC to pass ACL check as if the call is
302 shadow_config = os.path.join(constants.CONTAINER_AUTOTEST_DIR,
332 # is_moblab: True if the autotest server is a Moblab instance.
334 # inside container can make RPC through this IP.
343 """Modify ssh config for it to work inside container.
345 This is only called when default ssp_deploy_config is used. If shadow
346 deploy config is manually set up, this function will not be called.
348 to work inside container.
353 self.container.attach_run('sed -i \'s/UseProxyIf=false//g\' \'%s\'' %
355 # TODO(dshi): crbug.com/451622 ssh connection loglevel is set to
356 # ERROR in container before the ssh connection works. This is
365 'sed -i \'1s/^/Host *\\n LogLevel ERROR\\n\\n/\' \'%s\'' %
383 """Deploy configs before the container is started.
389 not os.path.exists(mount_config.source)):
390 utils.run('mkdir -p %s' % mount_config.source)
397 """Deploy configs after the container is started.