ldp_vpls_topo1: add new topology for ldp pseudowires

This is a very simple topology for testing LDP pseudowires.

Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
This commit is contained in:
Renato Westphal 2017-07-13 02:25:06 -03:00 committed by Donald Sharp
parent 2dad85f432
commit 6fcaea2bc6
38 changed files with 2158 additions and 0 deletions

View File

@ -0,0 +1,12 @@
log file /tmp/ce1-zebra.log
!
hostname ce1
!
interface ce1-eth0
ip address 172.16.1.1/24
no link-detect
!
ip forwarding
!
line vty
!

View File

@ -0,0 +1,12 @@
log file /tmp/ce2-zebra.log
!
hostname ce2
!
interface ce2-eth0
ip address 172.16.1.2/24
no link-detect
!
ip forwarding
!
line vty
!

View File

@ -0,0 +1,12 @@
log file /tmp/ce3-zebra.log
!
hostname ce3
!
interface ce3-eth0
ip address 172.16.1.3/24
no link-detect
!
ip forwarding
!
line vty
!

View File

@ -0,0 +1,34 @@
hostname r1
log file /tmp/r1-ldpd.log
!
debug mpls ldp zebra
debug mpls ldp event
debug mpls ldp errors
debug mpls ldp messages recv
debug mpls ldp messages sent
debug mpls ldp discovery hello recv
debug mpls ldp discovery hello sent
!
mpls ldp
router-id 1.1.1.1
!
address-family ipv4
discovery transport-address 1.1.1.1
label local allocate host-routes
!
interface r1-eth1
!
interface r1-eth2
!
!
!
l2vpn CUST_A type vpls
member interface r1-eth0
!
member pseudowire r1-mpw0
neighbor lsr-id 2.2.2.2
pw-id 100
!
!
line vty
!

View File

@ -0,0 +1,7 @@
hostname r1
log file /tmp/r1-ospfd.log
!
router ospf
router-id 1.1.1.1
network 0.0.0.0/0 area 0
!

View File

@ -0,0 +1,14 @@
{
"2.2.2.2":{
"priority":1,
"state":"Full/DR",
"address":"10.0.1.2",
"ifaceName":"r1-eth1:10.0.1.1"
},
"3.3.3.3":{
"priority":1,
"state":"Full/DR",
"address":"10.0.2.3",
"ifaceName":"r1-eth2:10.0.2.1"
}
}

View File

@ -0,0 +1,157 @@
{
"1.1.1.1/32":[
{
"prefix":"1.1.1.1/32",
"protocol":"ospf",
"distance":110,
"metric":0,
"nexthops":[
{
"directlyConnected":true,
"interfaceIndex":1,
"interfaceName":"lo",
"active":true
}
]
},
{
"prefix":"1.1.1.1/32",
"protocol":"connected",
"selected":true,
"nexthops":[
{
"fib":true,
"directlyConnected":true,
"interfaceIndex":1,
"interfaceName":"lo",
"active":true
}
]
}
],
"2.2.2.2/32":[
{
"prefix":"2.2.2.2/32",
"protocol":"ospf",
"selected":true,
"distance":110,
"metric":10,
"nexthops":[
{
"fib":true,
"ip":"10.0.1.2",
"afi":"ipv4",
"interfaceIndex":3,
"interfaceName":"r1-eth1",
"active":true
}
]
}
],
"3.3.3.3/32":[
{
"prefix":"3.3.3.3/32",
"protocol":"ospf",
"selected":true,
"distance":110,
"metric":10,
"nexthops":[
{
"fib":true,
"ip":"10.0.2.3",
"afi":"ipv4",
"interfaceIndex":4,
"interfaceName":"r1-eth2",
"active":true
}
]
}
],
"10.0.1.0/24":[
{
"prefix":"10.0.1.0/24",
"protocol":"ospf",
"distance":110,
"metric":10,
"nexthops":[
{
"directlyConnected":true,
"interfaceIndex":3,
"interfaceName":"r1-eth1",
"active":true
}
]
},
{
"prefix":"10.0.1.0/24",
"protocol":"connected",
"selected":true,
"nexthops":[
{
"fib":true,
"directlyConnected":true,
"interfaceIndex":3,
"interfaceName":"r1-eth1",
"active":true
}
]
}
],
"10.0.2.0/24":[
{
"prefix":"10.0.2.0/24",
"protocol":"ospf",
"distance":110,
"metric":10,
"nexthops":[
{
"directlyConnected":true,
"interfaceIndex":4,
"interfaceName":"r1-eth2",
"active":true
}
]
},
{
"prefix":"10.0.2.0/24",
"protocol":"connected",
"selected":true,
"nexthops":[
{
"fib":true,
"directlyConnected":true,
"interfaceIndex":4,
"interfaceName":"r1-eth2",
"active":true
}
]
}
],
"10.0.3.0/24":[
{
"prefix":"10.0.3.0/24",
"protocol":"ospf",
"selected":true,
"distance":110,
"metric":20,
"nexthops":[
{
"fib":true,
"ip":"10.0.1.2",
"afi":"ipv4",
"interfaceIndex":3,
"interfaceName":"r1-eth1",
"active":true
},
{
"fib":true,
"ip":"10.0.2.3",
"afi":"ipv4",
"interfaceIndex":4,
"interfaceName":"r1-eth2",
"active":true
}
]
}
]
}

View File

@ -0,0 +1,16 @@
{
"2.2.2.2: 100":{
"destination":"2.2.2.2",
"vcId":100,
"localLabel":16,
"localControlWord":1,
"localVcType":"Ethernet",
"localGroupID":0,
"localIfMtu":1500,
"remoteLabel":16,
"remoteControlWord":1,
"remoteVcType":"Ethernet",
"remoteGroupID":0,
"remoteIfMtu":1500
}
}

View File

@ -0,0 +1,8 @@
{
"r1-mpw0":{
"peerId":"2.2.2.2",
"vcId":100,
"VpnName":"CUST_A",
"status":"up"
}
}

View File

@ -0,0 +1,52 @@
{
"bindings":[
{
"addressFamily":"ipv4",
"prefix":"1.1.1.1/32",
"neighborId":"2.2.2.2",
"localLabel":"imp-null",
"remoteLabel":"17",
"inUse":0
},
{
"addressFamily":"ipv4",
"prefix":"1.1.1.1/32",
"neighborId":"3.3.3.3",
"localLabel":"imp-null",
"remoteLabel":"16",
"inUse":0
},
{
"addressFamily":"ipv4",
"prefix":"2.2.2.2/32",
"neighborId":"2.2.2.2",
"localLabel":"17",
"remoteLabel":"imp-null",
"inUse":1
},
{
"addressFamily":"ipv4",
"prefix":"2.2.2.2/32",
"neighborId":"3.3.3.3",
"localLabel":"17",
"remoteLabel":"17",
"inUse":0
},
{
"addressFamily":"ipv4",
"prefix":"3.3.3.3/32",
"neighborId":"2.2.2.2",
"localLabel":"18",
"remoteLabel":"18",
"inUse":0
},
{
"addressFamily":"ipv4",
"prefix":"3.3.3.3/32",
"neighborId":"3.3.3.3",
"localLabel":"18",
"remoteLabel":"imp-null",
"inUse":1
}
]
}

View File

@ -0,0 +1,25 @@
{
"adjacencies":[
{
"addressFamily":"ipv4",
"neighborId":"2.2.2.2",
"type":"link",
"interface":"r1-eth1",
"helloHoldtime":15
},
{
"addressFamily":"ipv4",
"neighborId":"2.2.2.2",
"type":"targeted",
"peer":"2.2.2.2",
"helloHoldtime":45
},
{
"addressFamily":"ipv4",
"neighborId":"3.3.3.3",
"type":"link",
"interface":"r1-eth2",
"helloHoldtime":15
}
]
}

View File

@ -0,0 +1,16 @@
{
"neighbors":[
{
"addressFamily":"ipv4",
"neighborId":"2.2.2.2",
"state":"OPERATIONAL",
"transportAddress":"2.2.2.2"
},
{
"addressFamily":"ipv4",
"neighborId":"3.3.3.3",
"state":"OPERATIONAL",
"transportAddress":"3.3.3.3"
}
]
}

View File

@ -0,0 +1,30 @@
log file /tmp/r1-zebra.log
!
hostname r1
!
debug zebra rib
debug zebra nht
debug zebra pseudowires
debug zebra packet
!
interface lo
ip address 1.1.1.1/32
!
interface r1-eth0
description to s1
no link-detect
!
interface r1-eth1
description to s4
ip address 10.0.1.1/24
no link-detect
!
interface r1-eth2
description to s5
ip address 10.0.2.1/24
no link-detect
!
ip forwarding
!
line vty
!

View File

@ -0,0 +1,34 @@
hostname r2
log file /tmp/r2-ldpd.log
!
debug mpls ldp zebra
debug mpls ldp event
debug mpls ldp errors
debug mpls ldp messages recv
debug mpls ldp messages sent
debug mpls ldp discovery hello recv
debug mpls ldp discovery hello sent
!
mpls ldp
router-id 2.2.2.2
!
address-family ipv4
discovery transport-address 2.2.2.2
label local allocate host-routes
!
interface r2-eth1
!
interface r2-eth2
!
!
!
l2vpn CUST_A type vpls
member interface r2-eth0
!
member pseudowire r2-mpw0
neighbor lsr-id 1.1.1.1
pw-id 100
!
!
line vty
!

View File

@ -0,0 +1,7 @@
hostname r2
log file /tmp/r2-ospfd.log
!
router ospf
router-id 2.2.2.2
network 0.0.0.0/0 area 0
!

View File

@ -0,0 +1,14 @@
{
"1.1.1.1":{
"priority":1,
"state":"Full/Backup",
"address":"10.0.1.1",
"ifaceName":"r2-eth1:10.0.1.2"
},
"3.3.3.3":{
"priority":1,
"state":"Full/DR",
"address":"10.0.3.3",
"ifaceName":"r2-eth2:10.0.3.2"
}
}

View File

@ -0,0 +1,157 @@
{
"1.1.1.1/32":[
{
"prefix":"1.1.1.1/32",
"protocol":"ospf",
"selected":true,
"distance":110,
"metric":10,
"nexthops":[
{
"fib":true,
"ip":"10.0.1.1",
"afi":"ipv4",
"interfaceIndex":3,
"interfaceName":"r2-eth1",
"active":true
}
]
}
],
"2.2.2.2/32":[
{
"prefix":"2.2.2.2/32",
"protocol":"ospf",
"distance":110,
"metric":0,
"nexthops":[
{
"directlyConnected":true,
"interfaceIndex":1,
"interfaceName":"lo",
"active":true
}
]
},
{
"prefix":"2.2.2.2/32",
"protocol":"connected",
"selected":true,
"nexthops":[
{
"fib":true,
"directlyConnected":true,
"interfaceIndex":1,
"interfaceName":"lo",
"active":true
}
]
}
],
"3.3.3.3/32":[
{
"prefix":"3.3.3.3/32",
"protocol":"ospf",
"selected":true,
"distance":110,
"metric":10,
"nexthops":[
{
"fib":true,
"ip":"10.0.3.3",
"afi":"ipv4",
"interfaceIndex":4,
"interfaceName":"r2-eth2",
"active":true
}
]
}
],
"10.0.1.0/24":[
{
"prefix":"10.0.1.0/24",
"protocol":"ospf",
"distance":110,
"metric":10,
"nexthops":[
{
"directlyConnected":true,
"interfaceIndex":3,
"interfaceName":"r2-eth1",
"active":true
}
]
},
{
"prefix":"10.0.1.0/24",
"protocol":"connected",
"selected":true,
"nexthops":[
{
"fib":true,
"directlyConnected":true,
"interfaceIndex":3,
"interfaceName":"r2-eth1",
"active":true
}
]
}
],
"10.0.2.0/24":[
{
"prefix":"10.0.2.0/24",
"protocol":"ospf",
"selected":true,
"distance":110,
"metric":20,
"nexthops":[
{
"fib":true,
"ip":"10.0.1.1",
"afi":"ipv4",
"interfaceIndex":3,
"interfaceName":"r2-eth1",
"active":true
},
{
"fib":true,
"ip":"10.0.3.3",
"afi":"ipv4",
"interfaceIndex":4,
"interfaceName":"r2-eth2",
"active":true
}
]
}
],
"10.0.3.0/24":[
{
"prefix":"10.0.3.0/24",
"protocol":"ospf",
"distance":110,
"metric":10,
"nexthops":[
{
"directlyConnected":true,
"interfaceIndex":4,
"interfaceName":"r2-eth2",
"active":true
}
]
},
{
"prefix":"10.0.3.0/24",
"protocol":"connected",
"selected":true,
"nexthops":[
{
"fib":true,
"directlyConnected":true,
"interfaceIndex":4,
"interfaceName":"r2-eth2",
"active":true
}
]
}
]
}

View File

@ -0,0 +1,16 @@
{
"1.1.1.1: 100":{
"destination":"1.1.1.1",
"vcId":100,
"localLabel":16,
"localControlWord":1,
"localVcType":"Ethernet",
"localGroupID":0,
"localIfMtu":1500,
"remoteLabel":16,
"remoteControlWord":1,
"remoteVcType":"Ethernet",
"remoteGroupID":0,
"remoteIfMtu":1500
}
}

View File

@ -0,0 +1,8 @@
{
"r2-mpw0":{
"peerId":"1.1.1.1",
"vcId":100,
"VpnName":"CUST_A",
"status":"up"
}
}

View File

@ -0,0 +1,52 @@
{
"bindings":[
{
"addressFamily":"ipv4",
"prefix":"1.1.1.1/32",
"neighborId":"1.1.1.1",
"localLabel":"17",
"remoteLabel":"imp-null",
"inUse":1
},
{
"addressFamily":"ipv4",
"prefix":"1.1.1.1/32",
"neighborId":"3.3.3.3",
"localLabel":"17",
"remoteLabel":"16",
"inUse":0
},
{
"addressFamily":"ipv4",
"prefix":"2.2.2.2/32",
"neighborId":"1.1.1.1",
"localLabel":"imp-null",
"remoteLabel":"17",
"inUse":0
},
{
"addressFamily":"ipv4",
"prefix":"2.2.2.2/32",
"neighborId":"3.3.3.3",
"localLabel":"imp-null",
"remoteLabel":"17",
"inUse":0
},
{
"addressFamily":"ipv4",
"prefix":"3.3.3.3/32",
"neighborId":"1.1.1.1",
"localLabel":"18",
"remoteLabel":"18",
"inUse":0
},
{
"addressFamily":"ipv4",
"prefix":"3.3.3.3/32",
"neighborId":"3.3.3.3",
"localLabel":"18",
"remoteLabel":"imp-null",
"inUse":1
}
]
}

View File

@ -0,0 +1,25 @@
{
"adjacencies":[
{
"addressFamily":"ipv4",
"neighborId":"1.1.1.1",
"type":"link",
"interface":"r2-eth1",
"helloHoldtime":15
},
{
"addressFamily":"ipv4",
"neighborId":"1.1.1.1",
"type":"targeted",
"peer":"1.1.1.1",
"helloHoldtime":45
},
{
"addressFamily":"ipv4",
"neighborId":"3.3.3.3",
"type":"link",
"interface":"r2-eth2",
"helloHoldtime":15
}
]
}

View File

@ -0,0 +1,16 @@
{
"neighbors":[
{
"addressFamily":"ipv4",
"neighborId":"1.1.1.1",
"state":"OPERATIONAL",
"transportAddress":"1.1.1.1"
},
{
"addressFamily":"ipv4",
"neighborId":"3.3.3.3",
"state":"OPERATIONAL",
"transportAddress":"3.3.3.3"
}
]
}

View File

@ -0,0 +1,30 @@
log file /tmp/r2-zebra.log
!
hostname r2
!
debug zebra rib
debug zebra nht
debug zebra pseudowires
debug zebra packet
!
interface lo
ip address 2.2.2.2/32
!
interface r2-eth0
description to s2
no link-detect
!
interface r2-eth1
description to s4
ip address 10.0.1.2/24
no link-detect
!
interface r2-eth2
description to s6
ip address 10.0.3.2/24
no link-detect
!
ip forwarding
!
line vty
!

View File

@ -0,0 +1,26 @@
hostname r3
log file /tmp/r3-ldpd.log
!
debug mpls ldp zebra
debug mpls ldp event
debug mpls ldp errors
debug mpls ldp messages recv
debug mpls ldp messages sent
debug mpls ldp discovery hello recv
debug mpls ldp discovery hello sent
!
mpls ldp
router-id 3.3.3.3
!
address-family ipv4
discovery transport-address 3.3.3.3
label local allocate host-routes
!
interface r3-eth1
!
interface r3-eth2
!
!
!
line vty
!

View File

@ -0,0 +1,7 @@
hostname r3
log file /tmp/r3-ospfd.log
!
router ospf
router-id 3.3.3.3
network 0.0.0.0/0 area 0
!

View File

@ -0,0 +1,14 @@
{
"1.1.1.1":{
"priority":1,
"state":"Full/Backup",
"address":"10.0.2.1",
"ifaceName":"r3-eth1:10.0.2.3"
},
"2.2.2.2":{
"priority":1,
"state":"Full/Backup",
"address":"10.0.3.2",
"ifaceName":"r3-eth2:10.0.3.3"
}
}

View File

@ -0,0 +1,157 @@
{
"1.1.1.1/32":[
{
"prefix":"1.1.1.1/32",
"protocol":"ospf",
"selected":true,
"distance":110,
"metric":10,
"nexthops":[
{
"fib":true,
"ip":"10.0.2.1",
"afi":"ipv4",
"interfaceIndex":3,
"interfaceName":"r3-eth1",
"active":true
}
]
}
],
"2.2.2.2/32":[
{
"prefix":"2.2.2.2/32",
"protocol":"ospf",
"selected":true,
"distance":110,
"metric":10,
"nexthops":[
{
"fib":true,
"ip":"10.0.3.2",
"afi":"ipv4",
"interfaceIndex":4,
"interfaceName":"r3-eth2",
"active":true
}
]
}
],
"3.3.3.3/32":[
{
"prefix":"3.3.3.3/32",
"protocol":"ospf",
"distance":110,
"metric":0,
"nexthops":[
{
"directlyConnected":true,
"interfaceIndex":1,
"interfaceName":"lo",
"active":true
}
]
},
{
"prefix":"3.3.3.3/32",
"protocol":"connected",
"selected":true,
"nexthops":[
{
"fib":true,
"directlyConnected":true,
"interfaceIndex":1,
"interfaceName":"lo",
"active":true
}
]
}
],
"10.0.1.0/24":[
{
"prefix":"10.0.1.0/24",
"protocol":"ospf",
"selected":true,
"distance":110,
"metric":20,
"nexthops":[
{
"fib":true,
"ip":"10.0.2.1",
"afi":"ipv4",
"interfaceIndex":3,
"interfaceName":"r3-eth1",
"active":true
},
{
"fib":true,
"ip":"10.0.3.2",
"afi":"ipv4",
"interfaceIndex":4,
"interfaceName":"r3-eth2",
"active":true
}
]
}
],
"10.0.2.0/24":[
{
"prefix":"10.0.2.0/24",
"protocol":"ospf",
"distance":110,
"metric":10,
"nexthops":[
{
"directlyConnected":true,
"interfaceIndex":3,
"interfaceName":"r3-eth1",
"active":true
}
]
},
{
"prefix":"10.0.2.0/24",
"protocol":"connected",
"selected":true,
"nexthops":[
{
"fib":true,
"directlyConnected":true,
"interfaceIndex":3,
"interfaceName":"r3-eth1",
"active":true
}
]
}
],
"10.0.3.0/24":[
{
"prefix":"10.0.3.0/24",
"protocol":"ospf",
"distance":110,
"metric":10,
"nexthops":[
{
"directlyConnected":true,
"interfaceIndex":4,
"interfaceName":"r3-eth2",
"active":true
}
]
},
{
"prefix":"10.0.3.0/24",
"protocol":"connected",
"selected":true,
"nexthops":[
{
"fib":true,
"directlyConnected":true,
"interfaceIndex":4,
"interfaceName":"r3-eth2",
"active":true
}
]
}
]
}

View File

@ -0,0 +1,2 @@
{
}

View File

@ -0,0 +1,2 @@
{
}

View File

@ -0,0 +1,52 @@
{
"bindings":[
{
"addressFamily":"ipv4",
"prefix":"1.1.1.1/32",
"neighborId":"1.1.1.1",
"localLabel":"16",
"remoteLabel":"imp-null",
"inUse":1
},
{
"addressFamily":"ipv4",
"prefix":"1.1.1.1/32",
"neighborId":"2.2.2.2",
"localLabel":"16",
"remoteLabel":"17",
"inUse":0
},
{
"addressFamily":"ipv4",
"prefix":"2.2.2.2/32",
"neighborId":"1.1.1.1",
"localLabel":"17",
"remoteLabel":"17",
"inUse":0
},
{
"addressFamily":"ipv4",
"prefix":"2.2.2.2/32",
"neighborId":"2.2.2.2",
"localLabel":"17",
"remoteLabel":"imp-null",
"inUse":1
},
{
"addressFamily":"ipv4",
"prefix":"3.3.3.3/32",
"neighborId":"1.1.1.1",
"localLabel":"imp-null",
"remoteLabel":"18",
"inUse":0
},
{
"addressFamily":"ipv4",
"prefix":"3.3.3.3/32",
"neighborId":"2.2.2.2",
"localLabel":"imp-null",
"remoteLabel":"18",
"inUse":0
}
]
}

View File

@ -0,0 +1,18 @@
{
"adjacencies":[
{
"addressFamily":"ipv4",
"neighborId":"1.1.1.1",
"type":"link",
"interface":"r3-eth1",
"helloHoldtime":15
},
{
"addressFamily":"ipv4",
"neighborId":"2.2.2.2",
"type":"link",
"interface":"r3-eth2",
"helloHoldtime":15
}
]
}

View File

@ -0,0 +1,16 @@
{
"neighbors":[
{
"addressFamily":"ipv4",
"neighborId":"1.1.1.1",
"state":"OPERATIONAL",
"transportAddress":"1.1.1.1"
},
{
"addressFamily":"ipv4",
"neighborId":"2.2.2.2",
"state":"OPERATIONAL",
"transportAddress":"2.2.2.2"
}
]
}

View File

@ -0,0 +1,30 @@
log file /tmp/r3-zebra.log
!
hostname r3
!
debug zebra rib
debug zebra nht
debug zebra pseudowires
debug zebra packet
!
interface lo
ip address 3.3.3.3/32
!
interface r3-eth0
description to s3
no link-detect
!
interface r3-eth1
description to s5
ip address 10.0.2.3/24
no link-detect
!
interface r3-eth2
description to s6
ip address 10.0.3.3/24
no link-detect
!
ip forwarding
!
line vty
!

View File

@ -0,0 +1,111 @@
## Color coding:
#########################
## Main FRR: #f08080 red
## Switches: #d0e0d0 gray
## RIP: #19e3d9 Cyan
## RIPng: #fcb314 dark yellow
## OSPFv2: #32b835 Green
## OSPFv3: #19e3d9 Cyan
## ISIS IPv4 #fcb314 dark yellow
## ISIS IPv6 #9a81ec purple
## BGP IPv4 #eee3d3 beige
## BGP IPv6 #fdff00 yellow
##### Colors (see http://www.color-hex.com/)
graph template {
label="Test Topology - LDP-VPLS 1";
# Routers
ce1 [
shape=doubleoctagon,
label="ce1",
fillcolor="#f08080",
style=filled,
];
ce2 [
shape=doubleoctagon
label="ce2",
fillcolor="#f08080",
style=filled,
];
ce3 [
shape=doubleoctagon
label="ce3",
fillcolor="#f08080",
style=filled,
];
r1 [
shape=doubleoctagon,
label="r1",
fillcolor="#f08080",
style=filled,
];
r2 [
shape=doubleoctagon
label="r2",
fillcolor="#f08080",
style=filled,
];
r3 [
shape=doubleoctagon
label="r3",
fillcolor="#f08080",
style=filled,
];
# Switches
s1 [
shape=oval,
label="VPLS\n172.16.1.0/24",
fillcolor="#d0e0d0",
style=filled,
];
s2 [
shape=oval,
label="VPLS\n172.16.1.0/24",
fillcolor="#d0e0d0",
style=filled,
];
s3 [
shape=oval,
label="VPLS\n172.16.1.0/24",
fillcolor="#d0e0d0",
style=filled,
];
s4 [
shape=oval,
label="s4\n10.0.1.0/24",
fillcolor="#d0e0d0",
style=filled,
];
s5 [
shape=oval,
label="s5\n10.0.2.0/24",
fillcolor="#d0e0d0",
style=filled,
];
s6 [
shape=oval,
label="s6\n10.0.3.0/24",
fillcolor="#d0e0d0",
style=filled,
];
# Connections
ce1 -- s1 [label="eth0\n.1"];
ce2 -- s2 [label="eth0\n.2"];
ce3 -- s3 [label="eth0\n.3"];
r1 -- s1 [label="eth0"];
r1 -- s4 [label="eth1\n.1"];
r1 -- s5 [label="eth2\n.1"];
r2 -- s2 [label="eth0"];
r2 -- s4 [label="eth1\n.2"];
r2 -- s6 [label="eth2\n.2"];
r3 -- s3 [label="eth0"];
r3 -- s5 [label="eth1\n.3"];
r3 -- s6 [label="eth2\n.3"];
}

View File

@ -0,0 +1,699 @@
%!PS-Adobe-3.0
%%Creator: graphviz version 2.38.0 (20140413.2041)
%%Title: template
%%Pages: (atend)
%%BoundingBox: (atend)
%%EndComments
save
%%BeginProlog
/DotDict 200 dict def
DotDict begin
/setupLatin1 {
mark
/EncodingVector 256 array def
EncodingVector 0
ISOLatin1Encoding 0 255 getinterval putinterval
EncodingVector 45 /hyphen put
% Set up ISO Latin 1 character encoding
/starnetISO {
dup dup findfont dup length dict begin
{ 1 index /FID ne { def }{ pop pop } ifelse
} forall
/Encoding EncodingVector def
currentdict end definefont
} def
/Times-Roman starnetISO def
/Times-Italic starnetISO def
/Times-Bold starnetISO def
/Times-BoldItalic starnetISO def
/Helvetica starnetISO def
/Helvetica-Oblique starnetISO def
/Helvetica-Bold starnetISO def
/Helvetica-BoldOblique starnetISO def
/Courier starnetISO def
/Courier-Oblique starnetISO def
/Courier-Bold starnetISO def
/Courier-BoldOblique starnetISO def
cleartomark
} bind def
%%BeginResource: procset graphviz 0 0
/coord-font-family /Times-Roman def
/default-font-family /Times-Roman def
/coordfont coord-font-family findfont 8 scalefont def
/InvScaleFactor 1.0 def
/set_scale {
dup 1 exch div /InvScaleFactor exch def
scale
} bind def
% styles
/solid { [] 0 setdash } bind def
/dashed { [9 InvScaleFactor mul dup ] 0 setdash } bind def
/dotted { [1 InvScaleFactor mul 6 InvScaleFactor mul] 0 setdash } bind def
/invis {/fill {newpath} def /stroke {newpath} def /show {pop newpath} def} bind def
/bold { 2 setlinewidth } bind def
/filled { } bind def
/unfilled { } bind def
/rounded { } bind def
/diagonals { } bind def
/tapered { } bind def
% hooks for setting color
/nodecolor { sethsbcolor } bind def
/edgecolor { sethsbcolor } bind def
/graphcolor { sethsbcolor } bind def
/nopcolor {pop pop pop} bind def
/beginpage { % i j npages
/npages exch def
/j exch def
/i exch def
/str 10 string def
npages 1 gt {
gsave
coordfont setfont
0 0 moveto
(\() show i str cvs show (,) show j str cvs show (\)) show
grestore
} if
} bind def
/set_font {
findfont exch
scalefont setfont
} def
% draw text fitted to its expected width
/alignedtext { % width text
/text exch def
/width exch def
gsave
width 0 gt {
[] 0 setdash
text stringwidth pop width exch sub text length div 0 text ashow
} if
grestore
} def
/boxprim { % xcorner ycorner xsize ysize
4 2 roll
moveto
2 copy
exch 0 rlineto
0 exch rlineto
pop neg 0 rlineto
closepath
} bind def
/ellipse_path {
/ry exch def
/rx exch def
/y exch def
/x exch def
matrix currentmatrix
newpath
x y translate
rx ry scale
0 0 1 0 360 arc
setmatrix
} bind def
/endpage { showpage } bind def
/showpage { } def
/layercolorseq
[ % layer color sequence - darkest to lightest
[0 0 0]
[.2 .8 .8]
[.4 .8 .8]
[.6 .8 .8]
[.8 .8 .8]
]
def
/layerlen layercolorseq length def
/setlayer {/maxlayer exch def /curlayer exch def
layercolorseq curlayer 1 sub layerlen mod get
aload pop sethsbcolor
/nodecolor {nopcolor} def
/edgecolor {nopcolor} def
/graphcolor {nopcolor} def
} bind def
/onlayer { curlayer ne {invis} if } def
/onlayers {
/myupper exch def
/mylower exch def
curlayer mylower lt
curlayer myupper gt
or
{invis} if
} def
/curlayer 0 def
%%EndResource
%%EndProlog
%%BeginSetup
14 default-font-family set_font
1 setmiterlimit
% /arrowlength 10 def
% /arrowwidth 5 def
% make sure pdfmark is harmless for PS-interpreters other than Distiller
/pdfmark where {pop} {userdict /pdfmark /cleartomark load put} ifelse
% make '<<' and '>>' safe on PS Level 1 devices
/languagelevel where {pop languagelevel}{1} ifelse
2 lt {
userdict (<<) cvn ([) cvn load put
userdict (>>) cvn ([) cvn load put
} if
%%EndSetup
setupLatin1
%%Page: 1 1
%%PageBoundingBox: 36 36 860 231
%%PageOrientation: Portrait
0 0 1 beginpage
gsave
36 36 824 195 boxprim clip newpath
1 1 set_scale 0 rotate 40 40 translate
0 0 0 graphcolor
14 /Times-Roman set_font
325.05 7.8 moveto 166 (Test Topology - LDP-VPLS 1) alignedtext
% ce1
gsave
0 0.46667 0.94118 nodecolor
newpath 92.05 157.28 moveto
92.05 172.2 lineto
76.24 182.74 lineto
53.87 182.74 lineto
38.05 172.2 lineto
38.05 157.28 lineto
53.87 146.74 lineto
76.24 146.74 lineto
closepath fill
1 setlinewidth
filled
0 0 0 nodecolor
newpath 92.05 157.28 moveto
92.05 172.2 lineto
76.24 182.74 lineto
53.87 182.74 lineto
38.05 172.2 lineto
38.05 157.28 lineto
53.87 146.74 lineto
76.24 146.74 lineto
closepath stroke
1 setlinewidth
filled
0 0 0 nodecolor
newpath 96.05 155.14 moveto
96.05 174.34 lineto
77.45 186.74 lineto
52.66 186.74 lineto
34.05 174.34 lineto
34.05 155.14 lineto
52.66 142.74 lineto
77.45 142.74 lineto
closepath stroke
0 0 0 nodecolor
14 /Times-Roman set_font
55.55 161.04 moveto 19 (ce1) alignedtext
grestore
% s1
gsave
0.33333 0.071429 0.87843 nodecolor
65.05 49.87 65.11 26.74 ellipse_path fill
1 setlinewidth
filled
0 0 0 nodecolor
65.05 49.87 65.11 26.74 ellipse_path stroke
0 0 0 nodecolor
14 /Times-Roman set_font
48.05 53.67 moveto 34 (VPLS) alignedtext
0 0 0 nodecolor
14 /Times-Roman set_font
27.05 38.67 moveto 76 (172.16.1.0/24) alignedtext
grestore
% ce1--s1
gsave
1 setlinewidth
0 0 0 edgecolor
newpath 65.05 142.51 moveto
65.05 123.86 65.05 96.68 65.05 76.76 curveto
stroke
0 0 0 edgecolor
14 /Times-Roman set_font
65.05 113.54 moveto 24 (eth0) alignedtext
0 0 0 edgecolor
14 /Times-Roman set_font
71.55 98.54 moveto 11 (.1) alignedtext
grestore
% ce2
gsave
0 0.46667 0.94118 nodecolor
newpath 434.05 157.28 moveto
434.05 172.2 lineto
418.24 182.74 lineto
395.87 182.74 lineto
380.05 172.2 lineto
380.05 157.28 lineto
395.87 146.74 lineto
418.24 146.74 lineto
closepath fill
1 setlinewidth
filled
0 0 0 nodecolor
newpath 434.05 157.28 moveto
434.05 172.2 lineto
418.24 182.74 lineto
395.87 182.74 lineto
380.05 172.2 lineto
380.05 157.28 lineto
395.87 146.74 lineto
418.24 146.74 lineto
closepath stroke
1 setlinewidth
filled
0 0 0 nodecolor
newpath 438.05 155.14 moveto
438.05 174.34 lineto
419.45 186.74 lineto
394.66 186.74 lineto
376.05 174.34 lineto
376.05 155.14 lineto
394.66 142.74 lineto
419.45 142.74 lineto
closepath stroke
0 0 0 nodecolor
14 /Times-Roman set_font
397.55 161.04 moveto 19 (ce2) alignedtext
grestore
% s2
gsave
0.33333 0.071429 0.87843 nodecolor
343.05 49.87 65.11 26.74 ellipse_path fill
1 setlinewidth
filled
0 0 0 nodecolor
343.05 49.87 65.11 26.74 ellipse_path stroke
0 0 0 nodecolor
14 /Times-Roman set_font
326.05 53.67 moveto 34 (VPLS) alignedtext
0 0 0 nodecolor
14 /Times-Roman set_font
305.05 38.67 moveto 76 (172.16.1.0/24) alignedtext
grestore
% ce2--s2
gsave
1 setlinewidth
0 0 0 edgecolor
newpath 402.92 142.47 moveto
399.53 128.27 393.85 109.55 385.05 94.74 curveto
380.85 87.67 375.31 80.84 369.64 74.75 curveto
stroke
0 0 0 edgecolor
14 /Times-Roman set_font
398.05 113.54 moveto 24 (eth0) alignedtext
0 0 0 edgecolor
14 /Times-Roman set_font
404.55 98.54 moveto 11 (.2) alignedtext
grestore
% ce3
gsave
0 0.46667 0.94118 nodecolor
newpath 778.05 157.28 moveto
778.05 172.2 lineto
762.24 182.74 lineto
739.87 182.74 lineto
724.05 172.2 lineto
724.05 157.28 lineto
739.87 146.74 lineto
762.24 146.74 lineto
closepath fill
1 setlinewidth
filled
0 0 0 nodecolor
newpath 778.05 157.28 moveto
778.05 172.2 lineto
762.24 182.74 lineto
739.87 182.74 lineto
724.05 172.2 lineto
724.05 157.28 lineto
739.87 146.74 lineto
762.24 146.74 lineto
closepath stroke
1 setlinewidth
filled
0 0 0 nodecolor
newpath 782.05 155.14 moveto
782.05 174.34 lineto
763.45 186.74 lineto
738.66 186.74 lineto
720.05 174.34 lineto
720.05 155.14 lineto
738.66 142.74 lineto
763.45 142.74 lineto
closepath stroke
0 0 0 nodecolor
14 /Times-Roman set_font
741.55 161.04 moveto 19 (ce3) alignedtext
grestore
% s3
gsave
0.33333 0.071429 0.87843 nodecolor
751.05 49.87 65.11 26.74 ellipse_path fill
1 setlinewidth
filled
0 0 0 nodecolor
751.05 49.87 65.11 26.74 ellipse_path stroke
0 0 0 nodecolor
14 /Times-Roman set_font
734.05 53.67 moveto 34 (VPLS) alignedtext
0 0 0 nodecolor
14 /Times-Roman set_font
713.05 38.67 moveto 76 (172.16.1.0/24) alignedtext
grestore
% ce3--s3
gsave
1 setlinewidth
0 0 0 edgecolor
newpath 751.05 142.51 moveto
751.05 123.86 751.05 96.68 751.05 76.76 curveto
stroke
0 0 0 edgecolor
14 /Times-Roman set_font
751.05 113.54 moveto 24 (eth0) alignedtext
0 0 0 edgecolor
14 /Times-Roman set_font
757.55 98.54 moveto 11 (.3) alignedtext
grestore
% r1
gsave
0 0.46667 0.94118 nodecolor
newpath 231.05 157.28 moveto
231.05 172.2 lineto
215.24 182.74 lineto
192.87 182.74 lineto
177.05 172.2 lineto
177.05 157.28 lineto
192.87 146.74 lineto
215.24 146.74 lineto
closepath fill
1 setlinewidth
filled
0 0 0 nodecolor
newpath 231.05 157.28 moveto
231.05 172.2 lineto
215.24 182.74 lineto
192.87 182.74 lineto
177.05 172.2 lineto
177.05 157.28 lineto
192.87 146.74 lineto
215.24 146.74 lineto
closepath stroke
1 setlinewidth
filled
0 0 0 nodecolor
newpath 235.05 155.14 moveto
235.05 174.34 lineto
216.45 186.74 lineto
191.66 186.74 lineto
173.05 174.34 lineto
173.05 155.14 lineto
191.66 142.74 lineto
216.45 142.74 lineto
closepath stroke
0 0 0 nodecolor
14 /Times-Roman set_font
198.05 161.04 moveto 12 (r1) alignedtext
grestore
% r1--s1
gsave
1 setlinewidth
0 0 0 edgecolor
newpath 184.14 147.57 moveto
160.42 128.31 120.61 95.99 93.62 74.06 curveto
stroke
0 0 0 edgecolor
14 /Times-Roman set_font
156.05 106.04 moveto 24 (eth0) alignedtext
grestore
% s4
gsave
0.33333 0.071429 0.87843 nodecolor
204.05 49.87 55.72 26.74 ellipse_path fill
1 setlinewidth
filled
0 0 0 nodecolor
204.05 49.87 55.72 26.74 ellipse_path stroke
0 0 0 nodecolor
14 /Times-Roman set_font
197.55 53.67 moveto 13 (s4) alignedtext
0 0 0 nodecolor
14 /Times-Roman set_font
172.55 38.67 moveto 63 (10.0.1.0/24) alignedtext
grestore
% r1--s4
gsave
1 setlinewidth
0 0 0 edgecolor
newpath 204.05 142.51 moveto
204.05 123.86 204.05 96.68 204.05 76.76 curveto
stroke
0 0 0 edgecolor
14 /Times-Roman set_font
204.05 113.54 moveto 24 (eth1) alignedtext
0 0 0 edgecolor
14 /Times-Roman set_font
210.55 98.54 moveto 11 (.1) alignedtext
grestore
% s5
gsave
0.33333 0.071429 0.87843 nodecolor
482.05 49.87 55.72 26.74 ellipse_path fill
1 setlinewidth
filled
0 0 0 nodecolor
482.05 49.87 55.72 26.74 ellipse_path stroke
0 0 0 nodecolor
14 /Times-Roman set_font
475.55 53.67 moveto 13 (s5) alignedtext
0 0 0 nodecolor
14 /Times-Roman set_font
450.55 38.67 moveto 63 (10.0.2.0/24) alignedtext
grestore
% r1--s5
gsave
1 setlinewidth
0 0 0 edgecolor
newpath 234.23 154.37 moveto
246.29 150.68 260.31 146.44 273.05 142.74 curveto
301.84 134.38 313.98 142.6 338.05 124.74 curveto
350.73 115.34 344.48 104.28 357.05 94.74 curveto
379.24 77.92 390.76 85.9 417.05 76.74 curveto
424.74 74.06 432.85 71.02 440.65 67.98 curveto
stroke
0 0 0 edgecolor
14 /Times-Roman set_font
357.05 113.54 moveto 24 (eth2) alignedtext
0 0 0 edgecolor
14 /Times-Roman set_font
363.55 98.54 moveto 11 (.1) alignedtext
grestore
% r2
gsave
0 0.46667 0.94118 nodecolor
newpath 340.05 157.28 moveto
340.05 172.2 lineto
324.24 182.74 lineto
301.87 182.74 lineto
286.05 172.2 lineto
286.05 157.28 lineto
301.87 146.74 lineto
324.24 146.74 lineto
closepath fill
1 setlinewidth
filled
0 0 0 nodecolor
newpath 340.05 157.28 moveto
340.05 172.2 lineto
324.24 182.74 lineto
301.87 182.74 lineto
286.05 172.2 lineto
286.05 157.28 lineto
301.87 146.74 lineto
324.24 146.74 lineto
closepath stroke
1 setlinewidth
filled
0 0 0 nodecolor
newpath 344.05 155.14 moveto
344.05 174.34 lineto
325.45 186.74 lineto
300.66 186.74 lineto
282.05 174.34 lineto
282.05 155.14 lineto
300.66 142.74 lineto
325.45 142.74 lineto
closepath stroke
0 0 0 nodecolor
14 /Times-Roman set_font
307.05 161.04 moveto 12 (r2) alignedtext
grestore
% r2--s2
gsave
1 setlinewidth
0 0 0 edgecolor
newpath 310.34 142.73 moveto
309.27 128.81 309.25 110.31 314.05 94.74 curveto
316.1 88.11 319.49 81.55 323.24 75.6 curveto
stroke
0 0 0 edgecolor
14 /Times-Roman set_font
314.05 106.04 moveto 24 (eth0) alignedtext
grestore
% r2--s4
gsave
1 setlinewidth
0 0 0 edgecolor
newpath 295.78 145.86 moveto
277.17 126.59 247.47 95.83 226.93 74.56 curveto
stroke
0 0 0 edgecolor
14 /Times-Roman set_font
275.05 113.54 moveto 24 (eth1) alignedtext
0 0 0 edgecolor
14 /Times-Roman set_font
281.55 98.54 moveto 11 (.2) alignedtext
grestore
% s6
gsave
0.33333 0.071429 0.87843 nodecolor
612.05 49.87 55.72 26.74 ellipse_path fill
1 setlinewidth
filled
0 0 0 nodecolor
612.05 49.87 55.72 26.74 ellipse_path stroke
0 0 0 nodecolor
14 /Times-Roman set_font
605.55 53.67 moveto 13 (s6) alignedtext
0 0 0 nodecolor
14 /Times-Roman set_font
580.55 38.67 moveto 63 (10.0.3.0/24) alignedtext
grestore
% r2--s6
gsave
1 setlinewidth
0 0 0 edgecolor
newpath 340.38 152.66 moveto
348.88 149.33 358.31 145.77 367.05 142.74 curveto
392.96 133.77 400.18 133.8 426.05 124.74 curveto
480.66 105.62 493.29 98.1 547.05 76.74 curveto
554.39 73.82 562.19 70.72 569.75 67.72 curveto
stroke
0 0 0 edgecolor
14 /Times-Roman set_font
504.05 113.54 moveto 24 (eth2) alignedtext
0 0 0 edgecolor
14 /Times-Roman set_font
510.55 98.54 moveto 11 (.2) alignedtext
grestore
% r3
gsave
0 0.46667 0.94118 nodecolor
newpath 639.05 157.28 moveto
639.05 172.2 lineto
623.24 182.74 lineto
600.87 182.74 lineto
585.05 172.2 lineto
585.05 157.28 lineto
600.87 146.74 lineto
623.24 146.74 lineto
closepath fill
1 setlinewidth
filled
0 0 0 nodecolor
newpath 639.05 157.28 moveto
639.05 172.2 lineto
623.24 182.74 lineto
600.87 182.74 lineto
585.05 172.2 lineto
585.05 157.28 lineto
600.87 146.74 lineto
623.24 146.74 lineto
closepath stroke
1 setlinewidth
filled
0 0 0 nodecolor
newpath 643.05 155.14 moveto
643.05 174.34 lineto
624.45 186.74 lineto
599.66 186.74 lineto
581.05 174.34 lineto
581.05 155.14 lineto
599.66 142.74 lineto
624.45 142.74 lineto
closepath stroke
0 0 0 nodecolor
14 /Times-Roman set_font
606.05 161.04 moveto 12 (r3) alignedtext
grestore
% r3--s3
gsave
1 setlinewidth
0 0 0 edgecolor
newpath 631.97 147.57 moveto
655.69 128.31 695.49 95.99 722.49 74.06 curveto
stroke
0 0 0 edgecolor
14 /Times-Roman set_font
693.05 106.04 moveto 24 (eth0) alignedtext
grestore
% r3--s5
gsave
1 setlinewidth
0 0 0 edgecolor
newpath 592.87 147.09 moveto
570.55 127.71 533.57 95.6 508.53 73.86 curveto
stroke
0 0 0 edgecolor
14 /Times-Roman set_font
567.05 113.54 moveto 24 (eth1) alignedtext
0 0 0 edgecolor
14 /Times-Roman set_font
573.55 98.54 moveto 11 (.3) alignedtext
grestore
% r3--s6
gsave
1 setlinewidth
0 0 0 edgecolor
newpath 612.05 142.51 moveto
612.05 123.86 612.05 96.68 612.05 76.76 curveto
stroke
0 0 0 edgecolor
14 /Times-Roman set_font
612.05 113.54 moveto 24 (eth2) alignedtext
0 0 0 edgecolor
14 /Times-Roman set_font
618.55 98.54 moveto 11 (.3) alignedtext
grestore
endpage
showpage
grestore
%%PageTrailer
%%EndPage: 1
%%Trailer
%%Pages: 1
%%BoundingBox: 36 36 860 231
end
restore
%%EOF

View File

@ -0,0 +1,270 @@
#!/usr/bin/env python
#
# test_ldp_vpls_topo1.py
# Part of NetDEF Topology Tests
#
# Copyright (c) 2017 by
# Network Device Education Foundation, Inc. ("NetDEF")
#
# Permission to use, copy, modify, and/or distribute this software
# for any purpose with or without fee is hereby granted, provided
# that the above copyright notice and this permission notice appear
# in all copies.
#
# THE SOFTWARE IS PROVIDED "AS IS" AND NETDEF DISCLAIMS ALL WARRANTIES
# WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
# MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL NETDEF BE LIABLE FOR
# ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY
# DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
# WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS
# ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE
# OF THIS SOFTWARE.
#
"""
test_ldp_vpls_topo1.py:
+---------+ +---------+
| | | |
| CE1 | | CE2 |
| | | |
+---------+ +---------+
ce1-eth0 (172.16.1.1/24)| |ce2-eth0 (172.16.1.2/24)
| |
| |
rt1-eth0| |rt2-eth0
+---------+ 10.0.1.0/24 +---------+
| |rt1-eth1 | |
| RT1 +----------------+ RT2 |
| 1.1.1.1 | rt2-eth1| 2.2.2.2 |
| | | |
+---------+ +---------+
rt1-eth2| |rt2-eth2
| |
| |
10.0.2.0/24| +---------+ |10.0.3.0/24
| | | |
| | RT3 | |
+--------+ 3.3.3.3 +-------+
rt3-eth2| |rt3-eth1
+---------+
|rt3-eth0
|
|
ce3-eth0 (172.16.1.3/24)|
+---------+
| |
| CE3 |
| |
+---------+
"""
import os
import sys
import pytest
import json
from time import sleep
from functools import partial
# Save the Current Working Directory to find configuration files.
CWD = os.path.dirname(os.path.realpath(__file__))
sys.path.append(os.path.join(CWD, '../'))
# pylint: disable=C0413
# Import topogen and topotest helpers
from lib import topotest
from lib.topogen import Topogen, TopoRouter, get_topogen
from lib.topolog import logger
# Required to instantiate the topology builder class.
from mininet.topo import Topo
fatal_error = ""
class TemplateTopo(Topo):
"Test topology builder"
def build(self, *_args, **_opts):
"Build function"
tgen = get_topogen(self)
#
# Define FRR Routers
#
for router in ['ce1', 'ce2', 'ce3', 'r1', 'r2', 'r3']:
tgen.add_router(router)
#
# Define connections
#
switch = tgen.add_switch('s1')
switch.add_link(tgen.gears['ce1'])
switch.add_link(tgen.gears['r1'])
switch = tgen.add_switch('s2')
switch.add_link(tgen.gears['ce2'])
switch.add_link(tgen.gears['r2'])
switch = tgen.add_switch('s3')
switch.add_link(tgen.gears['ce3'])
switch.add_link(tgen.gears['r3'])
switch = tgen.add_switch('s4')
switch.add_link(tgen.gears['r1'])
switch.add_link(tgen.gears['r2'])
switch = tgen.add_switch('s5')
switch.add_link(tgen.gears['r1'])
switch.add_link(tgen.gears['r3'])
switch = tgen.add_switch('s6')
switch.add_link(tgen.gears['r2'])
switch.add_link(tgen.gears['r3'])
def setup_module(mod):
"Sets up the pytest environment"
tgen = Topogen(TemplateTopo, mod.__name__)
tgen.start_topology()
router_list = tgen.routers()
# For all registered routers, load the zebra configuration file
for rname, router in router_list.iteritems():
router.load_config(
TopoRouter.RD_ZEBRA,
os.path.join(CWD, '{}/zebra.conf'.format(rname))
)
# Don't start ospfd and ldpd in the CE nodes
if router.name[0] == 'r':
router.load_config(
TopoRouter.RD_OSPF,
os.path.join(CWD, '{}/ospfd.conf'.format(rname))
)
router.load_config(
TopoRouter.RD_LDP,
os.path.join(CWD, '{}/ldpd.conf'.format(rname))
)
tgen.start_router()
def teardown_module(mod):
"Teardown the pytest environment"
tgen = get_topogen()
# This function tears down the whole topology.
tgen.stop_topology()
def router_compare_json_output_cb(rname, command, reference):
tgen = get_topogen()
router = tgen.gears[rname]
output = router.vtysh_cmd(command, isjson=True)
refTableFile = '{}/{}/{}'.format(CWD, router.name, reference)
expected = json.loads(open(refTableFile).read())
return topotest.json_cmp(output, expected)
def router_compare_json_output(rname, command, reference):
logger.info('Comparing router "%s" "%s" output', rname, command)
tgen = get_topogen()
# Run test function until we get an result. Wait at most 60 seconds.
test_func = partial(router_compare_json_output_cb, rname, command, reference)
result, diff = topotest.run_and_expect(test_func, None, count=20, wait=3)
assert result, '"{}" JSON output mismatches the expected result'.format(rname)
def test_router_running():
global fatal_error
logger.info("Test: check if FRR is running on each Router node")
tgen = get_topogen()
sleep(5)
# Make sure that all daemons are running
for router in ['ce1', 'ce2', 'ce3', 'r1', 'r2', 'r3']:
fatal_error = tgen.net[router].checkRouterRunning()
assert fatal_error == "", fatal_error
@pytest.mark.skipif(fatal_error != "", reason="fatal error")
def test_ospf_convergence():
logger.info("Test: check OSPF adjacencies")
tgen = get_topogen()
for rname in ['r1', 'r2', 'r3']:
router_compare_json_output(rname, "show ip ospf neighbor json", "show_ip_ospf_neighbor.ref")
@pytest.mark.skipif(fatal_error != "", reason="fatal error")
def test_rib():
logger.info("Test: verify RIB")
tgen = get_topogen()
for rname in ['r1', 'r2', 'r3']:
router_compare_json_output(rname, "show ip route json", "show_ip_route.ref")
@pytest.mark.skipif(fatal_error != "", reason="fatal error")
def test_ldp_adjacencies():
logger.info("Test: verify LDP adjacencies")
tgen = get_topogen()
for rname in ['r1', 'r2', 'r3']:
router_compare_json_output(rname, "show mpls ldp discovery json", "show_ldp_discovery.ref")
@pytest.mark.skipif(fatal_error != "", reason="fatal error")
def test_ldp_neighbors():
logger.info("Test: verify LDP neighbors")
tgen = get_topogen()
for rname in ['r1', 'r2', 'r3']:
router_compare_json_output(rname, "show mpls ldp neighbor json", "show_ldp_neighbor.ref")
@pytest.mark.skipif(fatal_error != "", reason="fatal error")
def test_ldp_bindings():
logger.info("Test: verify LDP bindings")
tgen = get_topogen()
for rname in ['r1', 'r2', 'r3']:
router_compare_json_output(rname, "show mpls ldp binding json", "show_ldp_binding.ref")
@pytest.mark.skipif(fatal_error != "", reason="fatal error")
def test_ldp_pwid_bindings():
logger.info("Test: verify LDP PW-ID bindings")
tgen = get_topogen()
for rname in ['r1', 'r2', 'r3']:
router_compare_json_output(rname, "show l2vpn atom binding json", "show_l2vpn_binding.ref")
@pytest.mark.skipif(fatal_error != "", reason="fatal error")
def test_ldp_pseudowires():
logger.info("Test: verify LDP pseudowires")
tgen = get_topogen()
for rname in ['r1', 'r2', 'r3']:
router_compare_json_output(rname, "show l2vpn atom vc json", "show_l2vpn_vc.ref")
@pytest.mark.skipif(fatal_error != "", reason="fatal error")
def test_ldp_pseudowires_after_link_down():
logger.info("Test: verify LDP pseudowires after r1-r2 link goes down")
tgen = get_topogen()
# Shut down r1-r2 link */
tgen = get_topogen()
tgen.gears['r1'].peer_link_enable('r1-eth1', False)
# Wait 15 seconds for the r1-r2 LDP link adjacencies to time out
sleep(15)
# check if the pseudowire is still up (using an alternate path for nexthop resolution)
for rname in ['r1', 'r2', 'r3']:
router_compare_json_output(rname, "show l2vpn atom vc json", "show_l2vpn_vc.ref")
# Memory leak test template
def test_memory_leak():
"Run the memory leak test and report results."
tgen = get_topogen()
if not tgen.is_memleak_enabled():
pytest.skip('Memory leak test/report is disabled')
tgen.report_memory_leaks()
if __name__ == '__main__':
args = ["-s"] + sys.argv[1:]
sys.exit(pytest.main(args))