Relax the LCP requirements - it is OK to have an address without an LCP
This commit is contained in:
@ -415,9 +415,6 @@ def validate_interfaces(yaml):
|
||||
iface_lcp = get_lcp(yaml, ifname)
|
||||
iface_address = has_address(yaml, ifname)
|
||||
|
||||
if iface_address and not iface_lcp:
|
||||
msgs.append("interface %s has an address but no LCP" % ifname)
|
||||
result = False
|
||||
if is_l2(yaml, ifname) and iface_lcp:
|
||||
msgs.append("interface %s is in L2 mode but has LCP name %s" % (ifname, iface_lcp))
|
||||
result = False
|
||||
@ -511,10 +508,6 @@ def validate_interfaces(yaml):
|
||||
|
||||
|
||||
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
|
||||
if not iface_lcp:
|
||||
msgs.append("sub-interface %s has an address but %s does not have an LCP" % (sub_ifname, ifname))
|
||||
result = False
|
||||
if is_l2(yaml, sub_ifname):
|
||||
msgs.append("sub-interface %s is in L2 mode but has an address" % sub_ifname)
|
||||
result = False
|
||||
|
@ -2,12 +2,10 @@ test:
|
||||
description: "Interfaces put into the bridge, can't be L3 (so cannot have an address)"
|
||||
errors:
|
||||
expected:
|
||||
- "interface .* has an address but no LCP"
|
||||
- "sub-interface .* has an address but .* does not have an LCP"
|
||||
- "bridgedomain .* member .* has an address"
|
||||
- "interface .* is in L2 mode but has an address"
|
||||
- "sub-interface .* is in L2 mode but has an address"
|
||||
count: 9
|
||||
count: 6
|
||||
---
|
||||
interfaces:
|
||||
GigabitEthernet1/0/0:
|
||||
|
@ -1,18 +0,0 @@
|
||||
test:
|
||||
description: "Sub-interface with addresses must have an LCP. Gi1/0/0 does this wrong, while Gi2/0/0 does it correctly"
|
||||
errors:
|
||||
expected:
|
||||
- "sub-interface .* has an address but .* does not have an LCP"
|
||||
count: 1
|
||||
---
|
||||
interfaces:
|
||||
GigabitEthernet1/0/0:
|
||||
sub-interfaces:
|
||||
100:
|
||||
addresses: [ 192.0.2.1/24 ]
|
||||
GigabitEthernet2/0/0:
|
||||
lcp: "xe2-0-0"
|
||||
sub-interfaces:
|
||||
100:
|
||||
addresses: [ 192.168.1.1/24 ]
|
||||
|
Reference in New Issue
Block a user