Remove the attempted plural 'address(es)', and keep it singular. Fix a typo (addd-ress); update unit tests
This commit is contained in:
@ -2,7 +2,7 @@ test:
|
|||||||
description: "Members of a BondEthernet can't have addresses"
|
description: "Members of a BondEthernet can't have addresses"
|
||||||
errors:
|
errors:
|
||||||
expected:
|
expected:
|
||||||
- "bondethernet .* member .* has address"
|
- "bondethernet .* member .* has an address"
|
||||||
- "bondethernet .* member .* has an LCP"
|
- "bondethernet .* member .* has an LCP"
|
||||||
count: 2
|
count: 2
|
||||||
---
|
---
|
||||||
|
@ -2,8 +2,8 @@ test:
|
|||||||
description: "Interfaces put into the bridge, can't be L3 (so cannot have an address)"
|
description: "Interfaces put into the bridge, can't be L3 (so cannot have an address)"
|
||||||
errors:
|
errors:
|
||||||
expected:
|
expected:
|
||||||
- "interface .* has adddress.* but no LCP"
|
- "interface .* has an address but no LCP"
|
||||||
- "sub-interface .* has address.* but .* does not have LCP"
|
- "sub-interface .* has an address but .* does not have LCP"
|
||||||
- "bridgedomain .* member .* has an address"
|
- "bridgedomain .* member .* has an address"
|
||||||
count: 6
|
count: 6
|
||||||
---
|
---
|
||||||
|
@ -2,7 +2,7 @@ test:
|
|||||||
description: "Sub-interface with addresses must have an LCP. Gi1/0/0 does this wrong, while Gi2/0/0 does it correctly"
|
description: "Sub-interface with addresses must have an LCP. Gi1/0/0 does this wrong, while Gi2/0/0 does it correctly"
|
||||||
errors:
|
errors:
|
||||||
expected:
|
expected:
|
||||||
- "sub-interface .* has address.* but .* does not have LCP"
|
- "sub-interface .* has an address but .* does not have LCP"
|
||||||
---
|
---
|
||||||
interfaces:
|
interfaces:
|
||||||
GigabitEthernet1/0/0:
|
GigabitEthernet1/0/0:
|
||||||
|
@ -39,6 +39,6 @@ def validate_bondethernets(yaml):
|
|||||||
msgs.append("bondethernet %s member %s has an LCP" % (ifname, member))
|
msgs.append("bondethernet %s member %s has an LCP" % (ifname, member))
|
||||||
result = False
|
result = False
|
||||||
if interface.has_address(yaml, member):
|
if interface.has_address(yaml, member):
|
||||||
msgs.append("bondethernet %s member %s has address(es)" % (ifname, member))
|
msgs.append("bondethernet %s member %s has an address" % (ifname, member))
|
||||||
result = False
|
result = False
|
||||||
return result, msgs
|
return result, msgs
|
||||||
|
@ -280,7 +280,7 @@ def validate_interfaces(yaml):
|
|||||||
iface_address = has_address(yaml, ifname)
|
iface_address = has_address(yaml, ifname)
|
||||||
|
|
||||||
if iface_address and not iface_lcp:
|
if iface_address and not iface_lcp:
|
||||||
msgs.append("interface %s has adddress(es) but no LCP" % ifname)
|
msgs.append("interface %s has an address but no LCP" % ifname)
|
||||||
result = False
|
result = False
|
||||||
if iface_lcp and not unique_lcp(yaml, ifname):
|
if iface_lcp and not unique_lcp(yaml, ifname):
|
||||||
lcp = get_lcp(yaml, ifname)
|
lcp = get_lcp(yaml, ifname)
|
||||||
@ -311,7 +311,7 @@ def validate_interfaces(yaml):
|
|||||||
if has_address(yaml, sub_ifname):
|
if has_address(yaml, sub_ifname):
|
||||||
## The sub_iface lcp is not required: it can be derived from the iface_lcp, which has to be set
|
## The sub_iface lcp is not required: it can be derived from the iface_lcp, which has to be set
|
||||||
if not iface_lcp:
|
if not iface_lcp:
|
||||||
msgs.append("sub-interface %s has address(es) but %s does not have LCP" % (sub_ifname, ifname))
|
msgs.append("sub-interface %s has an address but %s does not have LCP" % (sub_ifname, ifname))
|
||||||
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))
|
||||||
|
Reference in New Issue
Block a user