iprange -> ip_range

Signed-off-by: Joffrey F <joffrey@docker.com>
This commit is contained in:
Joffrey F 2018-05-01 17:11:14 -07:00
parent 05638ab5ea
commit 5aafa54667
6 changed files with 37 additions and 5 deletions

View File

@ -311,7 +311,7 @@
"type": "object",
"properties": {
"subnet": {"type": "string"},
"iprange": {"type": "string"},
"ip_range": {"type": "string"},
"gateway": {"type": "string"},
"aux_addresses": {
"type": "object",

View File

@ -365,7 +365,7 @@
"type": "object",
"properties": {
"subnet": {"type": "string"},
"iprange": {"type": "string"},
"ip_range": {"type": "string"},
"gateway": {"type": "string"},
"aux_addresses": {
"type": "object",

View File

@ -374,7 +374,7 @@
"type": "object",
"properties": {
"subnet": {"type": "string"},
"iprange": {"type": "string"},
"ip_range": {"type": "string"},
"gateway": {"type": "string"},
"aux_addresses": {
"type": "object",

View File

@ -418,7 +418,7 @@
"type": "object",
"properties": {
"subnet": {"type": "string"},
"iprange": {"type": "string"},
"ip_range": {"type": "string"},
"gateway": {"type": "string"},
"aux_addresses": {
"type": "object",

View File

@ -417,7 +417,7 @@
"type": "object",
"properties": {
"subnet": {"type": "string"},
"iprange": {"type": "string"},
"ip_range": {"type": "string"},
"gateway": {"type": "string"},
"aux_addresses": {
"type": "object",

View File

@ -1344,6 +1344,38 @@ class ConfigTest(unittest.TestCase):
assert ('networks.foo.ipam.config contains an invalid type,'
' it should be an object') in excinfo.exconly()
def test_config_valid_ipam_config(self):
ipam_config = {
'subnet': '172.28.0.0/16',
'ip_range': '172.28.5.0/24',
'gateway': '172.28.5.254',
'aux_addresses': {
'host1': '172.28.1.5',
'host2': '172.28.1.6',
'host3': '172.28.1.7',
},
}
networks = config.load(
build_config_details(
{
'version': str(V2_1),
'networks': {
'foo': {
'driver': 'default',
'ipam': {
'driver': 'default',
'config': [ipam_config],
}
}
}
},
filename='filename.yml',
)
).networks
assert 'foo' in networks
assert networks['foo']['ipam']['config'] == [ipam_config]
def test_config_valid_service_names(self):
for valid_name in ['_', '-', '.__.', '_what-up.', 'what_.up----', 'whatup']:
services = config.load(