Merge pull request from dnephin/fix_abort_on_container_exit

Fix abort on container exit
This commit is contained in:
Daniel Nephin 2016-02-23 10:52:12 -08:00
commit ba799d2e86
2 changed files with 10 additions and 0 deletions
compose/cli
tests/acceptance

View File

@ -662,6 +662,10 @@ class TopLevelCommand(DocoptCommand):
print("Attaching to", list_containers(log_printer.containers))
log_printer.run()
if cascade_stop:
print("Aborting on container exit...")
project.stop(service_names=service_names, timeout=timeout)
def version(self, project, options):
"""
Show version informations

View File

@ -746,6 +746,12 @@ class CLITestCase(DockerClientTestCase):
os.kill(proc.pid, signal.SIGTERM)
wait_on_condition(ContainerCountCondition(self.project, 0))
def test_up_handles_abort_on_container_exit(self):
start_process(self.base_dir, ['up', '--abort-on-container-exit'])
wait_on_condition(ContainerCountCondition(self.project, 2))
self.project.stop(['simple'])
wait_on_condition(ContainerCountCondition(self.project, 0))
def test_run_service_without_links(self):
self.base_dir = 'tests/fixtures/links-composefile'
self.dispatch(['run', 'console', '/bin/true'])