Skip to content

Commit

Permalink
MPLS integration tests
Browse files Browse the repository at this point in the history
  • Loading branch information
ipspace committed Jul 30, 2024
1 parent e761066 commit 6cc43f1
Show file tree
Hide file tree
Showing 7 changed files with 509 additions and 0 deletions.
60 changes: 60 additions & 0 deletions tests/integration/mpls/01-ldp-p.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
---
message:
The tested device (DUT) is a P-router. It runs OSPF and LDP with another
P-router and a PE-router, and performs label switching. The validation test
checks end-to-end connectivity across a BGP-free MPLS core.

bgp.advertise_loopback: false

groups:
_auto_create: True
hosts:
members: [ h1, h2 ]
device: linux
provider: clab
pe:
members: [ pe1, pe2 ]
module: [ ospf, bgp, mpls ]
mpls.ldp: True
bgp.as: 65001
p:
members: [ dut, p2 ]
module: [ ospf, mpls ]
mpls.ldp: True
x_switches:
members: [ pe1, pe2, p2 ]
device: frr
provider: clab

links:
- h1:
pe1:
ospf: false
- pe1-dut
- dut-p2
- p2-pe2
- pe2:
h2:
ospf: false

validate:
ospf:
description: Check OSPF sessions with DUT (wait up to 30 seconds)
wait: 30
wait_msg: Waiting for OSPF adjacency
nodes: [ pe1, p2 ]
plugin: ospf_neighbor(nodes.dut.ospf.router_id)
stop_on_error: true
ibgp:
description: Check IBGP session
wait: 40
wait_msg: Waiting for IBGP sessions to start
nodes: [ pe2 ]
plugin: bgp_neighbor(node.bgp.neighbors,'pe1')
stop_on_error: true
ping:
description: Ping-based end-to-end reachability test
wait_msg: We might have to wait a bit longer
wait: 10
nodes: [ h1 ]
plugin: ping('h2')
60 changes: 60 additions & 0 deletions tests/integration/mpls/02-ldp-pe.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
message:
The tested device (DUT) is a PE-router. It runs OSPF and LDP with a P-router
and an IBGP session with another PE-router. It has to perform IP-to-MPLS
encapsulation to get the traffic across the BGP-free MPLS core.

The validation test checks end-to-end connectivity across a BGP-free MPLS core
between a set of linux hosts attached to the PE-routers.

groups:
_auto_create: True
hosts:
members: [ h1, h2 ]
device: linux
provider: clab
pe:
members: [ dut, pe2 ]
module: [ ospf, bgp, mpls ]
mpls.ldp: True
bgp.as: 65001
p:
members: [ p1, p2 ]
module: [ ospf, mpls ]
mpls.ldp: True
x_switches:
members: [ p1, p2, pe2 ]
device: frr
provider: clab

links:
- h1:
dut:
ospf: false
- dut-p1
- p1-p2
- p2-pe2
- pe2:
h2:
ospf: false

validate:
ospf:
description: Check OSPF sessions with DUT (wait up to 30 seconds)
wait: 30
wait_msg: Waiting for OSPF adjacency
nodes: [ p1 ]
plugin: ospf_neighbor(nodes.dut.ospf.router_id)
stop_on_error: true
ibgp:
description: Check IBGP session
wait: 40
wait_msg: Waiting for IBGP sessions to start
nodes: [ pe2 ]
plugin: bgp_neighbor(node.bgp.neighbors,'dut')
stop_on_error: true
ping:
description: Ping-based end-to-end reachability test
wait_msg: We might have to wait a bit longer
wait: 10
nodes: [ h1 ]
plugin: ping('h2')
70 changes: 70 additions & 0 deletions tests/integration/mpls/10-vpn-connected.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,70 @@
message:
The tested device (DUT) is a PE-router running MPLS/VPN with two VRFs. The
Linux hosts are attached directly to the PE-router.

The PE-router has to run OSPF and LDP with a P-router and exchange VPNv4
routes with another PE-router. The connected subnets must be redistributed
into VPNv4 AF for the end-to-end connectivity test to work.

groups:
_auto_create: True
hosts:
members: [ h1, h2, h3, h4 ]
device: linux
provider: clab
pe:
members: [ dut, pe2 ]
module: [ ospf, bgp, mpls, vrf ]
mpls.ldp: True
mpls.vpn: True
bgp.as: 65001
p:
members: [ p1, p2 ]
module: [ ospf, mpls ]
mpls.ldp: True
x_switches:
members: [ p1, p2, pe2 ]
device: frr
provider: clab

vrfs:
t1:
links: [ h1-dut, h2-pe2 ]
t2:
links: [ h3-dut, h4-pe2 ]

links: [ dut-p1, p1-p2, p2-pe2 ]

validate:
pe_ospf:
description: Check OSPF sessions with DUT (wait up to 30 seconds)
wait: 30
wait_msg: Waiting for OSPF adjacency
nodes: [ p1 ]
plugin: ospf_neighbor(nodes.dut.ospf.router_id)
stop_on_error: true
pe_ibgp:
description: Check IBGP session between PE-routers
wait: 40
wait_msg: Waiting for IBGP sessions to start
nodes: [ pe2 ]
plugin: bgp_neighbor(node.bgp.neighbors,'dut')
stop_on_error: true
ping_red:
description: Ping-based end-to-end reachability test (VRF red)
wait_msg: We might have to wait a bit longer
wait: 10
nodes: [ h1 ]
plugin: ping('h2')
ping_blue:
description: Ping-based end-to-end reachability test (VRF blue)
wait_msg: We might have to wait a bit longer
wait: 10
nodes: [ h3 ]
plugin: ping('h4')
ping_inter:
description: Inter-VRF ping-based reachability
wait_msg: We might have to wait a bit longer
wait: 3
nodes: [ h1 ]
plugin: ping('h4',expect='fail')
72 changes: 72 additions & 0 deletions tests/integration/mpls/11-vpn-cs.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,72 @@
message:
The tested device (DUT) is a PE-router running MPLS/VPN and implementing
common services VRF.

The test checks the MPLS/VPN route import/export functionality. It should
succeed if the simple MPLS/VPN test and the VRF Common Services test succeded
unless you have to configure some weird nerd knobs to make it work.

groups:
_auto_create: True
hosts:
members: [ h1, h2, h3, ch ]
device: linux
provider: clab
pe:
members: [ dut, pe2 ]
module: [ ospf, bgp, mpls, vrf ]
mpls.ldp: True
mpls.vpn: True
bgp.as: 65001
p:
members: [ p1, p2 ]
module: [ ospf, mpls ]
mpls.ldp: True
x_switches:
members: [ p1, p2, pe2 ]
device: frr
provider: clab

vrfs:
t1:
links: [ h1-dut ]
import: [ t1, common ]
t2:
links: [ h2-pe2 ]
import: [ t2, common ]
t3:
links: [ h3-pe2 ]
import: [ t3, common ]
common:
links: [ dut-ch ]
import: [ t1, t2, t3, common ]

links: [ dut-p1, p1-p2, p2-pe2 ]

validate:
pe_ospf:
description: Check OSPF sessions with DUT (wait up to 30 seconds)
wait: 30
wait_msg: Waiting for OSPF adjacency
nodes: [ p1 ]
plugin: ospf_neighbor(nodes.dut.ospf.router_id)
stop_on_error: true
pe_ibgp:
description: Check IBGP session between PE-routers
wait: 40
wait_msg: Waiting for IBGP sessions to start
nodes: [ pe2 ]
plugin: bgp_neighbor(node.bgp.neighbors,'dut')
stop_on_error: true
ping_cs:
description: Ping-based end-to-end reachability test (common services)
wait_msg: We might have to wait a bit longer
wait: 10
nodes: [ h1, h2, h3 ]
plugin: ping('ch')
ping_inter:
description: Inter-VRF ping-based reachability
wait_msg: We might have to wait a bit longer
wait: 3
nodes: [ h1 ]
plugin: ping('h2',expect='fail')
81 changes: 81 additions & 0 deletions tests/integration/mpls/12-vpn-bgp.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,81 @@
message:
The tested device (DUT) is a PE-router running MPLS/VPN with a simple VRF. Two
BGP-speaking CE-routers are attached to the VRF (one per PE-router)

The PE-router has to run OSPF and LDP with a P-router, exchange IPv4 routes
via BGP with the CE-router, convert VRF IPv4 routes into VPNv4 routes, and
pass them to another PE-router.

The validation tests check BGP prefixes on the CE-routers and perform
end-to-end connectivity tests between CE-router loopbacks.

groups:
_auto_create: True
ce:
members: [ ce1, ce2 ]
device: frr
provider: clab
module: [ bgp ]
pe:
members: [ dut, pe2 ]
module: [ ospf, bgp, mpls, vrf ]
mpls.ldp: True
mpls.vpn: True
bgp.as: 65001
p:
members: [ p1, p2 ]
module: [ ospf, mpls ]
mpls.ldp: True
x_switches:
members: [ p1, p2, pe2 ]
device: frr
provider: clab

nodes:
ce1:
bgp.as: 65100
ce2:
bgp.as: 65101

vrfs:
tenant:
links: [ ce1-dut, ce2-pe2 ]

links: [ dut-p1, p1-p2, p2-pe2 ]

validate:
pe_ospf:
description: Check OSPF sessions with DUT (wait up to 30 seconds)
wait: 30
wait_msg: Waiting for OSPF adjacency
nodes: [ p1 ]
plugin: ospf_neighbor(nodes.dut.ospf.router_id)
stop_on_error: true
pe_ibgp:
description: Check IBGP session between PE-routers
wait: 40
wait_msg: Waiting for IBGP sessions to start
nodes: [ pe2 ]
plugin: bgp_neighbor(node.bgp.neighbors,'dut')
stop_on_error: true
ce_ebgp:
description: Check PE-CE EBGP session
wait: 10
wait_msg: Waiting for EBGP sessions to start
nodes: [ ce1 ]
plugin: bgp_neighbor(node.bgp.neighbors,'dut')
stop_on_error: true
pfx_ce1:
description: Check CE2 BGP prefix on CE1
wait: 10
nodes: [ ce1 ]
plugin: bgp_prefix(nodes.ce2.loopback.ipv4)
pfx_ce2:
description: Check CE1 BGP prefix on CE2
wait: 10
nodes: [ ce2 ]
plugin: bgp_prefix(nodes.ce1.loopback.ipv4)
ping:
description: Ping-based end-to-end reachability test
nodes: [ ce1 ]
plugin: ping('ce2',src=node.loopback.ipv4)
Loading

0 comments on commit 6cc43f1

Please sign in to comment.