summaryrefslogtreecommitdiffstats
path: root/tests/topotests/zebra_fec_nexthop_resolution
diff options
context:
space:
mode:
Diffstat (limited to 'tests/topotests/zebra_fec_nexthop_resolution')
-rw-r--r--tests/topotests/zebra_fec_nexthop_resolution/__init__.py0
-rw-r--r--tests/topotests/zebra_fec_nexthop_resolution/r1/bgpd.conf24
-rw-r--r--tests/topotests/zebra_fec_nexthop_resolution/r1/ospfd.conf.after25
-rw-r--r--tests/topotests/zebra_fec_nexthop_resolution/r1/zebra.conf13
-rw-r--r--tests/topotests/zebra_fec_nexthop_resolution/r2/bgpd.conf23
-rw-r--r--tests/topotests/zebra_fec_nexthop_resolution/r2/isisd.conf25
-rw-r--r--tests/topotests/zebra_fec_nexthop_resolution/r2/ospfd.conf.after32
-rw-r--r--tests/topotests/zebra_fec_nexthop_resolution/r2/zebra.conf16
-rw-r--r--tests/topotests/zebra_fec_nexthop_resolution/r3/bgpd.conf23
-rw-r--r--tests/topotests/zebra_fec_nexthop_resolution/r3/isisd.conf25
-rw-r--r--tests/topotests/zebra_fec_nexthop_resolution/r3/ospfd.conf.after26
-rw-r--r--tests/topotests/zebra_fec_nexthop_resolution/r3/zebra.conf19
-rw-r--r--tests/topotests/zebra_fec_nexthop_resolution/r4/bgpd.conf24
-rw-r--r--tests/topotests/zebra_fec_nexthop_resolution/r4/isisd.conf31
-rw-r--r--tests/topotests/zebra_fec_nexthop_resolution/r4/ospfd.conf19
-rw-r--r--tests/topotests/zebra_fec_nexthop_resolution/r4/zebra.conf16
-rw-r--r--tests/topotests/zebra_fec_nexthop_resolution/r5/bgpd.conf23
-rw-r--r--tests/topotests/zebra_fec_nexthop_resolution/r5/isisd.conf26
-rw-r--r--tests/topotests/zebra_fec_nexthop_resolution/r5/ospfd.conf.after26
-rw-r--r--tests/topotests/zebra_fec_nexthop_resolution/r5/zebra.conf19
-rw-r--r--tests/topotests/zebra_fec_nexthop_resolution/r6/ospfd.conf.after32
-rw-r--r--tests/topotests/zebra_fec_nexthop_resolution/r6/zebra.conf22
-rw-r--r--tests/topotests/zebra_fec_nexthop_resolution/r7/bgpd.conf24
-rw-r--r--tests/topotests/zebra_fec_nexthop_resolution/r7/ospfd.conf.after26
-rw-r--r--tests/topotests/zebra_fec_nexthop_resolution/r7/zebra.conf14
-rw-r--r--tests/topotests/zebra_fec_nexthop_resolution/test_zebra_fec_nexthop_resolution.py259
26 files changed, 812 insertions, 0 deletions
diff --git a/tests/topotests/zebra_fec_nexthop_resolution/__init__.py b/tests/topotests/zebra_fec_nexthop_resolution/__init__.py
new file mode 100644
index 00000000..e69de29b
--- /dev/null
+++ b/tests/topotests/zebra_fec_nexthop_resolution/__init__.py
diff --git a/tests/topotests/zebra_fec_nexthop_resolution/r1/bgpd.conf b/tests/topotests/zebra_fec_nexthop_resolution/r1/bgpd.conf
new file mode 100644
index 00000000..9d28957d
--- /dev/null
+++ b/tests/topotests/zebra_fec_nexthop_resolution/r1/bgpd.conf
@@ -0,0 +1,24 @@
+!
+router bgp 65500
+ bgp router-id 192.0.2.1
+ neighbor 192.0.2.3 remote-as 65500
+ neighbor 192.0.2.3 update-source lo
+ neighbor 192.0.2.7 remote-as 65500
+ neighbor 192.0.2.7 ttl-security hops 10
+ neighbor 192.0.2.7 disable-connected-check
+ neighbor 192.0.2.7 update-source lo
+ !
+ address-family ipv4 unicast
+ network 192.0.2.1/32
+ no neighbor 192.0.2.3 activate
+ neighbor 192.0.2.7 activate
+ exit-address-family
+ !
+ address-family ipv4 labeled-unicast
+ neighbor 192.0.2.3 activate
+ neighbor 192.0.2.3 route-reflector-client
+ neighbor 192.0.2.3 next-hop-self force
+ exit-address-family
+ !
+exit
+!
diff --git a/tests/topotests/zebra_fec_nexthop_resolution/r1/ospfd.conf.after b/tests/topotests/zebra_fec_nexthop_resolution/r1/ospfd.conf.after
new file mode 100644
index 00000000..3bb8cf8a
--- /dev/null
+++ b/tests/topotests/zebra_fec_nexthop_resolution/r1/ospfd.conf.after
@@ -0,0 +1,25 @@
+log stdout
+!
+interface lo
+ ip ospf passive
+exit
+!
+interface r1-eth0
+ ip ospf network point-to-point
+ ip ospf hello-interval 1
+exit
+!
+router ospf
+ ospf router-id 192.0.2.1
+ network 192.0.2.1/32 area 0.0.0.0
+ network 192.168.1.0/24 area 0.0.0.0
+ passive-interface lo
+ capability opaque
+ mpls-te on
+ mpls-te router-address 192.0.2.1
+ segment-routing on
+ segment-routing global-block 1000 10000 local-block 32000 32999
+ segment-routing node-msd 8
+ segment-routing prefix 192.0.2.1/32 index 11
+exit
+!
diff --git a/tests/topotests/zebra_fec_nexthop_resolution/r1/zebra.conf b/tests/topotests/zebra_fec_nexthop_resolution/r1/zebra.conf
new file mode 100644
index 00000000..1522e903
--- /dev/null
+++ b/tests/topotests/zebra_fec_nexthop_resolution/r1/zebra.conf
@@ -0,0 +1,13 @@
+interface lo
+ ip address 192.0.2.1/32
+ mpls enable
+exit
+!
+interface r1-eth0
+ ip address 192.168.1.1/24
+ mpls enable
+ link-params
+ enable
+ exit-link-params
+exit
+!
diff --git a/tests/topotests/zebra_fec_nexthop_resolution/r2/bgpd.conf b/tests/topotests/zebra_fec_nexthop_resolution/r2/bgpd.conf
new file mode 100644
index 00000000..46d2c9a0
--- /dev/null
+++ b/tests/topotests/zebra_fec_nexthop_resolution/r2/bgpd.conf
@@ -0,0 +1,23 @@
+router bgp 65500
+ bgp router-id 192.0.2.2
+ neighbor 192.0.2.1 remote-as 65500
+ neighbor 192.0.2.1 update-source lo
+ neighbor 192.0.2.3 remote-as 65500
+ neighbor 192.0.2.3 update-source lo
+ !
+ address-family ipv4 unicast
+ network 192.0.2.2/32
+ no neighbor 192.0.2.1 activate
+ no neighbor 192.0.2.3 activate
+ exit-address-family
+ !
+ address-family ipv4 labeled-unicast
+ neighbor 192.0.2.1 activate
+ neighbor 192.0.2.1 route-reflector-client
+ neighbor 192.0.2.1 next-hop-self force
+ neighbor 192.0.2.3 activate
+ neighbor 192.0.2.3 route-reflector-client
+ neighbor 192.0.2.3 next-hop-self force
+ exit-address-family
+exit
+!
diff --git a/tests/topotests/zebra_fec_nexthop_resolution/r2/isisd.conf b/tests/topotests/zebra_fec_nexthop_resolution/r2/isisd.conf
new file mode 100644
index 00000000..add181dd
--- /dev/null
+++ b/tests/topotests/zebra_fec_nexthop_resolution/r2/isisd.conf
@@ -0,0 +1,25 @@
+!
+interface lo
+ ip router isis 1
+ isis hello-interval 1
+ isis hello-multiplier 3
+exit
+!
+interface r2-eth1
+ ip router isis 2
+ isis hello-interval 1
+ isis hello-multiplier 3
+exit
+!
+router isis 1
+ is-type level-1
+ net 49.0000.0007.e901.2223.00
+ lsp-timers gen-interval 1 refresh-interval 900 max-lifetime 1200
+ mpls-te on
+ mpls-te router-address 192.0.2.2
+ segment-routing on
+ segment-routing global-block 11000 20000 local-block 36000 36999
+ segment-routing node-msd 8
+ segment-routing prefix 192.0.2.2/32 index 22 no-php-flag
+exit
+!
diff --git a/tests/topotests/zebra_fec_nexthop_resolution/r2/ospfd.conf.after b/tests/topotests/zebra_fec_nexthop_resolution/r2/ospfd.conf.after
new file mode 100644
index 00000000..8b026698
--- /dev/null
+++ b/tests/topotests/zebra_fec_nexthop_resolution/r2/ospfd.conf.after
@@ -0,0 +1,32 @@
+log stdout
+!
+interface lo
+ ip ospf network point-to-point
+ ip ospf passive
+exit
+!
+interface r2-eth0
+ ip ospf network point-to-point
+ ip ospf hello-interval 1
+exit
+!
+interface r2-eth1
+ ip ospf network point-to-point
+ ip ospf hello-interval 1
+exit
+!
+router ospf
+ ospf router-id 192.0.2.2
+ network 192.0.2.2/32 area 0.0.0.0
+ network 192.168.1.0/24 area 0.0.0.0
+ network 192.168.2.0/24 area 0.0.0.0
+ passive-interface lo
+ capability opaque
+ mpls-te on
+ mpls-te router-address 192.0.2.2
+ segment-routing on
+ segment-routing global-block 1000 10000 local-block 36000 36999
+ segment-routing node-msd 8
+ segment-routing prefix 192.0.2.2/32 index 22
+exit
+!
diff --git a/tests/topotests/zebra_fec_nexthop_resolution/r2/zebra.conf b/tests/topotests/zebra_fec_nexthop_resolution/r2/zebra.conf
new file mode 100644
index 00000000..af0d1eb7
--- /dev/null
+++ b/tests/topotests/zebra_fec_nexthop_resolution/r2/zebra.conf
@@ -0,0 +1,16 @@
+!
+interface lo
+ ip address 192.0.2.2/32
+ mpls enable
+exit
+!
+interface r2-eth0
+ ip address 192.168.1.2/24
+ mpls enable
+exit
+!
+interface r2-eth1
+ ip address 192.168.2.2/24
+ mpls enable
+exit
+!
diff --git a/tests/topotests/zebra_fec_nexthop_resolution/r3/bgpd.conf b/tests/topotests/zebra_fec_nexthop_resolution/r3/bgpd.conf
new file mode 100644
index 00000000..060777e7
--- /dev/null
+++ b/tests/topotests/zebra_fec_nexthop_resolution/r3/bgpd.conf
@@ -0,0 +1,23 @@
+router bgp 65500
+ bgp router-id 192.0.2.3
+ neighbor 192.0.2.1 remote-as 65500
+ neighbor 192.0.2.1 update-source lo
+ neighbor 192.0.2.5 remote-as 65500
+ neighbor 192.0.2.5 update-source lo
+ !
+ address-family ipv4 unicast
+ network 192.0.2.3/32
+ no neighbor 192.0.2.1 activate
+ no neighbor 192.0.2.5 activate
+ exit-address-family
+ !
+ address-family ipv4 labeled-unicast
+ neighbor 192.0.2.1 activate
+ neighbor 192.0.2.1 route-reflector-client
+ neighbor 192.0.2.1 next-hop-self force
+ neighbor 192.0.2.5 activate
+ neighbor 192.0.2.5 route-reflector-client
+ neighbor 192.0.2.5 next-hop-self force
+ exit-address-family
+exit
+!
diff --git a/tests/topotests/zebra_fec_nexthop_resolution/r3/isisd.conf b/tests/topotests/zebra_fec_nexthop_resolution/r3/isisd.conf
new file mode 100644
index 00000000..db6a503b
--- /dev/null
+++ b/tests/topotests/zebra_fec_nexthop_resolution/r3/isisd.conf
@@ -0,0 +1,25 @@
+!
+interface lo
+ ip router isis 1
+ isis hello-interval 1
+ isis hello-multiplier 3
+exit
+!
+interface r3-eth1
+ ip router isis 1
+ isis hello-interval 1
+ isis hello-multiplier 3
+exit
+!
+router isis 1
+ is-type level-1
+ net 49.0000.0007.e901.3333.00
+ lsp-timers gen-interval 1 refresh-interval 900 max-lifetime 1200
+ mpls-te on
+ mpls-te router-address 192.0.2.3
+ segment-routing on
+ segment-routing global-block 11000 12000 local-block 36000 36999
+ segment-routing node-msd 8
+ segment-routing prefix 192.0.2.3/32 index 33
+exit
+!
diff --git a/tests/topotests/zebra_fec_nexthop_resolution/r3/ospfd.conf.after b/tests/topotests/zebra_fec_nexthop_resolution/r3/ospfd.conf.after
new file mode 100644
index 00000000..a3f5ae54
--- /dev/null
+++ b/tests/topotests/zebra_fec_nexthop_resolution/r3/ospfd.conf.after
@@ -0,0 +1,26 @@
+log stdout
+!
+interface lo
+ ip ospf network point-to-point
+ ip ospf passive
+exit
+!
+interface r3-eth0
+ ip ospf network point-to-point
+ ip ospf hello-interval 1
+exit
+!
+router ospf
+ ospf router-id 192.0.2.3
+ network 192.0.2.3/32 area 0.0.0.0
+ network 192.168.2.0/24 area 0.0.0.0
+ passive-interface lo
+ capability opaque
+ mpls-te on
+ mpls-te router-address 192.0.2.3
+ segment-routing on
+ segment-routing global-block 1000 10000 local-block 30000 30999
+ segment-routing node-msd 8
+ segment-routing prefix 192.0.2.3/32 index 33
+exit
+!
diff --git a/tests/topotests/zebra_fec_nexthop_resolution/r3/zebra.conf b/tests/topotests/zebra_fec_nexthop_resolution/r3/zebra.conf
new file mode 100644
index 00000000..b309e15a
--- /dev/null
+++ b/tests/topotests/zebra_fec_nexthop_resolution/r3/zebra.conf
@@ -0,0 +1,19 @@
+!
+interface lo
+ ip address 192.0.2.3/32
+ mpls enable
+exit
+!
+interface r3-eth0
+ ip address 192.168.2.3/24
+ mpls enable
+ link-params
+ enable
+ exit-link-params
+exit
+!
+interface r3-eth1
+ ip address 192.168.3.3/24
+ mpls enable
+exit
+!
diff --git a/tests/topotests/zebra_fec_nexthop_resolution/r4/bgpd.conf b/tests/topotests/zebra_fec_nexthop_resolution/r4/bgpd.conf
new file mode 100644
index 00000000..dc052da8
--- /dev/null
+++ b/tests/topotests/zebra_fec_nexthop_resolution/r4/bgpd.conf
@@ -0,0 +1,24 @@
+!
+router bgp 65500
+ bgp router-id 192.0.2.4
+ neighbor 192.0.2.1 remote-as 65500
+ neighbor 192.0.2.1 ttl-security hops 10
+ neighbor 192.0.2.1 disable-connected-check
+ neighbor 192.0.2.1 update-source lo
+ neighbor 192.0.2.3 remote-as 65500
+ neighbor 192.0.2.3 update-source lo
+ !
+ address-family ipv4 unicast
+ network 192.0.2.4/32
+ neighbor 192.0.2.1 activate
+ no neighbor 192.0.2.3 activate
+ exit-address-family
+ !
+ address-family ipv4 labeled-unicast
+ neighbor 192.0.2.3 activate
+ neighbor 192.0.2.3 route-reflector-client
+ neighbor 192.0.2.3 next-hop-self force
+ exit-address-family
+ !
+exit
+!
diff --git a/tests/topotests/zebra_fec_nexthop_resolution/r4/isisd.conf b/tests/topotests/zebra_fec_nexthop_resolution/r4/isisd.conf
new file mode 100644
index 00000000..7096ce08
--- /dev/null
+++ b/tests/topotests/zebra_fec_nexthop_resolution/r4/isisd.conf
@@ -0,0 +1,31 @@
+!
+interface lo
+ ip router isis 1
+ isis hello-interval 1
+ isis hello-multiplier 3
+exit
+!
+interface r4-eth0
+ ip router isis 1
+ isis hello-interval 1
+ isis hello-multiplier 3
+exit
+!
+interface r4-eth1
+ ip router isis 1
+ isis hello-interval 1
+ isis hello-multiplier 3
+exit
+!
+router isis 1
+ is-type level-1
+ net 49.0000.0007.e901.4444.00
+ lsp-timers gen-interval 1 refresh-interval 900 max-lifetime 1200
+ mpls-te on
+ mpls-te router-address 192.0.2.4
+ segment-routing on
+ segment-routing global-block 11000 12000 local-block 37000 37999
+ segment-routing node-msd 8
+ segment-routing prefix 192.0.2.4/32 index 44
+exit
+!
diff --git a/tests/topotests/zebra_fec_nexthop_resolution/r4/ospfd.conf b/tests/topotests/zebra_fec_nexthop_resolution/r4/ospfd.conf
new file mode 100644
index 00000000..c1600496
--- /dev/null
+++ b/tests/topotests/zebra_fec_nexthop_resolution/r4/ospfd.conf
@@ -0,0 +1,19 @@
+!
+interface lo
+ ip ospf area 0
+ ip ospf passive
+exit
+!
+interface r4-eth0
+ ip ospf area 0
+exit
+!
+router ospf
+ mpls-te on
+ mpls-te router-address 192.0.2.4
+ segment-routing on
+ segment-routing global-block 21000 29000 local-block 31000 31999
+ segment-routing node-msd 8
+ segment-routing prefix 192.0.2.4/32 index 44 no-php-flag
+exit
+!
diff --git a/tests/topotests/zebra_fec_nexthop_resolution/r4/zebra.conf b/tests/topotests/zebra_fec_nexthop_resolution/r4/zebra.conf
new file mode 100644
index 00000000..85910479
--- /dev/null
+++ b/tests/topotests/zebra_fec_nexthop_resolution/r4/zebra.conf
@@ -0,0 +1,16 @@
+!
+interface lo
+ ip address 192.0.2.4/32
+ mpls enable
+exit
+!
+interface r4-eth0
+ ip address 192.168.3.4/24
+ mpls enable
+exit
+!
+interface r4-eth1
+ ip address 192.168.4.4/24
+ mpls enable
+exit
+!
diff --git a/tests/topotests/zebra_fec_nexthop_resolution/r5/bgpd.conf b/tests/topotests/zebra_fec_nexthop_resolution/r5/bgpd.conf
new file mode 100644
index 00000000..1c73154e
--- /dev/null
+++ b/tests/topotests/zebra_fec_nexthop_resolution/r5/bgpd.conf
@@ -0,0 +1,23 @@
+router bgp 65500
+ bgp router-id 192.0.2.5
+ neighbor 192.0.2.3 remote-as 65500
+ neighbor 192.0.2.3 update-source lo
+ neighbor 192.0.2.7 remote-as 65500
+ neighbor 192.0.2.7 update-source lo
+ !
+ address-family ipv4 unicast
+ network 192.0.2.5/32
+ no neighbor 192.0.2.3 activate
+ no neighbor 192.0.2.7 activate
+ exit-address-family
+ !
+ address-family ipv4 labeled-unicast
+ neighbor 192.0.2.3 activate
+ neighbor 192.0.2.3 route-reflector-client
+ neighbor 192.0.2.3 next-hop-self force
+ neighbor 192.0.2.7 activate
+ neighbor 192.0.2.7 route-reflector-client
+ neighbor 192.0.2.7 next-hop-self force
+ exit-address-family
+exit
+!
diff --git a/tests/topotests/zebra_fec_nexthop_resolution/r5/isisd.conf b/tests/topotests/zebra_fec_nexthop_resolution/r5/isisd.conf
new file mode 100644
index 00000000..959d5be2
--- /dev/null
+++ b/tests/topotests/zebra_fec_nexthop_resolution/r5/isisd.conf
@@ -0,0 +1,26 @@
+!
+interface lo
+ ip router isis 1
+ isis hello-interval 1
+ isis hello-multiplier 3
+ isis passive
+exit
+!
+interface r5-eth0
+ ip router isis 1
+ isis hello-interval 1
+ isis hello-multiplier 3
+exit
+!
+router isis 1
+ is-type level-1
+ net 49.0000.0007.e901.5555.00
+ lsp-timers gen-interval 1 refresh-interval 900 max-lifetime 1200
+ mpls-te on
+ mpls-te router-address 192.0.2.5
+ segment-routing on
+ segment-routing global-block 11000 12000 local-block 33000 33999
+ segment-routing node-msd 8
+ segment-routing prefix 192.0.2.5/32 index 55
+exit
+!
diff --git a/tests/topotests/zebra_fec_nexthop_resolution/r5/ospfd.conf.after b/tests/topotests/zebra_fec_nexthop_resolution/r5/ospfd.conf.after
new file mode 100644
index 00000000..868129f8
--- /dev/null
+++ b/tests/topotests/zebra_fec_nexthop_resolution/r5/ospfd.conf.after
@@ -0,0 +1,26 @@
+log stdout
+!
+interface lo
+ ip ospf network point-to-point
+ ip ospf passive
+exit
+!
+interface r5-eth1
+ ip ospf network point-to-point
+ ip ospf hello-interval 1
+exit
+!
+router ospf
+ ospf router-id 192.0.2.5
+ network 192.0.2.5/32 area 0.0.0.0
+ network 192.168.5.0/24 area 0.0.0.0
+ passive-interface lo
+ capability opaque
+ mpls-te on
+ mpls-te router-address 192.0.2.5
+ segment-routing on
+ segment-routing global-block 21000 22000 local-block 35000 35999
+ segment-routing node-msd 8
+ segment-routing prefix 192.0.2.5/32 index 55
+exit
+!
diff --git a/tests/topotests/zebra_fec_nexthop_resolution/r5/zebra.conf b/tests/topotests/zebra_fec_nexthop_resolution/r5/zebra.conf
new file mode 100644
index 00000000..dd519e8d
--- /dev/null
+++ b/tests/topotests/zebra_fec_nexthop_resolution/r5/zebra.conf
@@ -0,0 +1,19 @@
+!
+interface lo
+ ip address 192.0.2.5/32
+ mpls enable
+exit
+!
+interface r5-eth0
+ ip address 192.168.4.5/24
+ mpls enable
+exit
+!
+interface r5-eth1
+ ip address 192.168.5.5/24
+ mpls enable
+ link-params
+ enable
+ exit-link-params
+exit
+!
diff --git a/tests/topotests/zebra_fec_nexthop_resolution/r6/ospfd.conf.after b/tests/topotests/zebra_fec_nexthop_resolution/r6/ospfd.conf.after
new file mode 100644
index 00000000..60c4928f
--- /dev/null
+++ b/tests/topotests/zebra_fec_nexthop_resolution/r6/ospfd.conf.after
@@ -0,0 +1,32 @@
+log stdout
+!
+interface lo
+ ip ospf network point-to-point
+ ip ospf passive
+exit
+!
+interface r6-eth0
+ ip ospf network point-to-point
+ ip ospf hello-interval 1
+exit
+!
+interface r6-eth1
+ ip ospf network point-to-point
+ ip ospf hello-interval 1
+exit
+!
+router ospf
+ ospf router-id 192.0.2.6
+ segment-routing on
+ segment-routing global-block 21000 22000 local-block 38000 38999
+ network 192.0.2.6/32 area 0.0.0.0
+ network 192.168.5.0/24 area 0.0.0.0
+ network 192.168.6.0/24 area 0.0.0.0
+ passive-interface lo
+ capability opaque
+ mpls-te on
+ mpls-te router-address 192.0.2.6
+ segment-routing node-msd 8
+ segment-routing prefix 192.0.2.6/32 index 66
+exit
+!
diff --git a/tests/topotests/zebra_fec_nexthop_resolution/r6/zebra.conf b/tests/topotests/zebra_fec_nexthop_resolution/r6/zebra.conf
new file mode 100644
index 00000000..5e16e3e4
--- /dev/null
+++ b/tests/topotests/zebra_fec_nexthop_resolution/r6/zebra.conf
@@ -0,0 +1,22 @@
+!
+interface lo
+ ip address 192.0.2.6/32
+ mpls enable
+exit
+!
+interface r6-eth0
+ ip address 192.168.5.6/24
+ mpls enable
+ link-params
+ enable
+ exit-link-params
+exit
+!
+interface r6-eth1
+ ip address 192.168.6.6/24
+ mpls enable
+ link-params
+ enable
+ exit-link-params
+exit
+!
diff --git a/tests/topotests/zebra_fec_nexthop_resolution/r7/bgpd.conf b/tests/topotests/zebra_fec_nexthop_resolution/r7/bgpd.conf
new file mode 100644
index 00000000..eeda9d9c
--- /dev/null
+++ b/tests/topotests/zebra_fec_nexthop_resolution/r7/bgpd.conf
@@ -0,0 +1,24 @@
+!
+router bgp 65500
+ bgp router-id 192.0.2.7
+ neighbor 192.0.2.1 remote-as 65500
+ neighbor 192.0.2.1 ttl-security hops 10
+ neighbor 192.0.2.1 disable-connected-check
+ neighbor 192.0.2.1 update-source lo
+ neighbor 192.0.2.5 remote-as 65500
+ neighbor 192.0.2.5 update-source lo
+ !
+ address-family ipv4 unicast
+ network 192.0.2.7/32
+ neighbor 192.0.2.1 activate
+ no neighbor 192.0.2.5 activate
+ exit-address-family
+ !
+ address-family ipv4 labeled-unicast
+ neighbor 192.0.2.5 activate
+ neighbor 192.0.2.5 route-reflector-client
+ neighbor 192.0.2.5 next-hop-self force
+ exit-address-family
+ !
+exit
+!
diff --git a/tests/topotests/zebra_fec_nexthop_resolution/r7/ospfd.conf.after b/tests/topotests/zebra_fec_nexthop_resolution/r7/ospfd.conf.after
new file mode 100644
index 00000000..f8e56e12
--- /dev/null
+++ b/tests/topotests/zebra_fec_nexthop_resolution/r7/ospfd.conf.after
@@ -0,0 +1,26 @@
+log stdout
+!
+interface lo
+ ip ospf network point-to-point
+ ip ospf passive
+exit
+!
+interface r7-eth0
+ ip ospf network point-to-point
+ ip ospf hello-interval 1
+exit
+!
+router ospf
+ ospf router-id 192.0.2.7
+ network 192.0.2.7/32 area 0.0.0.0
+ network 192.168.6.0/24 area 0.0.0.0
+ passive-interface lo
+ capability opaque
+ mpls-te on
+ mpls-te router-address 192.0.2.7
+ segment-routing on
+ segment-routing global-block 21000 22000 local-block 31000 31999
+ segment-routing node-msd 8
+ segment-routing prefix 192.0.2.7/32 index 77
+exit
+!
diff --git a/tests/topotests/zebra_fec_nexthop_resolution/r7/zebra.conf b/tests/topotests/zebra_fec_nexthop_resolution/r7/zebra.conf
new file mode 100644
index 00000000..f5202254
--- /dev/null
+++ b/tests/topotests/zebra_fec_nexthop_resolution/r7/zebra.conf
@@ -0,0 +1,14 @@
+!
+interface lo
+ ip address 192.0.2.7/32
+ mpls enable
+exit
+!
+interface r7-eth0
+ ip address 192.168.6.7/24
+ mpls enable
+ link-params
+ enable
+ exit-link-params
+exit
+!
diff --git a/tests/topotests/zebra_fec_nexthop_resolution/test_zebra_fec_nexthop_resolution.py b/tests/topotests/zebra_fec_nexthop_resolution/test_zebra_fec_nexthop_resolution.py
new file mode 100644
index 00000000..984ff3c1
--- /dev/null
+++ b/tests/topotests/zebra_fec_nexthop_resolution/test_zebra_fec_nexthop_resolution.py
@@ -0,0 +1,259 @@
+#!/usr/bin/env python
+
+#
+# Copyright 2022 6WIND S.A.
+#
+# 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.
+#
+
+"""
+Check if fec nexthop resolution works correctly.
+"""
+
+import os
+import sys
+import json
+import pytest
+import functools
+
+CWD = os.path.dirname(os.path.realpath(__file__))
+sys.path.append(os.path.join(CWD, "../"))
+
+# pylint: disable=C0413
+from lib import topotest
+from lib.topogen import Topogen, TopoRouter, get_topogen
+from lib.common_config import step
+
+pytestmark = [pytest.mark.bgpd]
+
+
+def build_topo(tgen):
+ """
+ r1 ---- r2 ---- r3 ---- r4 ----- r5 ---- r6 ---- r7
+ <--- ospf ----> <---- isis -----> <--- ospf ---->
+ """
+ for routern in range(1, 8):
+ tgen.add_router("r{}".format(routern))
+
+ switch1 = tgen.add_switch("s1")
+ switch1.add_link(tgen.gears["r1"])
+ switch1.add_link(tgen.gears["r2"])
+
+ switch2 = tgen.add_switch("s2")
+ switch2.add_link(tgen.gears["r2"])
+ switch2.add_link(tgen.gears["r3"])
+
+ switch3 = tgen.add_switch("s3")
+ switch3.add_link(tgen.gears["r3"])
+ switch3.add_link(tgen.gears["r4"])
+
+ switch4 = tgen.add_switch("s4")
+ switch4.add_link(tgen.gears["r4"])
+ switch4.add_link(tgen.gears["r5"])
+
+ switch5 = tgen.add_switch("s5")
+ switch5.add_link(tgen.gears["r5"])
+ switch5.add_link(tgen.gears["r6"])
+
+ switch6 = tgen.add_switch("s6")
+ switch6.add_link(tgen.gears["r6"])
+ switch6.add_link(tgen.gears["r7"])
+
+
+def setup_module(mod):
+ tgen = Topogen(build_topo, mod.__name__)
+ tgen.start_topology()
+
+ router_list = tgen.routers()
+
+ def _enable_mpls_misc(router):
+ router.run("modprobe mpls_router")
+ router.run("echo 100000 > /proc/sys/net/mpls/platform_labels")
+ router.run("echo 1 > /proc/sys/net/mpls/conf/lo/input")
+
+ router = tgen.gears["r1"]
+ _enable_mpls_misc(router)
+
+ router = tgen.gears["r2"]
+ _enable_mpls_misc(router)
+
+ router = tgen.gears["r3"]
+ _enable_mpls_misc(router)
+
+ router = tgen.gears["r4"]
+ _enable_mpls_misc(router)
+
+ router = tgen.gears["r5"]
+ _enable_mpls_misc(router)
+
+ router = tgen.gears["r6"]
+ _enable_mpls_misc(router)
+
+ router = tgen.gears["r7"]
+ _enable_mpls_misc(router)
+
+ for i, (rname, router) in enumerate(router_list.items(), 1):
+ router.load_config(
+ TopoRouter.RD_ZEBRA, os.path.join(CWD, "{}/zebra.conf".format(rname))
+ )
+ if rname in ("r1", "r3", "r5", "r7"):
+ router.load_config(
+ TopoRouter.RD_BGP, os.path.join(CWD, "{}/bgpd.conf".format(rname))
+ )
+ if rname in ("r3", "r4", "r5"):
+ router.load_config(
+ TopoRouter.RD_ISIS, os.path.join(CWD, "{}/isisd.conf".format(rname))
+ )
+ if rname in ("r1", "r2", "r3", "r5", "r6", "r7"):
+ router.load_config(
+ TopoRouter.RD_OSPF, os.path.join(CWD, "{}/ospfd.conf".format(rname))
+ )
+
+ tgen.start_router()
+
+
+def teardown_module(mod):
+ tgen = get_topogen()
+ tgen.stop_topology()
+
+
+# There are some startup issued when initialising OSPF
+# To avoid those issues, load the ospf configuration after zebra started
+def test_zebra_fec_nexthop_resolution_finalise_ospf_config():
+ tgen = get_topogen()
+
+ if tgen.routers_have_failure():
+ pytest.skip(tgen.errors)
+
+ topotest.sleep(2)
+
+ tgen.net["r1"].cmd("vtysh -f {}/r1/ospfd.conf.after".format(CWD))
+ tgen.net["r2"].cmd("vtysh -f {}/r2/ospfd.conf.after".format(CWD))
+ tgen.net["r3"].cmd("vtysh -f {}/r3/ospfd.conf.after".format(CWD))
+ tgen.net["r5"].cmd("vtysh -f {}/r5/ospfd.conf.after".format(CWD))
+ tgen.net["r6"].cmd("vtysh -f {}/r6/ospfd.conf.after".format(CWD))
+ tgen.net["r7"].cmd("vtysh -f {}/r7/ospfd.conf.after".format(CWD))
+
+
+def test_zebra_fec_nexthop_resolution_bgp():
+ tgen = get_topogen()
+
+ if tgen.routers_have_failure():
+ pytest.skip(tgen.errors)
+
+ def _check_bgp_session():
+ r1 = tgen.gears["r1"]
+
+ tgen.gears["r3"].vtysh_cmd("config \n no mpls fec nexthop-resolution \n end")
+ tgen.gears["r3"].vtysh_cmd("config \n mpls fec nexthop-resolution \n end")
+ tgen.gears["r5"].vtysh_cmd("config \n no mpls fec nexthop-resolution \n end")
+ tgen.gears["r5"].vtysh_cmd("config \n mpls fec nexthop-resolution \n end")
+ output = json.loads(r1.vtysh_cmd("show bgp summary json"))
+
+ if output["ipv4Unicast"]["peers"]["192.0.2.7"]["state"] == "Established":
+ return None
+ return False
+
+ test_func1 = functools.partial(_check_bgp_session)
+ _, result1 = topotest.run_and_expect(test_func1, None, count=60, wait=0.5)
+ assert result1 is None, "Failed to verify the fec_nexthop_resolution: bgp session"
+
+
+def test_zebra_fec_nexthop_resolution_ping():
+ tgen = get_topogen()
+
+ if tgen.routers_have_failure():
+ pytest.skip(tgen.errors)
+
+ def _check_ping_launch():
+ r1 = tgen.gears["r1"]
+
+ ping_launch = "ping 192.0.2.7 -I 192.0.2.1 -c 1"
+ selected_lines = r1.run(ping_launch).splitlines()[-2:-1]
+ rtx_stats = "".join(selected_lines[0].split(",")[0:3])
+ current = topotest.normalize_text(rtx_stats)
+
+ expected_stats = "1 packets transmitted 1 received 0% packet loss"
+ expected = topotest.normalize_text(expected_stats)
+
+ if current == expected:
+ return None
+
+ return False
+
+ test_func2 = functools.partial(_check_ping_launch)
+ _, result2 = topotest.run_and_expect(test_func2, None, count=60, wait=1)
+ assert result2 is None, "Failed to verify the fec_nexthop_resolution: ping"
+
+
+def test_zebra_fec_nexthop_resolution_table():
+ tgen = get_topogen()
+
+ if tgen.routers_have_failure():
+ pytest.skip(tgen.errors)
+
+ def _zebra_check_mpls_table():
+ r3 = tgen.gears["r3"]
+ inLabel = 0
+ outLabels = 0
+
+ """
+ Retrieve inLabel from MPLS FEC table
+ """
+ mpls_fec = r3.vtysh_cmd("show mpls fec 192.0.2.7/32")
+ lines = mpls_fec.split("\n")
+ for line in lines:
+ if "Label" in line:
+ inLabel = line.split(": ", 1)[1]
+
+ """
+ Retrieve outLabel from BGP
+ """
+ output = json.loads(r3.vtysh_cmd("show ip route 192.0.2.7/32 json"))
+
+ outLabels = output["192.0.2.7/32"][0]["nexthops"][1]["labels"]
+
+ if (inLabel == 0) or (outLabels == 0):
+ return True
+
+ """
+ Compare expected data with real data
+ """
+ output = json.loads(r3.vtysh_cmd("show mpls table " + str(inLabel) + " json"))
+
+ expected = {
+ "inLabel": int(inLabel),
+ "installed": True,
+ "nexthops": [
+ {
+ "type": "BGP",
+ "outLabel": outLabels[0],
+ "outLabelStack": outLabels,
+ "distance": 20,
+ "installed": True,
+ "nexthop": "192.168.3.4",
+ }
+ ],
+ }
+ return topotest.json_cmp(output, expected)
+
+ test_func3 = functools.partial(_zebra_check_mpls_table)
+ _, result3 = topotest.run_and_expect(test_func3, None, count=60, wait=0.5)
+ assert result3 is None, "Failed to verify the fec_nexthop_resolution: mpls table"
+
+
+if __name__ == "__main__":
+ args = ["-s"] + sys.argv[1:]
+ sys.exit(pytest.main(args))