Enforce that when a bridgedomain has an address (ie a BVI), that it must also have an LCP
This commit is contained in:
@ -34,11 +34,6 @@ interfaces:
|
||||
GigabitEthernet4/0/1:
|
||||
mtu: 9000
|
||||
|
||||
GigabitEthernet4/0/2:
|
||||
mtu: 9000
|
||||
GigabitEthernet4/0/3:
|
||||
mtu: 9000
|
||||
|
||||
BondEthernet0:
|
||||
mtu: 3000
|
||||
sub-interfaces:
|
||||
@ -61,8 +56,3 @@ bridgedomains:
|
||||
mtu: 9000
|
||||
interfaces: [ GigabitEthernet4/0/0, GigabitEthernet4/0/1 ]
|
||||
lcp: "bvi11"
|
||||
bd13:
|
||||
description: "Bridge Domain 13, address but no LCP"
|
||||
mtu: 9000
|
||||
interfaces: [ GigabitEthernet4/0/2, GigabitEthernet4/0/3 ]
|
||||
addresses: [ 192.0.2.9/29, 2001:db8:1::1/64 ]
|
||||
|
19
unittest/error-bridgedomain5.yaml
Normal file
19
unittest/error-bridgedomain5.yaml
Normal file
@ -0,0 +1,19 @@
|
||||
test:
|
||||
description: "A bridgedomain with a BVI address must have an LCP"
|
||||
errors:
|
||||
expected:
|
||||
- "bridgedomain .* has an address but no LCP"
|
||||
count: 1
|
||||
---
|
||||
interfaces:
|
||||
GigabitEthernet1/0/0:
|
||||
mtu: 3000
|
||||
GigabitEthernet1/0/1:
|
||||
mtu: 3000
|
||||
|
||||
bridgedomains:
|
||||
bd13:
|
||||
description: "Bridge Domain 13, address but no LCP"
|
||||
mtu: 3000
|
||||
interfaces: [ GigabitEthernet1/0/0, GigabitEthernet1/0/0 ]
|
||||
addresses: [ 192.0.2.9/29, 2001:db8:1::1/64 ]
|
@ -32,6 +32,10 @@ def validate_bridgedomains(yaml):
|
||||
if 'mtu' in iface:
|
||||
bd_mtu = iface['mtu']
|
||||
|
||||
if 'addresses' in iface and not 'lcp' in iface:
|
||||
msgs.append("bridgedomain %s has an address but no LCP" % ifname)
|
||||
result = False
|
||||
|
||||
if 'interfaces' in iface:
|
||||
for member in iface['interfaces']:
|
||||
member_iface = interface.get_by_name(yaml, member)
|
||||
|
Reference in New Issue
Block a user