Extend up -t to pass timeout to stop running containers

Signed-off-by: Travis Thieman <travis.thieman@gmail.com>
This commit is contained in:
Travis Thieman 2015-05-28 09:28:02 -04:00 committed by Daniel Nephin
commit c24d5380e6
5 changed files with 38 additions and 9 deletions

View file

@ -162,6 +162,19 @@ class CLITestCase(DockerClientTestCase):
self.assertEqual(old_ids, new_ids)
def test_up_with_timeout(self):
self.command.dispatch(['up', '-d', '-t', '1'], None)
service = self.project.get_service('simple')
another = self.project.get_service('another')
self.assertEqual(len(service.containers()), 1)
self.assertEqual(len(another.containers()), 1)
# Ensure containers don't have stdin and stdout connected in -d mode
config = service.containers()[0].inspect()['Config']
self.assertFalse(config['AttachStderr'])
self.assertFalse(config['AttachStdout'])
self.assertFalse(config['AttachStdin'])
@patch('dockerpty.start')
def test_run_service_without_links(self, mock_stdout):
self.command.base_dir = 'tests/fixtures/links-composefile'