diff --git a/.gitignore b/.gitignore index 84c3040..38f0a3a 100644 --- a/.gitignore +++ b/.gitignore @@ -1,6 +1,5 @@ build/ dist/ -hippo*.yaml -integration-test.sh *.swp +*.out __pycache__ diff --git a/intest/hippo-empty.yaml b/intest/hippo-empty.yaml new file mode 100644 index 0000000..48ea85f --- /dev/null +++ b/intest/hippo-empty.yaml @@ -0,0 +1,13 @@ +interfaces: + GigabitEthernet3/0/0: + mtu: 1500 + description: Not Used + GigabitEthernet3/0/1: + mtu: 1500 + description: Not Used + HundredGigabitEthernet12/0/0: + mtu: 1500 + description: Not Used + HundredGigabitEthernet12/0/1: + mtu: 1500 + description: Not Used diff --git a/intest/hippo1.yaml b/intest/hippo1.yaml new file mode 100644 index 0000000..8599d53 --- /dev/null +++ b/intest/hippo1.yaml @@ -0,0 +1,85 @@ +bondethernets: + BondEthernet0: + interfaces: [ GigabitEthernet3/0/0, GigabitEthernet3/0/1 ] + +interfaces: + GigabitEthernet3/0/0: + mtu: 9000 + description: "LAG #1" + GigabitEthernet3/0/1: + mtu: 9000 + description: "LAG #2" + + HundredGigabitEthernet12/0/0: + lcp: "ice0" + mtu: 9000 + addresses: [ 192.0.2.17/30, 2001:db8:3::1/64 ] + sub-interfaces: + 1234: + mtu: 1200 + lcp: "ice0.1234" + encapsulation: + dot1q: 1234 + exact-match: True + 1235: + mtu: 1100 + lcp: "ice0.1234.1000" + encapsulation: + dot1q: 1234 + inner-dot1q: 1000 + exact-match: True + + HundredGigabitEthernet12/0/1: + mtu: 2000 + description: "Bridged" + + BondEthernet0: + mtu: 9000 + lcp: "be0" + sub-interfaces: + 100: + mtu: 2500 + l2xc: BondEthernet0.200 + encapsulation: + dot1q: 100 + exact-match: False + 200: + mtu: 2500 + l2xc: BondEthernet0.100 + encapsulation: + dot1q: 200 + exact-match: False + 500: + mtu: 2000 + encapsulation: + dot1ad: 500 + exact-match: False + 501: + mtu: 2000 + encapsulation: + dot1ad: 501 + exact-match: False + vxlan_tunnel1: + mtu: 2000 + +loopbacks: + loop0: + lcp: "lo0" + addresses: [ 10.0.0.1/32, 2001:db8::1/128 ] + loop1: + lcp: "bvi1" + addresses: [ 10.0.1.1/24, 2001:db8:1::1/64 ] + +bridgedomains: + bd1: + mtu: 2000 + bvi: loop1 + interfaces: [ BondEthernet0.500, BondEthernet0.501, HundredGigabitEthernet12/0/1, vxlan_tunnel1 ] + bd11: + mtu: 1500 + +vxlan_tunnels: + vxlan_tunnel1: + local: 192.0.2.1 + remote: 192.0.2.2 + vni: 101 diff --git a/intest/hippo10.yaml b/intest/hippo10.yaml new file mode 100644 index 0000000..d13207d --- /dev/null +++ b/intest/hippo10.yaml @@ -0,0 +1,44 @@ +bondethernets: + BondEthernet0: + interfaces: [ GigabitEthernet3/0/0, GigabitEthernet3/0/1 ] + +interfaces: + GigabitEthernet3/0/0: + mtu: 9000 + description: "LAG #1" + GigabitEthernet3/0/1: + mtu: 9000 + description: "LAG #2" + + HundredGigabitEthernet12/0/0: + description: Not Used + + HundredGigabitEthernet12/0/1: + description: Not Used + + BondEthernet0: + mtu: 9000 + lcp: "be0" + sub-interfaces: + 100: + mtu: 2500 + l2xc: BondEthernet0.200 + encapsulation: + dot1q: 100 + exact-match: False + 200: + mtu: 2500 + l2xc: BondEthernet0.100 + encapsulation: + dot1q: 200 + exact-match: False + 500: + mtu: 2000 + encapsulation: + dot1ad: 500 + exact-match: False + 501: + mtu: 2000 + encapsulation: + dot1ad: 501 + exact-match: False diff --git a/intest/hippo11.yaml b/intest/hippo11.yaml new file mode 100644 index 0000000..45d8caf --- /dev/null +++ b/intest/hippo11.yaml @@ -0,0 +1,44 @@ +bondethernets: + BondEthernet0: + interfaces: [ GigabitEthernet3/0/0, GigabitEthernet3/0/1 ] + +interfaces: + GigabitEthernet3/0/0: + mtu: 9000 + description: "LAG #1" + GigabitEthernet3/0/1: + mtu: 9000 + description: "LAG #2" + + HundredGigabitEthernet12/0/0: + description: Not Used + + HundredGigabitEthernet12/0/1: + description: Not Used + + BondEthernet0: + mtu: 9000 + lcp: "be0" + sub-interfaces: + 200: + mtu: 2500 + l2xc: BondEthernet0.100 + encapsulation: + dot1q: 100 + exact-match: False + 100: + mtu: 2500 + l2xc: BondEthernet0.200 + encapsulation: + dot1q: 200 + exact-match: False + 501: + mtu: 2000 + encapsulation: + dot1ad: 500 + exact-match: False + 500: + mtu: 2000 + encapsulation: + dot1ad: 501 + exact-match: False diff --git a/intest/hippo12.yaml b/intest/hippo12.yaml new file mode 100644 index 0000000..0a03139 --- /dev/null +++ b/intest/hippo12.yaml @@ -0,0 +1,88 @@ +bondethernets: + BondEthernet0: + interfaces: [ GigabitEthernet3/0/0, GigabitEthernet3/0/1 ] + +interfaces: + GigabitEthernet3/0/0: + mtu: 9000 + description: "LAG #1" + GigabitEthernet3/0/1: + mtu: 9000 + description: "LAG #2" + + HundredGigabitEthernet12/0/0: + lcp: "ice12-0-0" + mtu: 9000 + addresses: [ 192.0.2.17/30, 2001:db8:3::1/64 ] + sub-interfaces: + 1234: + mtu: 1200 + lcp: "ice0.1234" + encapsulation: + dot1q: 1234 + exact-match: True + 1235: + mtu: 1100 + lcp: "ice0.1234.1000" + encapsulation: + dot1q: 1234 + inner-dot1q: 1000 + exact-match: True + + HundredGigabitEthernet12/0/1: + mtu: 2000 + description: "Bridged" + + BondEthernet0: + mtu: 9000 + lcp: "bond0" + sub-interfaces: + 10: + lcp: "bond0.10" + mtu: 3000 + 100: + mtu: 2500 + l2xc: BondEthernet0.200 + encapsulation: + dot1q: 100 + exact-match: False + 200: + mtu: 2500 + l2xc: BondEthernet0.100 + encapsulation: + dot1q: 200 + exact-match: False + 500: + mtu: 2000 + encapsulation: + dot1ad: 500 + exact-match: False + 501: + mtu: 2000 + encapsulation: + dot1ad: 501 + exact-match: False + vxlan_tunnel1: + mtu: 2000 + +loopbacks: + loop0: + lcp: "lo0" + addresses: [ 10.0.0.1/32, 2001:db8::1/128 ] + loop1: + lcp: "bvi1" + addresses: [ 10.0.1.1/24, 2001:db8:1::1/64 ] + +bridgedomains: + bd1: + mtu: 2000 + bvi: loop1 + interfaces: [ BondEthernet0.500, BondEthernet0.501, HundredGigabitEthernet12/0/1, vxlan_tunnel1 ] + bd11: + mtu: 1500 + +vxlan_tunnels: + vxlan_tunnel1: + local: 192.0.2.1 + remote: 192.0.2.2 + vni: 101 diff --git a/intest/hippo2.yaml b/intest/hippo2.yaml new file mode 100644 index 0000000..a1e8a10 --- /dev/null +++ b/intest/hippo2.yaml @@ -0,0 +1,62 @@ +interfaces: + GigabitEthernet3/0/0: + sub-interfaces: + 100: + description: "Sub-int" + 101: + encapsulation: + dot1q: 100 + inner-dot1q: 100 + exact-match: true + 200: + description: "Sub-int" + encapsulation: + dot1ad: 100 + exact-match: true + 201: + encapsulation: + dot1ad: 100 + inner-dot1q: 100 + exact-match: true + + GigabitEthernet3/0/1: + sub-interfaces: + 100: + description: "Sub-int" + 200: + description: "Sub-int" + encapsulation: + dot1ad: 100 + exact-match: true + 201: + encapsulation: + dot1ad: 100 + inner-dot1q: 100 + + HundredGigabitEthernet12/0/0: + sub-interfaces: + 100: + description: "Sub-int" + 200: + description: "Sub-int" + encapsulation: + dot1ad: 100 + exact-match: true + 201: + encapsulation: + dot1ad: 100 + inner-dot1q: 100 + + HundredGigabitEthernet12/0/1: + sub-interfaces: + 100: + description: "Sub-int" + 101: + encapsulation: + dot1q: 100 + inner-dot1q: 100 + 200: + description: "Sub-int" + encapsulation: + dot1ad: 100 + exact-match: true diff --git a/intest/hippo3.yaml b/intest/hippo3.yaml new file mode 100644 index 0000000..4195324 --- /dev/null +++ b/intest/hippo3.yaml @@ -0,0 +1,49 @@ +bondethernets: + BondEthernet1: + interfaces: [ GigabitEthernet3/0/0, GigabitEthernet3/0/1 ] + +interfaces: + GigabitEthernet3/0/0: + mtu: 9000 + description: LAG + GigabitEthernet3/0/1: + mtu: 9000 + description: LAG + HundredGigabitEthernet12/0/0: + mtu: 2500 + HundredGigabitEthernet12/0/1: + description: Not Used + + BondEthernet1: + lcp: "bond1" + mtu: 9000 + sub-interfaces: + 200: + lcp: "bond1.1000" + encapsulation: + dot1q: 1000 + exact-match: True + addresses: [ 192.168.0.1/24 ] + 201: + mtu: 3000 + encapsulation: + dot1ad: 1000 + 202: + lcp: "bond1.1000.1234" + encapsulation: + dot1q: 1000 + inner-dot1q: 1234 + exact-match: True + addresses: [ 192.168.1.1/24 ] + 203: + mtu: 2500 + encapsulation: + dot1ad: 1000 + inner-dot1q: 1000 + +bridgedomains: + bd10: + description: "Bridge Domain 10" + mtu: 2500 + interfaces: [ BondEthernet1.203, HundredGigabitEthernet12/0/0 ] + diff --git a/intest/hippo4.yaml b/intest/hippo4.yaml new file mode 100644 index 0000000..eaca1e4 --- /dev/null +++ b/intest/hippo4.yaml @@ -0,0 +1,33 @@ +interfaces: + GigabitEthernet3/0/0: + mtu: 9216 + sub-interfaces: + 100: + mtu: 2000 + l2xc: HundredGigabitEthernet12/0/1.100 + GigabitEthernet3/0/1: + description: Not Used + HundredGigabitEthernet12/0/0: + mtu: 9216 + sub-interfaces: + 100: + mtu: 3000 + 101: + mtu: 2000 + encapsulation: + dot1q: 100 + inner-dot1q: 200 + exact-match: True + HundredGigabitEthernet12/0/1: + mtu: 9216 + sub-interfaces: + 100: + mtu: 2000 + l2xc: GigabitEthernet3/0/0.100 + +bridgedomains: + bd10: + description: "Bridge Domain 10" + mtu: 2000 + interfaces: [ HundredGigabitEthernet12/0/0.101 ] + diff --git a/intest/hippo5.yaml b/intest/hippo5.yaml new file mode 100644 index 0000000..600dbc4 --- /dev/null +++ b/intest/hippo5.yaml @@ -0,0 +1,46 @@ +interfaces: + GigabitEthernet3/0/0: + mtu: 9216 + sub-interfaces: + 100: + mtu: 2000 + l2xc: vxlan_tunnel0 + 101: + l2xc: vxlan_tunnel1 + GigabitEthernet3/0/1: + lcp: "e3-0-1" + addresses: [ 10.0.0.1/24 ] + HundredGigabitEthernet12/0/0: + mtu: 9216 + sub-interfaces: + 100: + mtu: 3000 + 101: + mtu: 2000 + encapsulation: + dot1q: 100 + inner-dot1q: 200 + exact-match: True + HundredGigabitEthernet12/0/1: + mtu: 9216 + vxlan_tunnel0: + mtu: 2000 + l2xc: GigabitEthernet3/0/0.100 + vxlan_tunnel1: + l2xc: GigabitEthernet3/0/0.101 + +bridgedomains: + bd10: + description: "Bridge Domain 10" + mtu: 2000 + interfaces: [ HundredGigabitEthernet12/0/0.101 ] + +vxlan_tunnels: + vxlan_tunnel0: + local: 10.0.0.1 + remote: 10.0.0.3 + vni: 100 + vxlan_tunnel1: + local: 192.0.2.1 + remote: 192.0.2.2 + vni: 101 diff --git a/intest/hippo6.yaml b/intest/hippo6.yaml new file mode 100644 index 0000000..f345218 --- /dev/null +++ b/intest/hippo6.yaml @@ -0,0 +1,46 @@ +interfaces: + GigabitEthernet3/0/0: + mtu: 9216 + sub-interfaces: + 100: + mtu: 2000 + l2xc: vxlan_tunnel0 + 101: + mtu: 3000 + GigabitEthernet3/0/1: + lcp: "e3-0-1" + addresses: [ 10.0.0.1/24 ] + HundredGigabitEthernet12/0/0: + mtu: 9216 + sub-interfaces: + 100: + mtu: 3000 + 101: + mtu: 3000 + encapsulation: + dot1q: 100 + inner-dot1q: 200 + exact-match: True + HundredGigabitEthernet12/0/1: + mtu: 9216 + vxlan_tunnel0: + mtu: 2000 + l2xc: GigabitEthernet3/0/0.100 + vxlan_tunnel1: + mtu: 3000 + +bridgedomains: + bd10: + description: "Bridge Domain 10" + mtu: 3000 + interfaces: [ HundredGigabitEthernet12/0/0.101, GigabitEthernet3/0/0.101, vxlan_tunnel1 ] + +vxlan_tunnels: + vxlan_tunnel0: + local: 10.0.0.1 + remote: 10.0.0.3 + vni: 100 + vxlan_tunnel1: + local: 192.0.2.1 + remote: 192.0.2.2 + vni: 101 diff --git a/intest/hippo7.yaml b/intest/hippo7.yaml new file mode 100644 index 0000000..c4c0991 --- /dev/null +++ b/intest/hippo7.yaml @@ -0,0 +1,45 @@ +interfaces: + GigabitEthernet3/0/0: + mtu: 9216 + sub-interfaces: + 100: + mtu: 2000 + l2xc: vxlan_tunnel0 + 101: + mtu: 3000 + GigabitEthernet3/0/1: + description: Not Used + HundredGigabitEthernet12/0/0: + mtu: 9216 + sub-interfaces: + 100: + mtu: 3000 + 101: + mtu: 3000 + encapsulation: + dot1q: 100 + inner-dot1q: 200 + exact-match: True + HundredGigabitEthernet12/0/1: + mtu: 9216 + vxlan_tunnel0: + mtu: 2000 + l2xc: GigabitEthernet3/0/0.100 + vxlan_tunnel1: + mtu: 3000 + +bridgedomains: + bd10: + description: "Bridge Domain 10" + mtu: 3000 + interfaces: [ HundredGigabitEthernet12/0/0.101, GigabitEthernet3/0/0.101, vxlan_tunnel1 ] + +vxlan_tunnels: + vxlan_tunnel0: + local: 10.0.0.1 + remote: 10.0.0.3 + vni: 100 + vxlan_tunnel1: + local: 192.0.2.1 + remote: 192.0.2.2 + vni: 101 diff --git a/intest/hippo8.yaml b/intest/hippo8.yaml new file mode 100644 index 0000000..3654397 --- /dev/null +++ b/intest/hippo8.yaml @@ -0,0 +1,56 @@ +interfaces: + GigabitEthernet3/0/0: + mtu: 9216 + sub-interfaces: + 100: + mtu: 2000 + l2xc: vxlan_tunnel10 + 101: + mtu: 3000 + GigabitEthernet3/0/1: + description: Not Used + HundredGigabitEthernet12/0/0: + mtu: 9216 + sub-interfaces: + 100: + mtu: 3000 + 101: + mtu: 3000 + encapsulation: + dot1q: 100 + inner-dot1q: 200 + exact-match: True + HundredGigabitEthernet12/0/1: + mtu: 9216 + sub-interfaces: + 100: + l2xc: HundredGigabitEthernet12/0/1.101 + 101: + l2xc: HundredGigabitEthernet12/0/1.100 + vxlan_tunnel10: + mtu: 2000 + l2xc: GigabitEthernet3/0/0.100 + vxlan_tunnel11: + mtu: 3000 + +loopbacks: + loop11: + lcp: "bvi11" + addresses: [ 2001:db8:1::1/64, 192.0.2.1/30 ] + +bridgedomains: + bd11: + description: "Bridge Domain 11" + mtu: 3000 + interfaces: [ HundredGigabitEthernet12/0/0.101, GigabitEthernet3/0/0.101, vxlan_tunnel11 ] + bvi: loop11 + +vxlan_tunnels: + vxlan_tunnel10: + local: 10.0.0.1 + remote: 10.0.0.3 + vni: 100 + vxlan_tunnel11: + local: 192.0.2.1 + remote: 192.0.2.2 + vni: 101 diff --git a/intest/hippo9.yaml b/intest/hippo9.yaml new file mode 100644 index 0000000..49a18da --- /dev/null +++ b/intest/hippo9.yaml @@ -0,0 +1,85 @@ +bondethernets: + BondEthernet0: + interfaces: [ GigabitEthernet3/0/0, GigabitEthernet3/0/1 ] + +interfaces: + GigabitEthernet3/0/0: + mtu: 9000 + description: "LAG #1" + GigabitEthernet3/0/1: + mtu: 9000 + description: "LAG #2" + + HundredGigabitEthernet12/0/0: + lcp: "ice0" + + HundredGigabitEthernet12/0/1: + lcp: "ice1" + mtu: 9000 + addresses: [ 192.0.2.17/30, 2001:db8:3::1/64 ] + sub-interfaces: + 1234: + mtu: 1500 + lcp: "ice1.1234" + encapsulation: + dot1q: 1234 + exact-match: True + 1235: + mtu: 1400 + lcp: "ice1.1234.1000" + encapsulation: + dot1q: 1234 + inner-dot1q: 1000 + exact-match: True + + + BondEthernet0: + mtu: 9000 + lcp: "be0" + sub-interfaces: + 100: + mtu: 2500 + l2xc: BondEthernet0.200 + encapsulation: + dot1q: 100 + exact-match: False + 200: + mtu: 2500 + l2xc: BondEthernet0.100 + encapsulation: + dot1q: 200 + exact-match: False + 500: + mtu: 2000 + encapsulation: + dot1ad: 500 + exact-match: False + 501: + mtu: 2000 + encapsulation: + dot1ad: 501 + exact-match: False + vxlan_tunnel1: + mtu: 1500 + +loopbacks: + loop1: + lcp: "bvi1" + addresses: [ 192.0.2.1/30 ] + loop2: + lcp: "bvi2" + addresses: [ 192.0.2.5/30 ] + +bridgedomains: + bd1: + mtu: 2000 + bvi: loop2 + interfaces: [ BondEthernet0.500, BondEthernet0.501 ] + bd11: + mtu: 1500 + +vxlan_tunnels: + vxlan_tunnel1: + local: 192.0.2.1 + remote: 192.0.2.2 + vni: 101 diff --git a/intest/intest.sh b/intest/intest.sh new file mode 100755 index 0000000..3031cbc --- /dev/null +++ b/intest/intest.sh @@ -0,0 +1,29 @@ +#!/bin/sh + +## NOTE(pim): +## This integration test, while added to the public repository, is meant as an +## internal validation / regression / integration test suite to be run on Hippo +## and Rhino, two reference installs of VPP in IPng Networks. The config files +## here should not be used although they can be a source of config inspiration :) + +## Run me: +# ./intest.sh 2>&1 | tee -a intest.out + + for i in hippo[0-9]*.yaml; do + echo "Clearing: Moving to hippo-empty.yaml" + ../vppcfg -s ../schema.yaml -c hippo-empty.yaml > /tmp/vppcfg-exec-empty + [ -s /tmp/vppcfg-exec-empty ] && vppctl exec /tmp/vppcfg-exec-empty + + for j in hippo[0-9]*.yaml; do + echo " - Moving to $i .. " + ../vppcfg -s ../schema.yaml -c $i > /tmp/vppcfg-exec_$i + [ -s /tmp/vppcfg-exec_$i ] && vppctl exec /tmp/vppcfg-exec_$i + + echo " - Moving from $i to $j" + ../vppcfg -s ../schema.yaml -c $j > /tmp/vppcfg-exec_${i}_${j} + [ -s /tmp/vppcfg-exec_${i}_${j} ] && vppctl exec /tmp/vppcfg-exec_${i}_${j} + + echo " - Checking that from $j to $j is empty" + ../vppcfg -s ../schema.yaml -c $j > /tmp/vppcfg-exec_${j}_${j}_null + done + done