]> git.puffer.fish Git - mirror/frr.git/commitdiff
topotests: vpnv4 route leaking with no import-check 15313/head
authorLouis Scalbert <louis.scalbert@6wind.com>
Thu, 25 Jan 2024 13:26:56 +0000 (14:26 +0100)
committerMergify <37929162+mergify[bot]@users.noreply.github.com>
Tue, 6 Feb 2024 10:29:47 +0000 (10:29 +0000)
Test vpnv4 route leaking with no import-check

Signed-off-by: Louis Scalbert <louis.scalbert@6wind.com>
(cherry picked from commit 4bbfade7d6115370ffaa89634b02bec8534bf037)

tests/topotests/bgp_l3vpn_to_bgp_vrf/customize.py
tests/topotests/bgp_l3vpn_to_bgp_vrf/r1/bgpd.conf
tests/topotests/bgp_l3vpn_to_bgp_vrf/scripts/check_routes.py
tests/topotests/bgp_l3vpn_to_bgp_vrf/scripts/scale_down.py

index 0ac535030846387035bb3ed244d05f236ba11f9d..23ab90794c92ca895c3806df63965b848330b67f 100644 (file)
@@ -161,6 +161,15 @@ def ltemplatePreRouterStartHook():
         logger.info(
             "setup {0} vrf {0}-cust1, {0}-eth4. enabled mpls input.".format(rtr)
         )
+    # configure cust4 VRFs & MPLS
+    cmds = [
+        "ip link add {0}-cust4 type vrf table 30",
+        "ip link set dev {0}-cust4 up",
+    ]
+    rtr = "r1"
+    for cmd in cmds:
+        cc.doCmd(tgen, rtr, cmd.format(rtr))
+    logger.info("setup {0} vrf {0}-cust3 and{0}-cust4.".format(rtr))
     # configure cust2 VRFs & MPLS
     rtrs = ["r4"]
     cmds = [
index 72211fee7f10b565fa601b34083de12af4484b0b..b389eb1013de67b995e4c080724009f974b2234e 100644 (file)
@@ -50,6 +50,19 @@ router bgp 5227 vrf r1-cust1
      export vpn
    exit-address-family
 
+router bgp 5227 vrf r1-cust4
+   no bgp network import-check
 
+   bgp router-id 192.168.1.1
+
+   address-family ipv4 unicast
+     network 172.16.0.0/24
+
+     rd vpn export 10:14
+     rt vpn export 52:100
+
+     import vpn
+     export vpn
+   exit-address-family
 !
 end
index 1e2758c1c962d6a6c45307010bd82a95406d4cfe..3ab9b3f46e4b354366fdb2cf0ed68c3334589426 100644 (file)
@@ -59,12 +59,20 @@ want_r1_cust1_routes = [
     {"p": "5.1.1.0/24", "n": "99.0.0.1"},
     {"p": "6.0.1.0/24", "n": "99.0.0.1"},
     {"p": "6.0.2.0/24", "n": "99.0.0.1"},
+    {"p": "172.16.0.0/24", "n": "0.0.0.0", "bp": True},
     {"p": "99.0.0.1/32", "n": "192.168.1.2"},
 ]
 bgpribRequireUnicastRoutes(
     "r1", "ipv4", "r1-cust1", "Customer 1 routes in r1 vrf", want_r1_cust1_routes
 )
 
+want_r1_cust4_routes = [
+    {"p": "172.16.0.0/24", "n": "0.0.0.0", "bp": True},
+]
+bgpribRequireUnicastRoutes(
+    "r1", "ipv4", "r1-cust4", "Customer 4 routes in r1 vrf", want_r1_cust4_routes
+)
+
 want_r3_cust1_routes = [
     {"p": "5.1.0.0/24", "n": "99.0.0.2"},
     {"p": "5.1.1.0/24", "n": "99.0.0.2"},
@@ -667,7 +675,7 @@ bgpribRequireUnicastRoutes(
 luCommand(
     "ce1",
     'vtysh -c "show bgp ipv4 uni"',
-    "12 routes and 12",
+    "13 routes and 13",
     "wait",
     "Local and remote routes",
     10,
@@ -689,7 +697,7 @@ bgpribRequireUnicastRoutes(
 luCommand(
     "ce2",
     'vtysh -c "show bgp ipv4 uni"',
-    "12 routes and 15",
+    "13 routes and 16",
     "wait",
     "Local and remote routes",
     10,
@@ -721,7 +729,7 @@ luCommand("r4", 'vtysh -c "show ip route vrf r4-cust2"')
 luCommand(
     "ce3",
     'vtysh -c "show bgp ipv4 uni"',
-    "12 routes and 13",
+    "13 routes and 14",
     "wait",
     "Local and remote routes",
     10,
@@ -743,7 +751,7 @@ bgpribRequireUnicastRoutes(
 luCommand(
     "ce4",
     'vtysh -c "show bgp vrf ce4-cust2 ipv4 uni"',
-    "12 routes and 14",
+    "13 routes and 15",
     "wait",
     "Local and remote routes",
     10,
index 36be926227d0f17cf5597dc3f90f412f7e4eb4d9..43a5245d0fb2c94f46a788c3f261f2044dfaa00d 100644 (file)
@@ -49,7 +49,7 @@ if ret != False and found != None:
             luCommand(
                 rtr,
                 'vtysh -c "show bgp ipv4 uni" | grep Display',
-                " 12 route",
+                " 13 route",
                 "wait",
                 "BGP routes removed",
                 wait,