added the extra_hosts option to the yml configuration which exposes the --add-host flag from the docker client
Signed-off-by: Sam Wing <sampwing@gmail.com>
This commit is contained in:
parent
e6ec76161d
commit
fb81c37ca6
4 changed files with 47 additions and 0 deletions
|
|
@ -107,6 +107,20 @@ class ServiceTest(DockerClientTestCase):
|
|||
service.start_container(container)
|
||||
self.assertEqual(container.inspect()['Config']['CpuShares'], 73)
|
||||
|
||||
def test_create_container_with_extra_hosts_list(self):
|
||||
extra_hosts = ['docker:162.242.195.82', 'fig:50.31.209.229']
|
||||
service = self.create_service('db', extra_hosts=extra_hosts)
|
||||
container = service.create_container()
|
||||
service.start_container(container)
|
||||
self.assertEqual(container.get('HostConfig.ExtraHosts'), extra_hosts)
|
||||
|
||||
def test_create_container_with_extra_hosts_string(self):
|
||||
extra_hosts = 'docker:162.242.195.82'
|
||||
service = self.create_service('db', extra_hosts=extra_hosts)
|
||||
container = service.create_container()
|
||||
service.start_container(container)
|
||||
self.assertEqual(container.get('HostConfig.ExtraHosts'), [extra_hosts])
|
||||
|
||||
def test_create_container_with_specified_volume(self):
|
||||
host_path = '/tmp/host-path'
|
||||
container_path = '/container-path'
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue