Enable use of Docker networking with the --x-networking flag
Signed-off-by: Aanand Prasad <aanand.prasad@gmail.com>
This commit is contained in:
parent
f228173660
commit
d5f5eb1924
14 changed files with 240 additions and 24 deletions
|
|
@ -203,6 +203,26 @@ class ServiceTest(unittest.TestCase):
|
|||
self.assertEqual(opts['hostname'], 'name.sub', 'hostname')
|
||||
self.assertEqual(opts['domainname'], 'domain.tld', 'domainname')
|
||||
|
||||
def test_no_default_hostname_when_not_using_networking(self):
|
||||
service = Service(
|
||||
'foo',
|
||||
image='foo',
|
||||
use_networking=False,
|
||||
client=self.mock_client,
|
||||
)
|
||||
opts = service._get_container_create_options({'image': 'foo'}, 1)
|
||||
self.assertIsNone(opts.get('hostname'))
|
||||
|
||||
def test_hostname_defaults_to_service_name_when_using_networking(self):
|
||||
service = Service(
|
||||
'foo',
|
||||
image='foo',
|
||||
use_networking=True,
|
||||
client=self.mock_client,
|
||||
)
|
||||
opts = service._get_container_create_options({'image': 'foo'}, 1)
|
||||
self.assertEqual(opts['hostname'], 'foo')
|
||||
|
||||
def test_get_container_create_options_with_name_option(self):
|
||||
service = Service(
|
||||
'foo',
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue