Make clearer that 'is not allowed' actually means that the address conflicts with another
This commit is contained in:
@ -54,7 +54,7 @@ loopbacks:
|
|||||||
description: "Core: example.ipng.ch"
|
description: "Core: example.ipng.ch"
|
||||||
mtu: 9216
|
mtu: 9216
|
||||||
lcp: "loop0"
|
lcp: "loop0"
|
||||||
addresses: [ 192.0.2.1/32, 2001:db8:1::1/128 ]
|
addresses: [ 192.0.2.1/32, 192.0.2.2/24, 2001:db8:1::1/128 ]
|
||||||
|
|
||||||
bridgedomains:
|
bridgedomains:
|
||||||
bd10:
|
bd10:
|
||||||
|
@ -2,10 +2,10 @@ test:
|
|||||||
description: "IP interfaces cannot be more- or less-specific of any other interface"
|
description: "IP interfaces cannot be more- or less-specific of any other interface"
|
||||||
errors:
|
errors:
|
||||||
expected:
|
expected:
|
||||||
- "interface .* IP address .* is not allowed"
|
- "interface .* IP address .* conflicts with another"
|
||||||
- "sub-interface .* IP address .* is not allowed"
|
- "sub-interface .* IP address .* conflicts with another"
|
||||||
- "loopback .* IP address .* is not allowed"
|
- "loopback .* IP address .* conflicts with another"
|
||||||
- "bridgedomain .* IP address .* is not allowed"
|
- "bridgedomain .* IP address .* conflicts with another"
|
||||||
count: 18
|
count: 18
|
||||||
---
|
---
|
||||||
interfaces:
|
interfaces:
|
||||||
|
@ -56,7 +56,7 @@ def validate_bridgedomains(yaml):
|
|||||||
if 'addresses' in iface:
|
if 'addresses' in iface:
|
||||||
for a in iface['addresses']:
|
for a in iface['addresses']:
|
||||||
if not address.is_allowed(yaml, ifname, iface['addresses'], a):
|
if not address.is_allowed(yaml, ifname, iface['addresses'], a):
|
||||||
msgs.append("bridgedomain %s IP address %s is not allowed" % (ifname, a))
|
msgs.append("bridgedomain %s IP address %s conflicts with another" % (ifname, a))
|
||||||
result = False
|
result = False
|
||||||
|
|
||||||
if 'interfaces' in iface:
|
if 'interfaces' in iface:
|
||||||
|
@ -287,7 +287,7 @@ def validate_interfaces(yaml):
|
|||||||
if 'addresses' in iface:
|
if 'addresses' in iface:
|
||||||
for a in iface['addresses']:
|
for a in iface['addresses']:
|
||||||
if not address.is_allowed(yaml, ifname, iface['addresses'], a):
|
if not address.is_allowed(yaml, ifname, iface['addresses'], a):
|
||||||
msgs.append("interface %s IP address %s is not allowed" % (ifname, a))
|
msgs.append("interface %s IP address %s conflicts with another" % (ifname, a))
|
||||||
result = False
|
result = False
|
||||||
|
|
||||||
if has_sub(yaml, ifname):
|
if has_sub(yaml, ifname):
|
||||||
@ -321,7 +321,7 @@ def validate_interfaces(yaml):
|
|||||||
result = False
|
result = False
|
||||||
for a in sub_iface['addresses']:
|
for a in sub_iface['addresses']:
|
||||||
if not address.is_allowed(yaml, sub_ifname, sub_iface['addresses'], a):
|
if not address.is_allowed(yaml, sub_ifname, sub_iface['addresses'], a):
|
||||||
msgs.append("sub-interface %s IP address %s is not allowed" % (sub_ifname, a))
|
msgs.append("sub-interface %s IP address %s conflicts with another" % (sub_ifname, a))
|
||||||
result = False
|
result = False
|
||||||
if not valid_encapsulation(yaml, sub_ifname):
|
if not valid_encapsulation(yaml, sub_ifname):
|
||||||
msgs.append("sub-interface %s has invalid encapsulation" % (sub_ifname))
|
msgs.append("sub-interface %s has invalid encapsulation" % (sub_ifname))
|
||||||
|
@ -50,7 +50,7 @@ def validate_loopbacks(yaml):
|
|||||||
if 'addresses' in iface:
|
if 'addresses' in iface:
|
||||||
for a in iface['addresses']:
|
for a in iface['addresses']:
|
||||||
if not address.is_allowed(yaml, ifname, iface['addresses'], a):
|
if not address.is_allowed(yaml, ifname, iface['addresses'], a):
|
||||||
msgs.append("loopback %s IP address %s is not allowed" % (ifname, a))
|
msgs.append("loopback %s IP address %s conflicts with another" % (ifname, a))
|
||||||
result = False
|
result = False
|
||||||
|
|
||||||
return result, msgs
|
return result, msgs
|
||||||
|
Reference in New Issue
Block a user