Move unittest YAML files into their own directory, pending more python unit tests in a followup commit

This commit is contained in:
Pim van Pelt
2022-03-20 16:59:13 +00:00
parent dbd7bca8f3
commit 2036795ef1
47 changed files with 1 additions and 1 deletions

View File

@ -0,0 +1,32 @@
test:
description: "A bunch of IP addresses that are wellformed"
errors:
count: 0
---
interfaces:
GigabitEthernet1/0/0:
lcp: e0-0
addresses: [ 192.0.2.1/29, 2001:db8:1::1/64 ]
sub-interfaces:
100:
description: "Overlapping IP addresses are fine, if in the same prefix"
addresses: [ 192.0.2.9/29, 192.0.2.10/29 ]
101:
description: ".. and for IPv6 also, provided the same prefix is used"
addresses: [ 2001:db8:2::1/64, 2001:db8:2::2/64 ]
GigabitEthernet3/0/0:
mtu: 2000
loopbacks:
loop0:
lcp: "loop0"
addresses: [ 10.0.0.1/32, 2001:db8::1/128 ]
bridgedomains:
bd10:
description: "Bridge Domain 10"
mtu: 2000
lcp: "bvi10"
addresses: [ 10.0.0.2/32, 2001:db8::2/128 ]
interfaces: [ GigabitEthernet3/0/0 ]

View File

@ -0,0 +1,36 @@
test:
description: "An example of well formed bondethernet"
errors:
count: 0
---
bondethernets:
BondEthernet0:
interfaces: [ GigabitEthernet1/0/0, GigabitEthernet1/0/1 ]
BondEthernet1:
interfaces: [ GigabitEthernet2/0/0, GigabitEthernet2/0/1 ]
interfaces:
GigabitEthernet1/0/0:
mtu: 3000
GigabitEthernet1/0/1:
mtu: 3000
GigabitEthernet2/0/0:
mtu: 3000
GigabitEthernet2/0/1:
mtu: 3000
BondEthernet0:
mtu: 3000
sub-interfaces:
100:
mtu: 2000
BondEthernet1:
mtu: 3000
lcp: "be012345678"
addresses: [ 192.0.2.1/29, 2001:db8::1/64 ]
sub-interfaces:
100:
mtu: 2000
addresses: [ 192.0.2.9/29, 2001:db8:1::1/64 ]

View File

@ -0,0 +1,58 @@
test:
description: "A few correct examples of well formed bridgedomains"
errors:
count: 0
---
bondethernets:
BondEthernet0:
interfaces: [ GigabitEthernet3/0/0, GigabitEthernet3/0/1 ]
interfaces:
GigabitEthernet1/0/0:
mtu: 3000
GigabitEthernet1/0/1:
mtu: 3000
GigabitEthernet2/0/0:
mtu: 9000
sub-interfaces:
100:
mtu: 2000
GigabitEthernet2/0/1:
mtu: 9000
sub-interfaces:
100:
mtu: 2000
GigabitEthernet3/0/0:
mtu: 9000
GigabitEthernet3/0/1:
mtu: 9000
GigabitEthernet4/0/0:
mtu: 9000
GigabitEthernet4/0/1:
mtu: 9000
BondEthernet0:
mtu: 3000
sub-interfaces:
100:
mtu: 2000
bridgedomains:
bd10:
description: "Bridge Domain 10"
mtu: 3000
interfaces: [ GigabitEthernet1/0/0, GigabitEthernet1/0/1, BondEthernet0 ]
bd11:
description: "Bridge Domain 11, both LCP and address"
mtu: 2000
interfaces: [ GigabitEthernet2/0/0.100, GigabitEthernet2/0/1.100, BondEthernet0.100 ]
lcp: "bvi123456789012"
addresses: [ 192.0.2.1/29, 2001:db8::1/64 ]
bd12:
description: "Bridge Domain 12, LCP but no address"
mtu: 9000
interfaces: [ GigabitEthernet4/0/0, GigabitEthernet4/0/1 ]
lcp: "bvi12"

View File

@ -0,0 +1,6 @@
test:
description: "A completely empty config file is, ironically, correct"
errors:
count: 0
---

View File

@ -0,0 +1,9 @@
test:
description: "A completely empty config file is, ironically, correct"
errors:
count: 0
---
interfaces: {}
loopbacks: {}
bridgedomains: {}
bondethernets: {}

View File

@ -0,0 +1,71 @@
test:
description: "Test that is meant to pass"
errors:
count: 0
---
bondethernets:
BondEthernet0:
description: "Infra: xsw0.lab.ipng.ch LACP"
interfaces: [ GigabitEthernet2/0/0, GigabitEthernet2/0/1 ]
interfaces:
GigabitEthernet1/0/0:
description: "Infra: nikhef-core-1.nl.switch.coloclue.net e1/34"
lcp: e0-0
addresses: [ 94.142.244.85/24, 2A02:898::146:1/64 ]
sub-interfaces:
100:
description: "Cust: hvn0.nlams0.ipng.ch"
addresses: [ 94.142.241.185/29, 2a02:898:146::1/64 ]
101:
description: "Infra: L2 for FrysIX AS112"
GigabitEthernet1/0/1:
description: "Broken - has same LCP as above"
lcp: e0-1
GigabitEthernet2/0/0:
description: "Infra: LAG to xsw0"
GigabitEthernet2/0/1:
description: "Infra: LAG to xsw1"
GigabitEthernet3/0/0:
description: "Infra: Bridge Doamin 10"
BondEthernet0:
description: "Bond, James Bond!"
mac: 00:01:02:03:04:05
lcp: "bond0"
sub-interfaces:
200:
description: "This subint is needed to build the parent LCP bond0.1000 for QinQ subint 202 bond0.1000.1234"
encapsulation:
dot1q: 1000
201:
encapsulation:
dot1ad: 1000
202:
encapsulation:
dot1q: 1000
inner-dot1q: 1234
addresses: [ 192.168.1.1/24 ]
203:
encapsulation:
dot1ad: 1000
inner-dot1q: 1000
loopbacks:
loop0:
description: "Core: example.ipng.ch"
mtu: 9216
lcp: "loop0"
addresses: [ 192.0.2.1/32, 2001:db8:1::1/128 ]
bridgedomains:
bd10:
description: "Bridge Domain 10"
mtu: 1500
lcp: "bvi10"
addresses: [ 192.0.2.9/29, 2001:db8:2::1/64 ]
interfaces: [ BondEthernet0.203, GigabitEthernet3/0/0 ]

View File

@ -0,0 +1,41 @@
test:
description: "A few correct ways of setting L2 cross connects"
errors:
count: 0
---
bondethernets:
BondEthernet0:
interfaces: [ GigabitEthernet3/0/0, GigabitEthernet3/0/1 ]
interfaces:
GigabitEthernet1/0/0:
description: "Cross connected to Gi1/0/1"
l2xc: GigabitEthernet1/0/1
GigabitEthernet1/0/1:
description: "Cross connected to Gi1/0/0"
l2xc: GigabitEthernet1/0/0
GigabitEthernet2/0/0:
description: "Cross connected to Gi2/0/1.100"
l2xc: GigabitEthernet2/0/1.100
GigabitEthernet2/0/1:
description: "Main phy with a subint"
sub-interfaces:
100:
description: "Cross connected to Gi2/0/0"
l2xc: GigabitEthernet2/0/0
GigabitEthernet3/0/0:
mtu: 3000
GigabitEthernet3/0/1:
mtu: 3000
BondEthernet0:
description: "BE0 with two xconnected sub-ints"
sub-interfaces:
100:
description: "Cross connected to BE0.101"
l2xc: BondEthernet0.101
101:
description: "Cross connected to BE0.100"
l2xc: BondEthernet0.100

View File

@ -0,0 +1,19 @@
test:
description: "A few correct examples of well formed loopbacks"
errors:
count: 0
---
loopbacks:
loop0:
description: "Loopback instance loop0 with both address and LCP"
lcp: "lo0"
mtu: 9216
addresses: [ 192.0.2.1/29 ]
loop20:
description: "Loopback instance loop20, with LCP, but no address"
mtu: 9216
lcp: "loop20"
loop1234:
description: "Loopback instance loop1234"

View File

@ -0,0 +1,42 @@
test:
description: "A few correct examples of well formed VXLANs"
errors:
count: 0
---
vxlan_tunnels:
vxlan_tunnel0:
local: 192.0.2.1
remote: 192.0.2.2
vni: 100
vxlan_tunnel1:
local: 2001:db8::1
remote: 2001:db8::2
vni: 101
vxlan_tunnel2:
local: 2001:db8::1
remote: 2001:db8::2
vni: 102
interfaces:
GigabitEthernet1/0/0:
sub-interfaces:
100:
l2xc: vxlan_tunnel1
vxlan_tunnel0:
mtu: 9216
description: "Bridgedomain member"
vxlan_tunnel1:
l2xc: GigabitEthernet1/0/0.100
vxlan_tunnel2:
lcp: 'vxlan1234567890'
addresses: [ 10.0.0.1/24, 2001:db8:1::1/64 ]
bridgedomains:
bd10:
mtu: 9216
interfaces: [ vxlan_tunnel0 ]

View File

@ -0,0 +1,64 @@
test:
description: "IP interfaces cannot be more- or less-specific of any other interface"
errors:
expected:
- "interface .* IP address .* conflicts with another"
- "sub-interface .* IP address .* conflicts with another"
- "loopback .* IP address .* conflicts with another"
- "bridgedomain .* IP address .* conflicts with another"
count: 18
---
interfaces:
GigabitEthernet1/0/0:
lcp: e1-0-0
description: "The 2nd/3rd addresses all are more/less specifics of the first"
addresses: [ 172.16.12.1/29, 172.16.12.2/30, 172.16.12.3/28 ]
GigabitEthernet1/0/1:
lcp: e1-0-1
addresses: [ 192.0.2.1/29, 2001:db8:1::1/64 ]
sub-interfaces:
100:
description: "These addresses overlap with Gi1/0/1"
addresses: [ 192.0.2.2/29, 2001:db8:1::2/64 ]
101:
description: "These addresses overlap with loop0"
addresses: [ 192.0.2.10/29, 2001:db8:2::2/64 ]
GigabitEthernet1/0/2:
lcp: e0-2
description: "These addresses overlap with bd1"
addresses: [ 192.0.2.18/29, 2001:db8:3::2/64 ]
GigabitEthernet1/0/3:
lcp: e0-3
description: "These addresses are more-specific to Gi1/0/4"
addresses: [ 10.0.0.1/24, 2001:db8:3::1/64 ]
GigabitEthernet1/0/4:
lcp: e0-4
description: "These addresses are less-specific to Gi1/0/3"
addresses: [ 10.0.0.2/23, 2001:db8:3::2/60 ]
GigabitEthernet1/0/5:
lcp: e0-5
description: "These addresses are more-specific to Gi1/0/3"
addresses: [ 10.0.0.3/25, 2001:db8:3::3/112 ]
GigabitEthernet3/0/0:
description: "Bridge Domain bd1, member #1"
mtu: 2000
loopbacks:
loop0:
description: "These addresses overlap with Gi1/0/1.101"
lcp: "loop0"
addresses: [ 192.0.2.9/29, 2001:db8:2::1/64 ]
bridgedomains:
bd1:
description: "These addresses overlap with Gi1/0/2"
mtu: 2000
lcp: "bvi1"
addresses: [ 192.0.2.17/29, 2001:db8:3::1/64 ]
interfaces: [ GigabitEthernet3/0/0 ]

View File

@ -0,0 +1,19 @@
test:
description: "Members of a BondEthernet must exist"
errors:
expected:
- "bondethernet .* member .* does not exist"
count: 2
---
bondethernets:
BondEthernet0:
interfaces: [ GigabitEthernet2/0/0, GigabitEthernet2/0/1 ]
interfaces:
GigabitEthernet1/0/0:
mtu: 3000
GigabitEthernet1/0/1:
mtu: 3000
BondEthernet0:
mtu: 3000

View File

@ -0,0 +1,22 @@
test:
description: "Members of a BondEthernet can't have a sub-interface"
errors:
expected:
- "bondethernet .* member .* has sub-interface"
count: 1
---
bondethernets:
BondEthernet0:
interfaces: [ GigabitEthernet1/0/0, GigabitEthernet1/0/1 ]
interfaces:
GigabitEthernet1/0/0:
mtu: 3000
sub-interfaces:
100:
description: "A sub-int on a BondEthernet member is not OK"
GigabitEthernet1/0/1:
mtu: 3000
BondEthernet0:
mtu: 3000

View File

@ -0,0 +1,20 @@
test:
description: "Members of a BondEthernet can't have an LCP"
errors:
expected:
- "bondethernet .* member .* has an LCP"
count: 1
---
bondethernets:
BondEthernet0:
interfaces: [ GigabitEthernet1/0/0, GigabitEthernet1/0/1 ]
interfaces:
GigabitEthernet1/0/0:
mtu: 3000
lcp: "e1-0-0"
GigabitEthernet1/0/1:
mtu: 3000
BondEthernet0:
mtu: 3000

View File

@ -0,0 +1,22 @@
test:
description: "Members of a BondEthernet can't have addresses"
errors:
expected:
- "bondethernet .* member .* has an address"
- "bondethernet .* member .* has an LCP"
count: 2
---
bondethernets:
BondEthernet0:
interfaces: [ GigabitEthernet1/0/0, GigabitEthernet1/0/1 ]
interfaces:
GigabitEthernet1/0/0:
mtu: 3000
lcp: "e1-0-0"
addresses: [ 192.0.2.1/29 ]
GigabitEthernet1/0/1:
mtu: 3000
BondEthernet0:
mtu: 3000

View File

@ -0,0 +1,19 @@
test:
description: "Interfaces put into the bridge, must exist as phy or sub-interface"
errors:
expected:
- "bridgedomain .* member .* does not exist"
count: 2
---
interfaces:
GigabitEthernet1/0/0:
description: "This is the wrong interface, the bridge has Gi1/0/1, not Gi1/0/0"
GigabitEthernet2/0/0:
sub-interfaces:
101:
description: "This is the wrong interface, the bridge has Gi2/0/0.100, not Gi2/0/0.101"
bridgedomains:
bd10:
description: "Bridge Domain 10"
interfaces: [ GigabitEthernet1/0/1, GigabitEthernet2/0/0.100 ]

View File

@ -0,0 +1,20 @@
test:
description: "Interfaces put into the bridge, can't be L3 (so cannot have an LCP)"
errors:
expected:
- "bridgedomain .* member .* has an LCP"
count: 3
---
interfaces:
GigabitEthernet1/0/0:
lcp: "e1-0-0"
GigabitEthernet2/0/0:
lcp: "e2-0-0"
sub-interfaces:
101:
lcp: "v101"
bridgedomains:
bd10:
description: "Bridge Domain 10"
interfaces: [ GigabitEthernet1/0/0, GigabitEthernet2/0/0, GigabitEthernet2/0/0.101 ]

View File

@ -0,0 +1,22 @@
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 LCP"
- "bridgedomain .* member .* has an address"
count: 6
---
interfaces:
GigabitEthernet1/0/0:
addresses: [ 192.0.2.1/29 ]
GigabitEthernet2/0/0:
addresses: [ 192.0.2.9/29 ]
sub-interfaces:
101:
addresses: [ 192.0.2.17/29 ]
bridgedomains:
bd10:
description: "Bridge Domain 10"
interfaces: [ GigabitEthernet1/0/0, GigabitEthernet2/0/0, GigabitEthernet2/0/0.101 ]

View File

@ -0,0 +1,21 @@
test:
description: "In a BridgeDomain, all members must have the same MTU as the bridge itself"
errors:
expected:
- "bridgedomain .* member .* has MTU (2000|3000|500), while bridge has 1500"
count: 3
---
interfaces:
GigabitEthernet1/0/0:
mtu: 2000
GigabitEthernet2/0/0:
mtu: 3000
sub-interfaces:
101:
mtu: 500
bridgedomains:
bd10:
description: "Bridge Domain 10"
mtu: 1500
interfaces: [ GigabitEthernet1/0/0, GigabitEthernet2/0/0, GigabitEthernet2/0/0.101 ]

View 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/1 ]
addresses: [ 192.0.2.9/29, 2001:db8:1::1/64 ]

View File

@ -0,0 +1,32 @@
test:
description: "An interface can only occur in one bridgedomain, not two or more"
errors:
expected:
- "bridgedomain .* member .* is not unique"
count: 2
---
interfaces:
GigabitEthernet1/0/0:
mtu: 3000
GigabitEthernet1/0/1:
mtu: 3000
GigabitEthernet2/0/0:
mtu: 3000
sub-interfaces:
1234:
description: "BD11 and BD12"
bridgedomains:
bd10:
description: "Bridge Domain 10 is well formed"
mtu: 3000
interfaces: [ GigabitEthernet1/0/0, GigabitEthernet1/0/1 ]
bd11:
description: "Bridge Domain 11 uses Gi2/0/0.1234, but so does Bridge Domain 12"
mtu: 1500
interfaces: [ GigabitEthernet2/0/0.1234 ]
bd12:
description: "Bridge Domain 12 uses Gi2/0/0.1234, but so does Bridge Domain 11"
mtu: 1500
interfaces: [ GigabitEthernet2/0/0.1234 ]

View File

@ -0,0 +1,22 @@
test:
description: "An interface that is in a bridgedomain, cannot also be an l2 cross connect"
errors:
expected:
- "interface .* l2xc target .* is in a bridgedomain"
count: 1
---
interfaces:
GigabitEthernet1/0/0:
mtu: 3000
GigabitEthernet1/0/1:
mtu: 3000
GigabitEthernet1/0/1:
mtu: 3000
l2xc: GigabitEthernet1/0/0
bridgedomains:
bd10:
description: "Bridge Domain 10 has Gi1/0/0 which is also a target of an L2XC"
mtu: 3000
interfaces: [ GigabitEthernet1/0/0, GigabitEthernet1/0/1 ]

View File

@ -0,0 +1,12 @@
test:
description: "MTU too small on one interface, too large on another"
errors:
expected:
- "mtu.*less than 128"
- "mtu.*greater than 9216"
---
interfaces:
GigabitEthernet1/0/0:
mtu: 9217
GigabitEthernet1/0/1:
mtu: 127

View File

@ -0,0 +1,12 @@
test:
description: "MTU of sub-interfaces cannot be higher than their parent"
errors:
expected:
- "sub-interface .* has MTU 9001 higher than parent MTU 9000"
---
interfaces:
GigabitEthernet1/0/0:
mtu: 9000
sub-interfaces:
100:
mtu: 9001

View File

@ -0,0 +1,18 @@
test:
description: "L2 cross connect targets cannot occur more than once"
errors:
expected:
- "interface .* l2xc target .* is not unique"
count: 2
---
interfaces:
GigabitEthernet1/0/0:
description: "Cross connected to Gi1/0/1"
l2xc: GigabitEthernet1/0/1
GigabitEthernet1/0/1:
description: "Cross connected to Gi1/0/0"
l2xc: GigabitEthernet1/0/0
GigabitEthernet2/0/0:
description: "Cross connected to Gi1/0/0 as well"
l2xc: GigabitEthernet1/0/0

View File

@ -0,0 +1,14 @@
test:
description: "L2 cross connect targets must exist"
errors:
expected:
- "interface .* l2xc target .* does not exist"
count: 1
---
interfaces:
GigabitEthernet1/0/0:
description: "Cross connected to Gi1/0/1"
l2xc: GigabitEthernet1/0/1
GigabitEthernet1/0/1:
description: "Cross connected to Gi1/0/2, which does not exist"
l2xc: GigabitEthernet1/0/2

View File

@ -0,0 +1,18 @@
test:
description: "L2 cross connect targets cannot also occur in a bridgedomain"
errors:
expected:
- "interface .* l2xc target .* in a bridgedomain"
count: 1
---
interfaces:
GigabitEthernet1/0/0:
description: "Cross connected to Gi1/0/1"
l2xc: GigabitEthernet1/0/1
GigabitEthernet1/0/1:
description: "In a Bridge Domain, so cannot be a target of L2XC"
bridgedomains:
bd10:
description: "A Bridge with gi1/0/0 which also occurs as an L2XC target"
interfaces: [ GigabitEthernet1/0/1 ]

View File

@ -0,0 +1,20 @@
test:
description: "L2 cross connect targets cannot have an IP address or LCP"
errors:
expected:
- "interface .* has l2xc so it cannot be an LCP"
- "interface .* has l2xc so it cannot have an address"
- "interface .* l2xc target .* cannot be an LCP"
- "interface .* l2xc target .* cannot have an address"
count: 6
---
interfaces:
GigabitEthernet1/0/0:
description: "Cross connected to Gi1/0/1, but should not have an LCP"
l2xc: GigabitEthernet1/0/1
lcp: "e1-0-0"
GigabitEthernet1/0/1:
description: "Cross connected to Gi1/0/0, but should not have address and LCP"
l2xc: GigabitEthernet1/0/0
lcp: "e1-0-1"
addresses: [ 192.0.2.1/30 ]

View File

@ -0,0 +1,18 @@
test:
description: "L2 cross connect from a phy cannot also have sub-interfaces"
errors:
expected:
- "interface .* has l2xc so it cannot have sub-interfaces"
count: 1
---
interfaces:
GigabitEthernet1/0/0:
l2xc: GigabitEthernet1/0/1.100
sub-interfaces:
100:
description: "If the parent is cross connected, it should not have sub-interfaces"
GigabitEthernet1/0/1:
sub-interfaces:
100:
l2xc: GigabitEthernet1/0/0

View File

@ -0,0 +1,23 @@
test:
description: "L2 cross connect target cannot have an IP address or LCP"
errors:
expected:
- "sub-interface .* l2xc target .* cannot have an address"
- "sub-interface .* l2xc target .* cannot be an LCP"
count: 2
---
interfaces:
GigabitEthernet1/0/0:
sub-interfaces:
100:
l2xc: GigabitEthernet1/0/1.100
200:
l2xc: GigabitEthernet1/0/1.200
GigabitEthernet1/0/1:
lcp: "xe1-0-1"
sub-interfaces:
100:
addresses: [ 192.0.2.1/30 ]
200:
lcp: 'foo'

View File

@ -0,0 +1,36 @@
test:
description: "L2 cross connect source and target must have the same MTU"
errors:
expected:
- "interface .* l2xc target MTU .* does not match source MTU .*"
- "sub-interface .* l2xc target MTU .* does not match source MTU .*"
count: 6
---
interfaces:
GigabitEthernet1/0/0:
mtu: 9216
l2xc: GigabitEthernet1/0/1
GigabitEthernet1/0/1:
mtu: 9215
l2xc: GigabitEthernet1/0/0
GigabitEthernet2/0/0:
mtu: 9216
sub-interfaces:
100:
mtu: 1500
l2xc: GigabitEthernet2/0/0.200
200:
mtu: 1501
l2xc: GigabitEthernet2/0/0.100
GigabitEthernet3/0/0:
mtu: 9000
l2xc: GigabitEthernet3/0/1.100
GigabitEthernet3/0/1:
mtu: 3000
sub-interfaces:
100:
mtu: 2000
l2xc: GigabitEthernet3/0/0

View File

@ -0,0 +1,16 @@
test:
description: "L2 cross connect source and target cannot be the same"
errors:
expected:
- "interface .* l2xc target cannot be itself"
- "sub-interface .* l2xc target cannot be itself"
count: 2
---
interfaces:
GigabitEthernet1/0/0:
l2xc: GigabitEthernet1/0/0
GigabitEthernet2/0/0:
sub-interfaces:
100:
l2xc: GigabitEthernet2/0/0.100

View File

@ -0,0 +1,18 @@
test:
description: "Two interfaces or subinterfaces can't have the same LCP"
errors:
expected:
- "interface .* does not have a unique LCP name"
- "sub-interface .* does not have a unique LCP name"
count: 3
---
interfaces:
GigabitEthernet1/0/0:
lcp: "e1"
sub-interfaces:
100:
lcp: "e1"
GigabitEthernet1/0/1:
lcp: "e1"

View File

@ -0,0 +1,26 @@
test:
description: "Loopback and BridgeDomain and Interfaces can't have the same LCP"
errors:
expected:
- "interface .* does not have a unique LCP name"
- "loopback .* does not have a unique LCP name"
- "bridgedomain .* does not have a unique LCP name"
count: 3
---
interfaces:
GigabitEthernet1/0/0:
lcp: "e1"
GigabitEthernet2/0/0:
mtu: 1500
GigabitEthernet2/0/1:
mtu: 1500
loopbacks:
loop0:
lcp: "e1"
bridgedomains:
bd0:
lcp: "e1"
interfaces: [ GigabitEthernet2/0/0, GigabitEthernet2/0/1 ]

View File

@ -0,0 +1,12 @@
test:
description: "Cannot give an IP address to a loopback without LCP"
errors:
expected:
- "loopback .* has an address but no LCP"
count: 1
---
loopbacks:
loop10:
description: "Loopback instance loop10, with address, but no LCP"
mtu: 9216
addresses: [ 192.0.2.1/29 ]

View File

@ -0,0 +1,10 @@
test:
description: "Interface description field mistyped"
errors:
expected:
- "descr.*Unexpected element"
count: 1
---
interfaces:
GigabitEthernet1/0/0:
descr: "some description"

View File

@ -0,0 +1,34 @@
test:
description: "A bunch of schema fields with the wrong type"
errors:
expected:
- "yamale: .* is not a "
- "yamale: .*: Unexpected element"
- "Length of .* is greater than 15"
count: 13
---
interfaces:
GigabitEthernet1/0/0:
description: 1234
lcp: True
mac: "0001.0203.0405"
addresses: [ 1234, "hello world", 192.0.2.1, 2001:db8::1 ]
sub-interfaces:
100:
description: [ "a", "list" ]
encapsulation:
dot1q: "hello world"
GigabitEthernet1/0/1:
mtu: 1500
lcp: "a234567890123456"
sub-interfaces:
"string":
description: "the sub-int key should be an int"
garbage:
description: "There's no 'garbage' scope"
loopback:
loop0:
description: "The toplevel scope is 'loopbacks' plural"

View File

@ -0,0 +1,17 @@
test:
description: "Two subinterfaces can't have the same encapsulation"
errors:
expected:
- "100 .* unique encapsulation"
- "101 .* unique encapsulation"
---
interfaces:
GigabitEthernet1/0/0:
sub-interfaces:
100:
description: "VLAN 100"
101:
description: "Another VLAN 100"
encapsulation:
dot1q: 100

View File

@ -0,0 +1,13 @@
test:
description: "A subinterface cannot have an LCP if the parent doesn't have one"
errors:
expected:
- "sub-interface .* has LCP but .* does not have LCP"
---
interfaces:
GigabitEthernet1/0/0:
sub-interfaces:
100:
description: "VLAN 100"
lcp: "foo.100"

View File

@ -0,0 +1,24 @@
test:
description: "The length of the LCP name is too long"
errors:
expected:
- "sub-interface .* has LCP with too long name .*"
count: 2
---
interfaces:
GigabitEthernet1/0/0:
lcp: "e23456789012"
sub-interfaces:
100:
description: "VLAN 100"
GigabitEthernet1/0/1:
lcp: "e2345678"
sub-interfaces:
100:
description: "VLAN 100"
101:
description: "QinQ 101"
encapsulation:
dot1q: 100
inner-dot1q: 100

View File

@ -0,0 +1,21 @@
test:
description: "The length of the generated child LCP name is too long"
errors:
expected:
- "sub-interface .* has LCP with too long name"
---
interfaces:
GigabitEthernet1/0/0:
lcp: "e01234"
sub-interfaces:
100:
description: "Dot1Q subinterface"
encapsulation:
dot1q: 1234
101:
description: "QinQ subinterface"
addresses: [ 192.0.2.1/24 ]
encapsulation:
dot1q: 1234
inner-dot1q: 2345

View File

@ -0,0 +1,17 @@
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 LCP"
---
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 ]

View File

@ -0,0 +1,19 @@
test:
description: "A bunch of sub-interfaces with incorrect encapsulation"
errors:
expected:
- "has invalid encapsulation"
count: 2
---
interfaces:
GigabitEthernet1/0/0:
sub-interfaces:
100:
encapsulation:
## Cannot have both dot1q and dot1ad
dot1q: 100
dot1ad: 100
101:
encapsulation:
## Missing dot1q or dot1ad
inner-dot1q: 100

View File

@ -0,0 +1,10 @@
test:
description: "A completely empty sub-interface is not allowed"
errors:
expected:
- "sub-interface .* has no config"
---
interfaces:
GigabitEthernet1/0/0:
sub-interfaces:
100: {}

View File

@ -0,0 +1,28 @@
test:
description: "A sub-interface with exact-match=False can't have an LCP nor an address"
errors:
expected:
- "sub-interface GigabitEthernet1/0/0.(101|102) has invalid encapsulation"
count: 2
---
interfaces:
GigabitEthernet1/0/0:
lcp: "e1"
sub-interfaces:
100:
encapsulation:
dot1q: 100
exact-match: false
101:
## Can't have an LCP without exact-match
lcp: "e1.101"
encapsulation:
dot1q: 101
exact-match: false
102:
lcp: "e1.102"
## Can't have an address without exact-match
addresses: [ 192.0.2.1/29 ]
encapsulation:
dot1q: 102
exact-match: false

View File

@ -0,0 +1,16 @@
test:
description: "A VXLAN source and destination must be the same address family"
errors:
expected:
- "vxlan_tunnel .* local and remote are not the same address family"
count: 1
---
vxlan_tunnels:
vxlan_tunnel0:
local: 192.0.2.1
remote: 2001:db8::1
vni: 100
interfaces:
vxlan_tunnel0:
description: "My little tunnel"

View File

@ -0,0 +1,24 @@
test:
description: "VXLAN VNIs must be unique"
errors:
expected:
- "vxlan_tunnel .* VNI .* is not unique"
count: 2
---
vxlan_tunnels:
vxlan_tunnel0:
local: 192.0.2.1
remote: 192.0.2.2
vni: 100
vxlan_tunnel1:
local: 2001:db8::1
remote: 2001:db8::2
vni: 100
interfaces:
vxlan_tunnel0:
description: "This tunnel has the same VNI as vxlan_tunnel1"
vxlan_tunnel1:
description: "This tunnel has the same VNI as vxlan_tunnel0"