]> git.proxmox.com Git - mirror_frr.git/commitdiff
tests: Adjust AIGP metric numbers for iBGP setup
authorDonatas Abraitis <donatas@opensourcerouting.org>
Mon, 8 May 2023 20:22:26 +0000 (23:22 +0300)
committerDonatas Abraitis <donatas@opensourcerouting.org>
Mon, 8 May 2023 20:34:33 +0000 (23:34 +0300)
Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
tests/topotests/bgp_aigp/r2/bgpd.conf
tests/topotests/bgp_aigp/r3/bgpd.conf
tests/topotests/bgp_aigp/r4/bgpd.conf
tests/topotests/bgp_aigp/r5/bgpd.conf
tests/topotests/bgp_aigp/r6/bgpd.conf
tests/topotests/bgp_aigp/r7/bgpd.conf
tests/topotests/bgp_aigp/test_bgp_aigp.py

index ae72f215c07928836c0758f85e57e22e0ea12bda..4db4687536429e85ce0ef524a20c6b919ed32435 100644 (file)
@@ -4,7 +4,8 @@ router bgp 65001
  neighbor 10.0.0.1 remote-as internal
  neighbor 10.0.0.1 timers 1 3
  neighbor 10.0.0.1 timers connect 1
- neighbor 192.168.24.4 remote-as external
+ neighbor 10.0.0.1 route-reflector-client
+ neighbor 192.168.24.4 remote-as internal
  neighbor 192.168.24.4 timers 1 3
  neighbor 192.168.24.4 timers connect 1
  neighbor 192.168.24.4 aigp
index 7572e268c5c92e39fcbb8ff634f43ac7ba78c720..5ab712eaba65fd600c9bf3956e1a6feadb24e8c5 100644 (file)
@@ -4,7 +4,8 @@ router bgp 65001
  neighbor 10.0.0.1 remote-as internal
  neighbor 10.0.0.1 timers 1 3
  neighbor 10.0.0.1 timers connect 1
- neighbor 192.168.35.5 remote-as external
+ neighbor 10.0.0.1 route-reflector-client
+ neighbor 192.168.35.5 remote-as internal
  neighbor 192.168.35.5 timers 1 3
  neighbor 192.168.35.5 timers connect 1
  neighbor 192.168.35.5 aigp
index d2b96b7b0aef4a80c1a22e5c49866c933e80f803..aa88bac91385f301eda70a695738f9447b9b516f 100644 (file)
@@ -1,10 +1,11 @@
-router bgp 65002
+router bgp 65001
  no bgp ebgp-requires-policy
  no bgp network import-check
- neighbor 192.168.24.2 remote-as external
+ neighbor 192.168.24.2 remote-as internal
  neighbor 192.168.24.2 timers 1 3
  neighbor 192.168.24.2 timers connect 1
  neighbor 192.168.24.2 aigp
+ neighbor 192.168.24.2 route-reflector-client
  neighbor 10.0.0.6 remote-as internal
  neighbor 10.0.0.6 timers 1 3
  neighbor 10.0.0.6 timers connect 1
index 944872289d799abb3908075cefb363ea480ddd6d..4fde262053cee49ff081f03bfcd942c0d4059c79 100644 (file)
@@ -1,10 +1,11 @@
-router bgp 65002
+router bgp 65001
  no bgp ebgp-requires-policy
  no bgp network import-check
- neighbor 192.168.35.3 remote-as external
+ neighbor 192.168.35.3 remote-as internal
  neighbor 192.168.35.3 timers 1 3
  neighbor 192.168.35.3 timers connect 1
  neighbor 192.168.35.3 aigp
+ neighbor 192.168.35.3 route-reflector-client
  neighbor 10.0.0.6 remote-as internal
  neighbor 10.0.0.6 timers 1 3
  neighbor 10.0.0.6 timers connect 1
index 15d9437a8eaadf6b7ccf31dfe2153aae0e90e05e..2faae7720c90e34b2608506b69493463fe59d74e 100644 (file)
@@ -1,4 +1,4 @@
-router bgp 65002
+router bgp 65001
  no bgp ebgp-requires-policy
  no bgp network import-check
  neighbor 10.0.0.4 remote-as internal
index 00d85cfaddaebd5da3bfc130e613dcfa8b24fcbc..639dcfeca8e0b56d5cfd9792c5a6c7e3baaa6728 100644 (file)
@@ -1,4 +1,4 @@
-router bgp 65002
+router bgp 65001
  no bgp ebgp-requires-policy
  no bgp network import-check
  neighbor 192.168.67.6 remote-as internal
index 6fda45940514438bdcdca4512ef9f79ca248ffeb..655e9ad1848508af0f97581f48539c2b3753bb98 100644 (file)
@@ -14,7 +14,7 @@ r6 receives those routes with aigp-metric TLV.
 r2 and r3 receives those routes with aigp-metric TLV increased by 20,
 and 30 appropriately.
 
-r1 receives routes with aigp-metric TLV 91,101 and 92,102 appropriately.
+r1 receives routes with aigp-metric TLV 111,131 and 112,132 appropriately.
 """
 
 import os
@@ -109,15 +109,15 @@ def test_bgp_aigp():
         expected = {
             "paths": [
                 {
-                    "aigpMetric": 101,
+                    "aigpMetric": 111,
                     "valid": True,
-                    "bestpath": {"selectionReason": "Router ID"},
-                    "nexthops": [{"hostname": "r2", "accessible": True}],
+                    "nexthops": [{"hostname": "r3", "accessible": True}],
                 },
                 {
-                    "aigpMetric": 91,
+                    "aigpMetric": 131,
                     "valid": True,
-                    "nexthops": [{"hostname": "r3", "accessible": True}],
+                    "bestpath": {"selectionReason": "Neighbor IP"},
+                    "nexthops": [{"hostname": "r2", "accessible": True}],
                 },
             ]
         }
@@ -141,28 +141,30 @@ def test_bgp_aigp():
                 "10.0.0.71/32": {
                     "paths": [
                         {
-                            "aigpMetric": 101,
+                            "aigpMetric": 111,
+                            "bestpath": {"selectionReason": "AIGP"},
                             "valid": True,
+                            "nexthops": [{"hostname": "r3", "accessible": True}],
                         },
                         {
-                            "aigpMetric": 91,
+                            "aigpMetric": 131,
                             "valid": True,
-                            "bestpath": {"selectionReason": "AIGP"},
-                            "nexthops": [{"hostname": "r3", "accessible": True}],
+                            "nexthops": [{"hostname": "r2", "accessible": True}],
                         },
                     ],
                 },
                 "10.0.0.72/32": {
                     "paths": [
                         {
-                            "aigpMetric": 102,
+                            "aigpMetric": 112,
+                            "bestpath": {"selectionReason": "AIGP"},
                             "valid": True,
+                            "nexthops": [{"hostname": "r3", "accessible": True}],
                         },
                         {
-                            "aigpMetric": 92,
+                            "aigpMetric": 132,
                             "valid": True,
-                            "bestpath": {"selectionReason": "AIGP"},
-                            "nexthops": [{"hostname": "r3", "accessible": True}],
+                            "nexthops": [{"hostname": "r2", "accessible": True}],
                         },
                     ],
                 },
@@ -172,7 +174,7 @@ def test_bgp_aigp():
 
     # Initial converge, AIGP is not involved in best-path selection process
     test_func = functools.partial(_bgp_converge)
-    _, result = topotest.run_and_expect(test_func, None, count=60, wait=0.5)
+    _, result = topotest.run_and_expect(test_func, None, count=60, wait=1)
     assert result is None, "can't converge initially"
 
     # Enable `bgp bestpath aigp`
@@ -186,27 +188,27 @@ def test_bgp_aigp():
 
     # r4, 10.0.0.71/32 with aigp-metric 71
     test_func = functools.partial(_bgp_check_aigp_metric, r4, "10.0.0.71/32", 71)
-    _, result = topotest.run_and_expect(test_func, None, count=60, wait=0.5)
+    _, result = topotest.run_and_expect(test_func, None, count=60, wait=1)
     assert result is None, "aigp-metric for 10.0.0.71/32 is not 71"
 
     # r5, 10.0.0.72/32 with aigp-metric 72
     test_func = functools.partial(_bgp_check_aigp_metric, r5, "10.0.0.72/32", 72)
-    _, result = topotest.run_and_expect(test_func, None, count=60, wait=0.5)
+    _, result = topotest.run_and_expect(test_func, None, count=60, wait=1)
     assert result is None, "aigp-metric for 10.0.0.72/32 is not 72"
 
     # r2, 10.0.0.71/32 with aigp-metric 101 (71 + 30)
     test_func = functools.partial(_bgp_check_aigp_metric, r2, "10.0.0.71/32", 101)
-    _, result = topotest.run_and_expect(test_func, None, count=60, wait=0.5)
+    _, result = topotest.run_and_expect(test_func, None, count=60, wait=1)
     assert result is None, "aigp-metric for 10.0.0.71/32 is not 101"
 
     # r3, 10.0.0.72/32 with aigp-metric 92 (72 + 20)
     test_func = functools.partial(_bgp_check_aigp_metric, r3, "10.0.0.72/32", 92)
-    _, result = topotest.run_and_expect(test_func, None, count=60, wait=0.5)
+    _, result = topotest.run_and_expect(test_func, None, count=60, wait=1)
     assert result is None, "aigp-metric for 10.0.0.72/32 is not 92"
 
     # r1, check if AIGP is considered in best-path selection (lowest wins)
     test_func = functools.partial(_bgp_check_aigp_metric_bestpath)
-    _, result = topotest.run_and_expect(test_func, None, count=60, wait=0.5)
+    _, result = topotest.run_and_expect(test_func, None, count=60, wait=1)
     assert result is None, "AIGP attribute is not considered in best-path selection"