summaryrefslogtreecommitdiffstats
path: root/tests/topotests/bgp_path_selection
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-08-05 09:56:25 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-08-05 09:56:25 +0000
commit289582b3dcbeb23328325d224c7db7de66a3a55f (patch)
tree989c36d57aab945c36e34c952f438746ce18b3bd /tests/topotests/bgp_path_selection
parentReleasing progress-linux version 10.0.1-0.1~progress7.99u1. (diff)
downloadfrr-289582b3dcbeb23328325d224c7db7de66a3a55f.tar.xz
frr-289582b3dcbeb23328325d224c7db7de66a3a55f.zip
Merging upstream version 10.1.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'tests/topotests/bgp_path_selection')
-rw-r--r--tests/topotests/bgp_path_selection/test_bgp_path_selection.py27
1 files changed, 18 insertions, 9 deletions
diff --git a/tests/topotests/bgp_path_selection/test_bgp_path_selection.py b/tests/topotests/bgp_path_selection/test_bgp_path_selection.py
index bf5737b..30083b4 100644
--- a/tests/topotests/bgp_path_selection/test_bgp_path_selection.py
+++ b/tests/topotests/bgp_path_selection/test_bgp_path_selection.py
@@ -49,7 +49,11 @@ def setup_module(mod):
for routern in range(1, 4):
tgen.gears["r{}".format(routern)].cmd("ip link add vrf1 type vrf table 10")
tgen.gears["r{}".format(routern)].cmd("ip link set vrf1 up")
- tgen.gears["r{}".format(routern)].cmd("ip address add dev vrf1 {}.{}.{}.{}/32".format(routern, routern, routern,routern))
+ tgen.gears["r{}".format(routern)].cmd(
+ "ip address add dev vrf1 {}.{}.{}.{}/32".format(
+ routern, routern, routern, routern
+ )
+ )
tgen.gears["r2"].cmd("ip address add dev vrf1 192.0.2.8/32")
tgen.gears["r3"].cmd("ip address add dev vrf1 192.0.2.8/32")
@@ -74,6 +78,7 @@ def teardown_module(mod):
tgen = get_topogen()
tgen.stop_topology()
+
def test_bgp_path_selection_ecmp():
tgen = get_topogen()
@@ -97,7 +102,7 @@ def test_bgp_path_selection_ecmp():
"aspath": {"string": "65002"},
"multipath": True,
"nexthops": [{"ip": "192.0.2.3", "metric": 20}],
- }
+ },
]
}
@@ -117,7 +122,9 @@ def test_bgp_path_selection_vpn_ecmp():
def _bgp_check_path_selection_vpn_ecmp():
output = json.loads(
- tgen.gears["r1"].vtysh_cmd("show bgp vrf vrf1 ipv4 unicast 192.0.2.8/32 json")
+ tgen.gears["r1"].vtysh_cmd(
+ "show bgp vrf vrf1 ipv4 unicast 192.0.2.8/32 json"
+ )
)
expected = {
"paths": [
@@ -132,7 +139,7 @@ def test_bgp_path_selection_vpn_ecmp():
"aspath": {"string": "65002"},
"multipath": True,
"nexthops": [{"ip": "192.0.2.3", "metric": 20}],
- }
+ },
]
}
@@ -160,13 +167,13 @@ def test_bgp_path_selection_metric():
"valid": True,
"aspath": {"string": "65002"},
"nexthops": [{"ip": "192.0.2.2", "metric": 10}],
- "bestpath":{ "selectionReason":"IGP Metric"},
+ "bestpath": {"selectionReason": "IGP Metric"},
},
{
"valid": True,
"aspath": {"string": "65002"},
"nexthops": [{"ip": "192.0.2.3", "metric": 20}],
- }
+ },
]
}
@@ -189,7 +196,9 @@ def test_bgp_path_selection_vpn_metric():
def _bgp_check_path_selection_vpn_metric():
output = json.loads(
- tgen.gears["r1"].vtysh_cmd("show bgp vrf vrf1 ipv4 unicast 192.0.2.8/32 json")
+ tgen.gears["r1"].vtysh_cmd(
+ "show bgp vrf vrf1 ipv4 unicast 192.0.2.8/32 json"
+ )
)
expected = {
"paths": [
@@ -197,13 +206,13 @@ def test_bgp_path_selection_vpn_metric():
"valid": True,
"aspath": {"string": "65002"},
"nexthops": [{"ip": "192.0.2.2", "metric": 10}],
- "bestpath":{ "selectionReason":"IGP Metric"},
+ "bestpath": {"selectionReason": "IGP Metric"},
},
{
"valid": True,
"aspath": {"string": "65002"},
"nexthops": [{"ip": "192.0.2.3", "metric": 20}],
- }
+ },
]
}