Lines Matching refs:container
19 from autotest_lib.site_utils.lxc import container as container_module
58 container = lxc.Container.create_from_existing_dir(
63 self.assertFalse(container.is_running())
71 container = lxc.Container.create_from_existing_dir(self.test_dir,
74 container.refresh_status()
78 with self.createContainer() as container:
80 id_path = os.path.join(container.container_path,
81 container.name,
87 self.test_dir, container.name)
96 with self.createContainer(name=test_name) as container:
97 container.start(wait_for_network=True)
98 hostname = container.attach_run('hostname').stdout.strip()
103 with self.createContainer() as container:
105 container.start(wait_for_network=True)
106 container.set_hostname(expected_hostname)
107 hostname = container.attach_run('hostname -f').stdout.strip()
123 with self.createContainer() as container:
126 if container.is_running():
128 container.set_hostname('foobar')
184 with self.createContainer() as container:
186 container.install_ssp(url)
187 container.start(wait_for_network=False)
194 return container.attach_run('cat %s' % path).stdout
208 with self.createContainer() as container:
209 container.install_control_file(tmpfile)
210 container.start(wait_for_network=False)
212 container.attach_run(
223 with self.createContainer() as container:
226 container.copy(tmpfile.name, dst)
227 container.start(wait_for_network=False)
229 test_string = container.attach_run('cat %s' % dst).stdout
241 with self.createContainer() as container:
244 container.copy(tmpdir, dst)
245 container.start(wait_for_network=False)
248 test_string = container.attach_run('cat %s' % test_file).stdout
253 with lxc_utils.TempDir() as tmpdir, self.createContainer() as container:
255 container.mount_dir(tmpdir, dst, readonly=False)
256 container.start(wait_for_network=False)
259 self.verifyBindMount(container, dst, tmpdir)
260 container.attach_run('test -r %s -a -w %s' % (dst, dst))
264 with lxc_utils.TempDir() as tmpdir, self.createContainer() as container:
266 container.mount_dir(tmpdir, dst, readonly=True)
267 container.start(wait_for_network=False)
270 self.verifyBindMount(container, dst, tmpdir)
271 container.attach_run('test -r %s -a ! -w %s' % (dst, dst))
275 with lxc_utils.TempDir() as tmpdir, self.createContainer() as container:
277 container.mount_dir(tmpdir, dst, readonly=True)
278 container.start(wait_for_network=False)
281 self.verifyBindMount(container, dst, tmpdir)
289 with self.createContainer() as container:
291 container.id = test_id
295 container.container_path, container.name)
301 with self.createContainer() as container:
302 self.assertIsNone(container.id)
304 container.id = random_container_id()
305 clone = lxc.Container.clone(src=container,
306 new_name=container.name + '_clone',
308 self.assertIsNotNone(container.id)
321 container = lxc.Container.clone(src=self.base_container,
326 yield container
329 container.destroy()
331 def verifyBindMount(self, container, container_path, host_path): argument
339 container_inode = (container.attach_run('ls -id %s' % container_path)