Add support for creating internal networks
Signed-off-by: Jonathan Giannuzzi <jonathan@giannuzzi.be>
This commit is contained in:
parent
c3fd6a8f4d
commit
83f35e132b
7 changed files with 77 additions and 3 deletions
|
|
@ -756,6 +756,33 @@ class ProjectTest(DockerClientTestCase):
|
|||
with self.assertRaises(ProjectError):
|
||||
project.up()
|
||||
|
||||
@v2_only()
|
||||
def test_project_up_with_network_internal(self):
|
||||
self.require_api_version('1.23')
|
||||
config_data = config.Config(
|
||||
version=V2_0,
|
||||
services=[{
|
||||
'name': 'web',
|
||||
'image': 'busybox:latest',
|
||||
'networks': {'internal': None},
|
||||
}],
|
||||
volumes={},
|
||||
networks={
|
||||
'internal': {'driver': 'bridge', 'internal': True},
|
||||
},
|
||||
)
|
||||
|
||||
project = Project.from_config(
|
||||
client=self.client,
|
||||
name='composetest',
|
||||
config_data=config_data,
|
||||
)
|
||||
project.up()
|
||||
|
||||
network = self.client.networks(names=['composetest_internal'])[0]
|
||||
|
||||
assert network['Internal'] is True
|
||||
|
||||
@v2_only()
|
||||
def test_project_up_volumes(self):
|
||||
vol_name = '{0:x}'.format(random.getrandbits(32))
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue