summaryrefslogtreecommitdiff
path: root/tests/acceptance
diff options
context:
space:
mode:
authorJoffrey F <joffrey@docker.com>2018-02-21 16:42:49 -0800
committerJoffrey F <joffrey@docker.com>2018-02-21 16:42:49 -0800
commitc6fe564ed579d8150efa2ec5613734de09d8dc45 (patch)
treebd8c63830fbe79b321e0e1c0ec804a0fb7c41485 /tests/acceptance
parent18338606143971b5ba64250cb0eca49d1a516c1d (diff)
Add --detach tests
Signed-off-by: Joffrey F <joffrey@docker.com>
Diffstat (limited to 'tests/acceptance')
-rw-r--r--tests/acceptance/cli_test.py22
1 files changed, 22 insertions, 0 deletions
diff --git a/tests/acceptance/cli_test.py b/tests/acceptance/cli_test.py
index 134485c4..63122e74 100644
--- a/tests/acceptance/cli_test.py
+++ b/tests/acceptance/cli_test.py
@@ -884,6 +884,19 @@ class CLITestCase(DockerClientTestCase):
assert not container.get('Config.AttachStdout')
assert not container.get('Config.AttachStdin')
+ def test_up_detached_long_form(self):
+ self.dispatch(['up', '--detach'])
+ service = self.project.get_service('simple')
+ another = self.project.get_service('another')
+ assert len(service.containers()) == 1
+ assert len(another.containers()) == 1
+
+ # Ensure containers don't have stdin and stdout connected in -d mode
+ container, = service.containers()
+ assert not container.get('Config.AttachStderr')
+ assert not container.get('Config.AttachStdout')
+ assert not container.get('Config.AttachStdin')
+
def test_up_attached(self):
self.base_dir = 'tests/fixtures/echo-services'
result = self.dispatch(['up', '--no-color'])
@@ -1463,6 +1476,15 @@ class CLITestCase(DockerClientTestCase):
assert stderr == ""
assert stdout == "/\n"
+ def test_exec_detach_long_form(self):
+ self.base_dir = 'tests/fixtures/links-composefile'
+ self.dispatch(['up', '--detach', 'console'])
+ assert len(self.project.containers()) == 1
+
+ stdout, stderr = self.dispatch(['exec', '-T', 'console', 'ls', '-1d', '/'])
+ assert stderr == ""
+ assert stdout == "/\n"
+
def test_exec_custom_user(self):
self.base_dir = 'tests/fixtures/links-composefile'
self.dispatch(['up', '-d', 'console'])