]> git.puffer.fish Git - mirror/frr.git/commitdiff
tests: bgp_evpn_rt5 re-address overlay
authorLouis Scalbert <louis.scalbert@6wind.com>
Wed, 23 Apr 2025 09:24:51 +0000 (11:24 +0200)
committerLouis Scalbert <louis.scalbert@6wind.com>
Thu, 24 Apr 2025 08:35:22 +0000 (10:35 +0200)
for clarity

Signed-off-by: Louis Scalbert <louis.scalbert@6wind.com>
tests/topotests/bgp_evpn_rt5/r1/bgp_l2vpn_evpn_routes.json
tests/topotests/bgp_evpn_rt5/r1/bgp_l2vpn_evpn_routes_all.json
tests/topotests/bgp_evpn_rt5/r1/bgp_vrf_ipv4_routes_detail.json
tests/topotests/bgp_evpn_rt5/r1/bgp_vrf_ipv6_routes_detail.json
tests/topotests/bgp_evpn_rt5/r1/frr.conf
tests/topotests/bgp_evpn_rt5/r2/bgp_l2vpn_evpn_routes.json
tests/topotests/bgp_evpn_rt5/r2/bgp_vrf_ipv4_routes_detail.json
tests/topotests/bgp_evpn_rt5/r2/bgp_vrf_ipv6_routes_detail.json
tests/topotests/bgp_evpn_rt5/r2/frr.conf
tests/topotests/bgp_evpn_rt5/test_bgp_evpn.py

index a6497ea7c7eb9e15a6a458399125e10709453e65..86a63ee6b048adaf9759bafd5a169c9d3d4572da 100644 (file)
@@ -4,8 +4,8 @@
     "localAS":65000,
     "65000:201":{
         "rd":"65000:201",
-        "[5]:[0]:[32]:[192.168.101.41]":{
-            "prefix":"[5]:[0]:[32]:[192.168.101.41]",
+        "[5]:[0]:[32]:[10.0.101.2]":{
+            "prefix":"[5]:[0]:[32]:[10.0.101.2]",
             "prefixLen":352,
             "paths":[
                 {
@@ -16,7 +16,7 @@
                     "routeType":5,
                     "ethTag":0,
                     "ipLen":32,
-                    "ip":"192.168.101.41",
+                    "ip":"10.0.101.2",
                     "metric":0,
                     "locPrf":100,
                     "weight":0,
@@ -34,8 +34,8 @@
                 }
             ]
         },
-        "[5]:[0]:[128]:[fd00::2]":{
-            "prefix":"[5]:[0]:[128]:[fd00::2]",
+        "[5]:[0]:[128]:[fd01::2]":{
+            "prefix":"[5]:[0]:[128]:[fd01::2]",
             "prefixLen":352,
             "paths":[
                 {
@@ -46,7 +46,7 @@
                     "routeType":5,
                     "ethTag":0,
                     "ipLen":128,
-                    "ip":"fd00::2",
+                    "ip":"fd01::2",
                     "metric":0,
                     "locPrf":100,
                     "weight":0,
@@ -67,8 +67,8 @@
     },
     "65000:101":{
         "rd":"65000:101",
-        "[5]:[0]:[32]:[192.168.102.21]":{
-            "prefix":"[5]:[0]:[32]:[192.168.102.21]",
+        "[5]:[0]:[32]:[10.0.101.1]":{
+            "prefix":"[5]:[0]:[32]:[10.0.101.1]",
             "prefixLen":352,
             "paths":[
                 {
@@ -79,7 +79,7 @@
                     "routeType":5,
                     "ethTag":0,
                     "ipLen":32,
-                    "ip":"192.168.102.21",
+                    "ip":"10.0.101.1",
                     "metric":0,
                     "weight":32768,
                     "peerId":"(unspec)",
@@ -96,8 +96,8 @@
                 }
             ]
         },
-        "[5]:[0]:[128]:[fd00::1]":{
-            "prefix":"[5]:[0]:[128]:[fd00::1]",
+        "[5]:[0]:[128]:[fd01::1]":{
+            "prefix":"[5]:[0]:[128]:[fd01::1]",
             "prefixLen":352,
             "paths":[
                 {
                     "routeType":5,
                     "ethTag":0,
                     "ipLen":128,
-                    "ip":"fd00::1",
+                    "ip":"fd01::1",
                     "metric":0,
                     "weight":32768,
                     "peerId":"(unspec)",
index 82fa2c0598f01dd17dd230fcd22711b9d1da67ac..2bf47dfd1ff782e26eba17e0c3162c9752106e99 100644 (file)
@@ -4,8 +4,8 @@
     "localAS":65000,
     "65000:201":{
         "rd":"65000:201",
-        "[5]:[0]:[32]:[192.168.101.41]":{
-            "prefix":"[5]:[0]:[32]:[192.168.101.41]",
+        "[5]:[0]:[32]:[10.0.101.2]":{
+            "prefix":"[5]:[0]:[32]:[10.0.101.2]",
             "prefixLen":352,
             "paths":[
                 {
@@ -16,7 +16,7 @@
                     "routeType":5,
                     "ethTag":0,
                     "ipLen":32,
-                    "ip":"192.168.101.41",
+                    "ip":"10.0.101.2",
                     "metric":0,
                     "locPrf":100,
                     "weight":0,
@@ -34,8 +34,8 @@
                 }
             ]
         },
-        "[5]:[0]:[32]:[192.168.102.41]":{
-            "prefix":"[5]:[0]:[32]:[192.168.102.41]",
+        "[5]:[0]:[32]:[10.0.101.12]":{
+            "prefix":"[5]:[0]:[32]:[10.0.101.12]",
             "prefixLen":352,
             "paths":[
                 {
@@ -46,7 +46,7 @@
                     "routeType":5,
                     "ethTag":0,
                     "ipLen":32,
-                    "ip":"192.168.102.41",
+                    "ip":"10.0.101.12",
                     "metric":0,
                     "locPrf":100,
                     "weight":0,
@@ -64,8 +64,8 @@
                 }
             ]
         },
-        "[5]:[0]:[128]:[fd00::2]":{
-            "prefix":"[5]:[0]:[128]:[fd00::2]",
+        "[5]:[0]:[128]:[fd01::2]":{
+            "prefix":"[5]:[0]:[128]:[fd01::2]",
             "prefixLen":352,
             "paths":[
                 {
@@ -76,7 +76,7 @@
                     "routeType":5,
                     "ethTag":0,
                     "ipLen":128,
-                    "ip":"fd00::2",
+                    "ip":"fd01::2",
                     "metric":0,
                     "locPrf":100,
                     "weight":0,
@@ -94,8 +94,8 @@
                 }
             ]
         },
-        "[5]:[0]:[128]:[fd00::3]":{
-            "prefix":"[5]:[0]:[128]:[fd00::3]",
+        "[5]:[0]:[128]:[fd01::12]":{
+            "prefix":"[5]:[0]:[128]:[fd01::12]",
             "prefixLen":352,
             "paths":[
                 {
                     "routeType":5,
                     "ethTag":0,
                     "ipLen":128,
-                    "ip":"fd00::3",
+                    "ip":"fd01::12",
                     "metric":0,
                     "locPrf":100,
                     "weight":0,
     },
     "65000:101":{
         "rd":"65000:101",
-        "[5]:[0]:[32]:[192.168.102.21]":{
-            "prefix":"[5]:[0]:[32]:[192.168.102.21]",
+        "[5]:[0]:[32]:[10.0.101.1]":{
+            "prefix":"[5]:[0]:[32]:[10.0.101.1]",
             "prefixLen":352,
             "paths":[
                 {
                     "routeType":5,
                     "ethTag":0,
                     "ipLen":32,
-                    "ip":"192.168.102.21",
+                    "ip":"10.0.101.1",
                     "metric":0,
                     "weight":32768,
                     "peerId":"(unspec)",
                 }
             ]
         },
-        "[5]:[0]:[128]:[fd00::1]":{
-            "prefix":"[5]:[0]:[128]:[fd00::1]",
+        "[5]:[0]:[128]:[fd01::1]":{
+            "prefix":"[5]:[0]:[128]:[fd01::1]",
             "prefixLen":352,
             "paths":[
                 {
                     "routeType":5,
                     "ethTag":0,
                     "ipLen":128,
-                    "ip":"fd00::1",
+                    "ip":"fd01::1",
                     "metric":0,
                     "weight":32768,
                     "peerId":"(unspec)",
index 45b4645a80be13e986441bf59b0b463377078bac..3260467620361abd264713da02542309724c4a23 100644 (file)
@@ -1,9 +1,9 @@
 {
     "vrfName": "r1-vrf-101",
-    "routerId": "192.168.102.21",
+    "routerId": "10.0.101.1",
     "localAS": 65000,
     "routes": {
-        "192.168.101.41/32": [
+        "10.0.101.2/32": [
             {
                 "importedFrom": "65000:201",
                 "vni": "101",
index d063b23df6af72f684d98a921601809ac33b2cf2..a9bf422f2f76fe1de9b109778ec28c35ef2ed07b 100644 (file)
@@ -1,9 +1,9 @@
 {
     "vrfName": "r1-vrf-101",
-    "routerId": "192.168.102.21",
+    "routerId": "10.0.101.1",
     "localAS": 65000,
     "routes": {
-        "fd00::2/128": [
+        "fd01::2/128": [
             {
                 "importedFrom": "65000:201",
                 "vni": "101",
index 550900c4c02f10296fa320da83b54798b9746828..d2db5cc626e8019b31c040731ae7746fc057912b 100644 (file)
@@ -14,8 +14,8 @@ interface r1-eth0
  ip address 192.168.0.1/24
 !
 interface loop101 vrf r1-vrf-101
- ip address 192.168.102.21/32
- ipv6 address fd00::1/128
+ ip address 10.0.101.1/32
+ ipv6 address fd01::1/128
 !
 router bgp 65000
  bgp router-id 192.168.0.1
@@ -32,14 +32,14 @@ router bgp 65000
  exit-address-family
 !
 router bgp 65000 vrf r1-vrf-101
- bgp router-id 192.168.102.21
+ bgp router-id 10.0.101.1
  bgp log-neighbor-changes
  no bgp network import-check
  address-family ipv4 unicast
-  network 192.168.102.21/32
+  network 10.0.101.1/32
  exit-address-family
  address-family ipv6 unicast
-  network fd00::1/128
+  network fd01::1/128
  exit-address-family
  address-family l2vpn evpn
   rd 65000:101
index ab03480d7096325bbd8d418cceb6c81a2b5b43ec..5eeddf39e916103be4cd9a80d98e17999bf183b0 100644 (file)
@@ -4,8 +4,8 @@
     "localAS":65000,
     "65000:201":{
         "rd":"65000:201",
-        "[5]:[0]:[32]:[192.168.101.41]":{
-            "prefix":"[5]:[0]:[32]:[192.168.101.41]",
+        "[5]:[0]:[32]:[10.0.101.2]":{
+            "prefix":"[5]:[0]:[32]:[10.0.101.2]",
             "prefixLen":352,
             "paths":[
                 {
@@ -16,7 +16,7 @@
                     "routeType":5,
                     "ethTag":0,
                     "ipLen":32,
-                    "ip":"192.168.101.41",
+                    "ip":"10.0.101.2",
                     "metric":0,
                     "weight":32768,
                     "peerId":"(unspec)",
@@ -33,8 +33,8 @@
                 }
             ]
         },
-        "[5]:[0]:[128]:[fd00::2]":{
-            "prefix":"[5]:[0]:[128]:[fd00::2]",
+        "[5]:[0]:[128]:[fd01::2]":{
+            "prefix":"[5]:[0]:[128]:[fd01::2]",
             "prefixLen":352,
             "paths":[
                 {
@@ -45,7 +45,7 @@
                     "routeType":5,
                     "ethTag":0,
                     "ipLen":128,
-                    "ip":"fd00::2",
+                    "ip":"fd01::2",
                     "metric":0,
                     "weight":32768,
                     "peerId":"(unspec)",
@@ -65,8 +65,8 @@
     },
     "65000:101":{
         "rd":"65000:101",
-        "[5]:[0]:[32]:[192.168.102.21]":{
-            "prefix":"[5]:[0]:[32]:[192.168.102.21]",
+        "[5]:[0]:[32]:[10.0.101.1]":{
+            "prefix":"[5]:[0]:[32]:[10.0.101.1]",
             "prefixLen":352,
             "paths":[
                 {
@@ -77,7 +77,7 @@
                     "routeType":5,
                     "ethTag":0,
                     "ipLen":32,
-                    "ip":"192.168.102.21",
+                    "ip":"10.0.101.1",
                     "metric":0,
                     "locPrf":100,
                     "weight":0,
@@ -95,8 +95,8 @@
                 }
             ]
         },
-        "[5]:[0]:[128]:[fd00::1]":{
-            "prefix":"[5]:[0]:[128]:[fd00::1]",
+        "[5]:[0]:[128]:[fd01::1]":{
+            "prefix":"[5]:[0]:[128]:[fd01::1]",
             "prefixLen":352,
             "paths":[
                 {
                     "routeType":5,
                     "ethTag":0,
                     "ipLen":128,
-                    "ip":"fd00::1",
+                    "ip":"fd01::1",
                     "metric":0,
                     "locPrf":100,
                     "weight":0,
index 29d61e340fd929147979479542151da2279952af..d2a925aa5ab68f97f020f2b74b3d5a9053534977 100644 (file)
@@ -1,9 +1,9 @@
 {
     "vrfName": "r2-vrf-101",
-    "routerId": "192.168.101.41",
+    "routerId": "10.0.101.2",
     "localAS": 65000,
     "routes": {
-        "192.168.102.21/32": [
+        "10.0.101.1/32": [
             {
                 "importedFrom": "65000:101",
                 "vni": "101",
index 97c155d04e5daa6b0cb812a63be5a68d91bd9adf..796b42e065edb023681c92e560521ea401572528 100644 (file)
@@ -1,9 +1,9 @@
 {
     "vrfName": "r2-vrf-101",
-    "routerId": "192.168.101.41",
+    "routerId": "10.0.101.2",
     "localAS": 65000,
     "routes": {
-        "fd00::1/128": [
+        "fd01::1/128": [
             {
                 "importedFrom": "65000:101",
                 "vni": "101",
index fdb2a3b32927f969b24e42dfc6bb69ccd1b1a6c1..7da281fecd23d9d2445ef8e15577243a07236594 100644 (file)
@@ -8,8 +8,8 @@ vrf r2-vrf-101
  exit-vrf
 !
 interface loop101 vrf r2-vrf-101
- ip address 192.168.101.41/32
- ipv6 address fd00::2/128
+ ip address 10.0.101.2/32
+ ipv6 address fd01::2/128
 !
 interface r2-eth0
  ip address 192.168.0.2/24
@@ -28,16 +28,16 @@ router bgp 65000
  exit-address-family
 !
 router bgp 65000 vrf r2-vrf-101
- bgp router-id 192.168.101.41
+ bgp router-id 10.0.101.2
  bgp log-neighbor-changes
  no bgp network import-check
  address-family ipv4 unicast
-  network 192.168.101.41/32
-  network 192.168.102.41/32
+  network 10.0.101.2/32
+  network 10.0.101.12/32
  exit-address-family
  address-family ipv6 unicast
-  network fd00::2/128
-  network fd00::3/128
+  network fd01::2/128
+  network fd01::12/128
  exit-address-family
  address-family l2vpn evpn
   rd 65000:201
@@ -46,10 +46,10 @@ router bgp 65000 vrf r2-vrf-101
   advertise ipv6 unicast route-map rmap6
  exit-address-family
  !
-access-list acl4_1 seq 10 permit 192.168.101.41/32
-access-list acl4_2 seq 10 permit 192.168.102.41/32
-ipv6 access-list acl6_1 seq 10 permit fd00::2/128
-ipv6 access-list acl6_2 seq 10 permit fd00::3/128
+access-list acl4_1 seq 10 permit 10.0.101.2/32
+access-list acl4_2 seq 10 permit 10.0.101.12/32
+ipv6 access-list acl6_1 seq 10 permit fd01::2/128
+ipv6 access-list acl6_2 seq 10 permit fd01::12/128
 route-map rmap4 permit 1
  match ip address acl4_1
 exit
index 6394e74678d68bbe622bd3eba83c3c75d70dac79..1510f50eedb6037cbd5c745b4db42da28a4377eb 100644 (file)
@@ -152,28 +152,28 @@ def _test_evpn_ping_router(pingrouter, ipv4_only=False, ipv6_only=False):
     # Check IPv4 and IPv6 connectivity between r1 and r2 ( routing vxlan evpn)
     if not ipv6_only:
         logger.info(
-            "Check Ping IPv4 from  R1(r1-vrf-101) to R2(r2-vrf-101 = 192.168.101.41)"
-        )
-        output = pingrouter.run(
-            "ip netns exec r1-vrf-101 ping 192.168.101.41 -f -c 1000"
+            "Check Ping IPv4 from  R1(r1-vrf-101) to R2(r2-vrf-101 = 10.0.101.2)"
         )
+        output = pingrouter.run("ip netns exec r1-vrf-101 ping 10.0.101.2 -f -c 1000")
         logger.info(output)
         if "1000 packets transmitted, 1000 received" not in output:
-            assertmsg = "expected ping IPv4 from R1(r1-vrf-101) to R2(192.168.101.41) should be ok"
+            assertmsg = (
+                "expected ping IPv4 from R1(r1-vrf-101) to R2(10.0.101.2) should be ok"
+            )
             assert 0, assertmsg
         else:
-            logger.info("Check Ping IPv4 from R1(r1-vrf-101) to R2(192.168.101.41) OK")
+            logger.info("Check Ping IPv4 from R1(r1-vrf-101) to R2(10.0.101.2) OK")
 
     if not ipv4_only:
-        logger.info("Check Ping IPv6 from  R1(r1-vrf-101) to R2(r2-vrf-101 = fd00::2)")
-        output = pingrouter.run("ip netns exec r1-vrf-101 ping fd00::2 -f -c 1000")
+        logger.info("Check Ping IPv6 from  R1(r1-vrf-101) to R2(r2-vrf-101 = fd01::2)")
+        output = pingrouter.run("ip netns exec r1-vrf-101 ping fd01::2 -f -c 1000")
         logger.info(output)
         if "1000 packets transmitted, 1000 received" not in output:
             assert (
                 0
-            ), "expected ping IPv6 from R1(r1-vrf-101) to R2(fd00::2) should be ok"
+            ), "expected ping IPv6 from R1(r1-vrf-101) to R2(fd01::2) should be ok"
         else:
-            logger.info("Check Ping IPv6 from R1(r1-vrf-101) to R2(fd00::2) OK")
+            logger.info("Check Ping IPv6 from R1(r1-vrf-101) to R2(fd01::2) OK")
 
 
 def test_protocols_convergence():
@@ -292,9 +292,9 @@ def test_router_check_ip():
         pytest.skip(tgen.errors)
 
     expected = {
-        "fd00::2/128": [
+        "fd01::2/128": [
             {
-                "prefix": "fd00::2/128",
+                "prefix": "fd01::2/128",
                 "vrfName": "r1-vrf-101",
                 "nexthops": [
                     {
@@ -305,7 +305,7 @@ def test_router_check_ip():
         ]
     }
     result = topotest.router_json_cmp(
-        tgen.gears["r1"], "show ipv6 route vrf r1-vrf-101 fd00::2/128 json", expected
+        tgen.gears["r1"], "show ipv6 route vrf r1-vrf-101 fd01::2/128 json", expected
     )
     assert result is None, "ipv6 route check failed"
 
@@ -317,7 +317,7 @@ def _test_router_check_evpn_next_hop(expected_paths=1):
     expected = {
         "ip": "192.168.0.1",
         "refCount": 1,
-        "prefixList": [{"prefix": "192.168.102.21/32", "pathCount": expected_paths}],
+        "prefixList": [{"prefix": "10.0.101.1/32", "pathCount": expected_paths}],
     }
     test_func = partial(
         topotest.router_json_cmp,
@@ -332,7 +332,7 @@ def _test_router_check_evpn_next_hop(expected_paths=1):
     expected = {
         "ip": "::ffff:192.168.0.1",
         "refCount": 1,
-        "prefixList": [{"prefix": "fd00::1/128", "pathCount": expected_paths}],
+        "prefixList": [{"prefix": "fd01::1/128", "pathCount": expected_paths}],
     }
     test_func = partial(
         topotest.router_json_cmp,
@@ -478,8 +478,8 @@ def test_evpn_remove_ip():
             "raw_config": [
                 "router bgp 65000 vrf r2-vrf-101",
                 "address-family ipv6 unicast",
-                "no network fd00::3/128",
-                "no network fd00::2/128",
+                "no network fd01::12/128",
+                "no network fd01::2/128",
             ]
         }
     }
@@ -489,7 +489,7 @@ def test_evpn_remove_ip():
     assert result is True, "Failed to remove IPv6 network on R2, Error: {} ".format(
         result
     )
-    _check_evpn_routes("r1", "ipv6", "r1-vrf-101", ["fd00::2/128"], expected=False)
+    _check_evpn_routes("r1", "ipv6", "r1-vrf-101", ["fd01::2/128"], expected=False)
     _print_evpn_nexthop_rmac("r1")
 
 
@@ -529,8 +529,8 @@ def test_evpn_other_address_family():
             "raw_config": [
                 "router bgp 65000 vrf r2-vrf-101",
                 "address-family ipv6 unicast",
-                "network fd00::3/128",
-                "network fd00::2/128",
+                "network fd01::12/128",
+                "network fd01::2/128",
             ]
         }
     }
@@ -538,15 +538,15 @@ def test_evpn_other_address_family():
     logger.info("==== Add IPv6 again network on R2")
     result = apply_raw_config(tgen, config_add_ipv6)
     assert result is True, "Failed to add IPv6 network on R2, Error: {} ".format(result)
-    _check_evpn_routes("r1", "ipv6", "r1-vrf-101", ["fd00::2/128"], expected=True)
+    _check_evpn_routes("r1", "ipv6", "r1-vrf-101", ["fd01::2/128"], expected=True)
 
     config_no_ipv4 = {
         "r2": {
             "raw_config": [
                 "router bgp 65000 vrf r2-vrf-101",
                 "address-family ipv4 unicast",
-                "no network 192.168.101.41/32",
-                "no network 192.168.102.41/32",
+                "no network 10.0.101.2/32",
+                "no network 10.0.101.12/32",
             ]
         }
     }
@@ -557,9 +557,7 @@ def test_evpn_other_address_family():
         result
     )
 
-    _check_evpn_routes(
-        "r1", "ipv4", "r1-vrf-101", ["192.168.101.41/32"], expected=False
-    )
+    _check_evpn_routes("r1", "ipv4", "r1-vrf-101", ["10.0.101.2/32"], expected=False)
     _print_evpn_nexthop_rmac("r1")
 
 
@@ -639,20 +637,20 @@ def _test_wait_for_multipath_convergence(router, expected_paths=1):
     Wait for multipath convergence on R2
     """
     expected = {
-        "192.168.102.21/32": [{"nexthops": [{"ip": "192.168.0.1"}] * expected_paths}]
+        "10.0.101.1/32": [{"nexthops": [{"ip": "192.168.0.1"}] * expected_paths}]
     }
     # Using router_json_cmp instead of verify_fib_routes, because we need to check for
     # two next-hops with the same IP address.
     test_func = partial(
         topotest.router_json_cmp,
         router,
-        "show ip route vrf r2-vrf-101 192.168.102.21/32 json",
+        "show ip route vrf r2-vrf-101 10.0.101.1/32 json",
         expected,
     )
     _, result = topotest.run_and_expect(test_func, None, count=20, wait=1)
     assert (
         result is None
-    ), f"R2 does not have {expected_paths} next-hops for 192.168.102.21/32 JSON output mismatches"
+    ), f"R2 does not have {expected_paths} next-hops for 10.0.101.1/32 JSON output mismatches"
 
 
 def _test_rmac_present(router):