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:23 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-08-05 09:56:23 +0000
commitc15d6efd40655f717841d00839a43df1ead5cb26 (patch)
tree35d579f9a19170e2b39085669ca92533c2d161b4 /tests/topotests/bgp_path_selection
parentAdding upstream version 10.0.1. (diff)
downloadfrr-c15d6efd40655f717841d00839a43df1ead5cb26.tar.xz
frr-c15d6efd40655f717841d00839a43df1ead5cb26.zip
Adding upstream version 10.1.upstream/10.1upstream
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}],
- }
+ },
]
}