|
@@ -491,16 +491,16 @@ class CLITestCase(DockerClientTestCase):
|
|
|
def test_ps(self):
|
|
|
self.project.get_service('simple').create_container()
|
|
|
result = self.dispatch(['ps'])
|
|
|
- assert 'simplecomposefile_simple_1' in result.stdout
|
|
|
+ assert 'simple-composefile_simple_1' in result.stdout
|
|
|
|
|
|
def test_ps_default_composefile(self):
|
|
|
self.base_dir = 'tests/fixtures/multiple-composefiles'
|
|
|
self.dispatch(['up', '-d'])
|
|
|
result = self.dispatch(['ps'])
|
|
|
|
|
|
- assert 'multiplecomposefiles_simple_1' in result.stdout
|
|
|
- assert 'multiplecomposefiles_another_1' in result.stdout
|
|
|
- assert 'multiplecomposefiles_yetanother_1' not in result.stdout
|
|
|
+ assert 'multiple-composefiles_simple_1' in result.stdout
|
|
|
+ assert 'multiple-composefiles_another_1' in result.stdout
|
|
|
+ assert 'multiple-composefiles_yetanother_1' not in result.stdout
|
|
|
|
|
|
def test_ps_alternate_composefile(self):
|
|
|
config_path = os.path.abspath(
|
|
@@ -511,9 +511,9 @@ class CLITestCase(DockerClientTestCase):
|
|
|
self.dispatch(['-f', 'compose2.yml', 'up', '-d'])
|
|
|
result = self.dispatch(['-f', 'compose2.yml', 'ps'])
|
|
|
|
|
|
- assert 'multiplecomposefiles_simple_1' not in result.stdout
|
|
|
- assert 'multiplecomposefiles_another_1' not in result.stdout
|
|
|
- assert 'multiplecomposefiles_yetanother_1' in result.stdout
|
|
|
+ assert 'multiple-composefiles_simple_1' not in result.stdout
|
|
|
+ assert 'multiple-composefiles_another_1' not in result.stdout
|
|
|
+ assert 'multiple-composefiles_yetanother_1' in result.stdout
|
|
|
|
|
|
def test_ps_services_filter_option(self):
|
|
|
self.base_dir = 'tests/fixtures/ps-services-filter'
|
|
@@ -902,18 +902,18 @@ class CLITestCase(DockerClientTestCase):
|
|
|
assert len(self.project.containers(one_off=OneOffFilter.only, stopped=True)) == 2
|
|
|
|
|
|
result = self.dispatch(['down', '--rmi=local', '--volumes'])
|
|
|
- assert 'Stopping v2full_web_1' in result.stderr
|
|
|
- assert 'Stopping v2full_other_1' in result.stderr
|
|
|
- assert 'Stopping v2full_web_run_2' in result.stderr
|
|
|
- assert 'Removing v2full_web_1' in result.stderr
|
|
|
- assert 'Removing v2full_other_1' in result.stderr
|
|
|
- assert 'Removing v2full_web_run_1' in result.stderr
|
|
|
- assert 'Removing v2full_web_run_2' in result.stderr
|
|
|
- assert 'Removing volume v2full_data' in result.stderr
|
|
|
- assert 'Removing image v2full_web' in result.stderr
|
|
|
+ assert 'Stopping v2-full_web_1' in result.stderr
|
|
|
+ assert 'Stopping v2-full_other_1' in result.stderr
|
|
|
+ assert 'Stopping v2-full_web_run_2' in result.stderr
|
|
|
+ assert 'Removing v2-full_web_1' in result.stderr
|
|
|
+ assert 'Removing v2-full_other_1' in result.stderr
|
|
|
+ assert 'Removing v2-full_web_run_1' in result.stderr
|
|
|
+ assert 'Removing v2-full_web_run_2' in result.stderr
|
|
|
+ assert 'Removing volume v2-full_data' in result.stderr
|
|
|
+ assert 'Removing image v2-full_web' in result.stderr
|
|
|
assert 'Removing image busybox' not in result.stderr
|
|
|
- assert 'Removing network v2full_default' in result.stderr
|
|
|
- assert 'Removing network v2full_front' in result.stderr
|
|
|
+ assert 'Removing network v2-full_default' in result.stderr
|
|
|
+ assert 'Removing network v2-full_front' in result.stderr
|
|
|
|
|
|
def test_down_timeout(self):
|
|
|
self.dispatch(['up', '-d'], None)
|
|
@@ -2000,39 +2000,39 @@ class CLITestCase(DockerClientTestCase):
|
|
|
proc = start_process(self.base_dir, ['run', '-T', 'simple', 'top'])
|
|
|
wait_on_condition(ContainerStateCondition(
|
|
|
self.project.client,
|
|
|
- 'simplecomposefile_simple_run_1',
|
|
|
+ 'simple-composefile_simple_run_1',
|
|
|
'running'))
|
|
|
|
|
|
os.kill(proc.pid, signal.SIGINT)
|
|
|
wait_on_condition(ContainerStateCondition(
|
|
|
self.project.client,
|
|
|
- 'simplecomposefile_simple_run_1',
|
|
|
+ 'simple-composefile_simple_run_1',
|
|
|
'exited'))
|
|
|
|
|
|
def test_run_handles_sigterm(self):
|
|
|
proc = start_process(self.base_dir, ['run', '-T', 'simple', 'top'])
|
|
|
wait_on_condition(ContainerStateCondition(
|
|
|
self.project.client,
|
|
|
- 'simplecomposefile_simple_run_1',
|
|
|
+ 'simple-composefile_simple_run_1',
|
|
|
'running'))
|
|
|
|
|
|
os.kill(proc.pid, signal.SIGTERM)
|
|
|
wait_on_condition(ContainerStateCondition(
|
|
|
self.project.client,
|
|
|
- 'simplecomposefile_simple_run_1',
|
|
|
+ 'simple-composefile_simple_run_1',
|
|
|
'exited'))
|
|
|
|
|
|
def test_run_handles_sighup(self):
|
|
|
proc = start_process(self.base_dir, ['run', '-T', 'simple', 'top'])
|
|
|
wait_on_condition(ContainerStateCondition(
|
|
|
self.project.client,
|
|
|
- 'simplecomposefile_simple_run_1',
|
|
|
+ 'simple-composefile_simple_run_1',
|
|
|
'running'))
|
|
|
|
|
|
os.kill(proc.pid, signal.SIGHUP)
|
|
|
wait_on_condition(ContainerStateCondition(
|
|
|
self.project.client,
|
|
|
- 'simplecomposefile_simple_run_1',
|
|
|
+ 'simple-composefile_simple_run_1',
|
|
|
'exited'))
|
|
|
|
|
|
@mock.patch.dict(os.environ)
|
|
@@ -2234,7 +2234,7 @@ class CLITestCase(DockerClientTestCase):
|
|
|
self.dispatch(['up', '-d', 'another'])
|
|
|
wait_on_condition(ContainerStateCondition(
|
|
|
self.project.client,
|
|
|
- 'logscomposefile_another_1',
|
|
|
+ 'logs-composefile_another_1',
|
|
|
'exited'))
|
|
|
|
|
|
self.dispatch(['kill', 'simple'])
|
|
@@ -2243,8 +2243,8 @@ class CLITestCase(DockerClientTestCase):
|
|
|
|
|
|
assert 'hello' in result.stdout
|
|
|
assert 'test' in result.stdout
|
|
|
- assert 'logscomposefile_another_1 exited with code 0' in result.stdout
|
|
|
- assert 'logscomposefile_simple_1 exited with code 137' in result.stdout
|
|
|
+ assert 'logs-composefile_another_1 exited with code 0' in result.stdout
|
|
|
+ assert 'logs-composefile_simple_1 exited with code 137' in result.stdout
|
|
|
|
|
|
def test_logs_default(self):
|
|
|
self.base_dir = 'tests/fixtures/logs-composefile'
|
|
@@ -2491,7 +2491,7 @@ class CLITestCase(DockerClientTestCase):
|
|
|
|
|
|
container, = self.project.containers()
|
|
|
expected_template = ' container {} {}'
|
|
|
- expected_meta_info = ['image=busybox:latest', 'name=simplecomposefile_simple_1']
|
|
|
+ expected_meta_info = ['image=busybox:latest', 'name=simple-composefile_simple_1']
|
|
|
|
|
|
assert expected_template.format('create', container.id) in lines[0]
|
|
|
assert expected_template.format('start', container.id) in lines[1]
|
|
@@ -2611,13 +2611,13 @@ class CLITestCase(DockerClientTestCase):
|
|
|
|
|
|
result = wait_on_process(proc, returncode=1)
|
|
|
|
|
|
- assert 'exitcodefrom_another_1 exited with code 1' in result.stdout
|
|
|
+ assert 'exit-code-from_another_1 exited with code 1' in result.stdout
|
|
|
|
|
|
def test_images(self):
|
|
|
self.project.get_service('simple').create_container()
|
|
|
result = self.dispatch(['images'])
|
|
|
assert 'busybox' in result.stdout
|
|
|
- assert 'simplecomposefile_simple_1' in result.stdout
|
|
|
+ assert 'simple-composefile_simple_1' in result.stdout
|
|
|
|
|
|
def test_images_default_composefile(self):
|
|
|
self.base_dir = 'tests/fixtures/multiple-composefiles'
|
|
@@ -2625,8 +2625,8 @@ class CLITestCase(DockerClientTestCase):
|
|
|
result = self.dispatch(['images'])
|
|
|
|
|
|
assert 'busybox' in result.stdout
|
|
|
- assert 'multiplecomposefiles_another_1' in result.stdout
|
|
|
- assert 'multiplecomposefiles_simple_1' in result.stdout
|
|
|
+ assert 'multiple-composefiles_another_1' in result.stdout
|
|
|
+ assert 'multiple-composefiles_simple_1' in result.stdout
|
|
|
|
|
|
@mock.patch.dict(os.environ)
|
|
|
def test_images_tagless_image(self):
|
|
@@ -2646,7 +2646,7 @@ class CLITestCase(DockerClientTestCase):
|
|
|
self.project.get_service('foo').create_container()
|
|
|
result = self.dispatch(['images'])
|
|
|
assert '<none>' in result.stdout
|
|
|
- assert 'taglessimage_foo_1' in result.stdout
|
|
|
+ assert 'tagless-image_foo_1' in result.stdout
|
|
|
|
|
|
def test_up_with_override_yaml(self):
|
|
|
self.base_dir = 'tests/fixtures/override-yaml-files'
|