implement exec
Resolves #593 Signed-off-by: Tomas Tomecek <ttomecek@redhat.com>
This commit is contained in:
parent
1502c5a14d
commit
d28c5dda92
5 changed files with 110 additions and 1 deletions
|
|
@ -752,6 +752,24 @@ class CLITestCase(DockerClientTestCase):
|
|||
self.project.stop(['simple'])
|
||||
wait_on_condition(ContainerCountCondition(self.project, 0))
|
||||
|
||||
def test_exec_without_tty(self):
|
||||
self.base_dir = 'tests/fixtures/links-composefile'
|
||||
self.dispatch(['up', '-d', 'console'])
|
||||
self.assertEqual(len(self.project.containers()), 1)
|
||||
|
||||
stdout, stderr = self.dispatch(['exec', '-T', 'console', 'ls', '-1d', '/'])
|
||||
self.assertEquals(stdout, "/\n")
|
||||
self.assertEquals(stderr, "")
|
||||
|
||||
def test_exec_custom_user(self):
|
||||
self.base_dir = 'tests/fixtures/links-composefile'
|
||||
self.dispatch(['up', '-d', 'console'])
|
||||
self.assertEqual(len(self.project.containers()), 1)
|
||||
|
||||
stdout, stderr = self.dispatch(['exec', '-T', '--user=operator', 'console', 'whoami'])
|
||||
self.assertEquals(stdout, "operator\n")
|
||||
self.assertEquals(stderr, "")
|
||||
|
||||
def test_run_service_without_links(self):
|
||||
self.base_dir = 'tests/fixtures/links-composefile'
|
||||
self.dispatch(['run', 'console', '/bin/true'])
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue