Commit 030570601d for frr
commit 030570601d1ca8a0272d62c1f9d9867382fec4f4
Author: Philippe Guibert <philippe.guibert@6wind.com>
Date: Wed Oct 21 15:36:48 2026 +0200
tests: apply pyblack formatting to bgp_srv6_unicast
Apply pyblack formatting to topotest bgp_srv6_unicast.
Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
diff --git a/tests/topotests/bgp_srv6_unicast/test_bgp_srv6_unicast.py b/tests/topotests/bgp_srv6_unicast/test_bgp_srv6_unicast.py
index e41f78b44d..9a06f078c2 100644
--- a/tests/topotests/bgp_srv6_unicast/test_bgp_srv6_unicast.py
+++ b/tests/topotests/bgp_srv6_unicast/test_bgp_srv6_unicast.py
@@ -54,6 +54,7 @@ pytestmark = [pytest.mark.bgpd]
r1_unicast_sid = None
r3_unicast_sid = None
+
def setup_module(mod):
# This topotest sets net.vrf.strict_mode during setup. That sysctl is
# available only after the VRF module is loaded; if the module is not loaded,
@@ -65,8 +66,13 @@ def setup_module(mod):
if not topotest.module_present("vrf"):
pytest.skip("VRF kernel module is not available")
- topodef = {"s1": ("r1", "r2"), "s2": ("r1", "r3"), "s3": ("r1", "r4"),
- "s4": ("c1", "r2"), "s5": ("r3", "c2")}
+ topodef = {
+ "s1": ("r1", "r2"),
+ "s2": ("r1", "r3"),
+ "s3": ("r1", "r4"),
+ "s4": ("c1", "r2"),
+ "s5": ("r3", "c2"),
+ }
tgen = Topogen(topodef, mod.__name__)
tgen.start_topology()
@@ -95,6 +101,7 @@ def setup_module(mod):
tgen.start_router()
+
@retry(retry_timeout=10)
def get_unicast_sid(afi):
global r1_unicast_sid, r3_unicast_sid
@@ -161,8 +168,11 @@ def check_route(router, cmd, expect_route, expect_sid, expect_installed=True):
if expect_sid == "" and route["nexthops"][0].get("seg6", {}).get("segs", "") != "":
return "%s: expecting no sid on route %s" % (router.name, expect_route)
- if expect_sid and route["nexthops"][0].get("seg6", {}).get("segs", "") != expect_sid:
- error = "%s: expecting" % router.name
+ if (
+ expect_sid
+ and route["nexthops"][0].get("seg6", {}).get("segs", "") != expect_sid
+ ):
+ error = "%s: expecting" % router.name
if expect_sid:
error = "%s %s sid" % (error, expect_sid)
@@ -172,6 +182,7 @@ def check_route(router, cmd, expect_route, expect_sid, expect_installed=True):
return True
+
def test_bgp_srv6_encap():
"""
For static prefix 10.0.0.1/32:
@@ -184,22 +195,35 @@ def test_bgp_srv6_encap():
res = get_unicast_sid("AFI_IP")
assert res is True, res
- logger.info("R1 sid[AFI_IP]: %s, R3 sid[AFI_IP]: %s" % (r1_unicast_sid, r3_unicast_sid))
+ logger.info(
+ "R1 sid[AFI_IP]: %s, R3 sid[AFI_IP]: %s" % (r1_unicast_sid, r3_unicast_sid)
+ )
logger.info("Check prefix 10.0.0.1/32 SRv6 encap on R2")
- res = check_route(tgen.gears["r2"], "show ip route 10.0.0.1/32 json", "10.0.0.1/32", r1_unicast_sid)
+ res = check_route(
+ tgen.gears["r2"],
+ "show ip route 10.0.0.1/32 json",
+ "10.0.0.1/32",
+ r1_unicast_sid,
+ )
assert res is True, res
logger.info("Check prefix 10.0.0.1/32 SRv6 encap on R3")
- res = check_route(tgen.gears["r3"], "show ip route 10.0.0.1/32 json", "10.0.0.1/32", r1_unicast_sid)
+ res = check_route(
+ tgen.gears["r3"],
+ "show ip route 10.0.0.1/32 json",
+ "10.0.0.1/32",
+ r1_unicast_sid,
+ )
assert res is True, res
logger.info("Check prefix 10.0.0.1/32 no SRv6 encap on R4")
- res = check_route(tgen.gears["r4"], "show ip route 10.0.0.1/32 json", "10.0.0.1/32", "")
+ res = check_route(
+ tgen.gears["r4"], "show ip route 10.0.0.1/32 json", "10.0.0.1/32", ""
+ )
assert res is True, res
-
def test_bgp_srv6_neighbor_encapsulation_reapply():
"""
Apply again the 'neighbor encapsulation-srv6' and 'neighbor
@@ -250,15 +274,24 @@ def test_bgp_srv6_update1():
)
logger.info("Check prefix 10.0.0.2/32 no SRv6 encap on R1")
- res = check_route(tgen.gears["r1"], "show ip route 10.0.0.2/32 json", "10.0.0.2/32", "")
+ res = check_route(
+ tgen.gears["r1"], "show ip route 10.0.0.2/32 json", "10.0.0.2/32", ""
+ )
assert res is True, res
logger.info("Check prefix 10.0.0.2/32 SRv6 encap on R3")
- res = check_route(tgen.gears["r3"], "show ip route 10.0.0.2/32 json", "10.0.0.2/32", r1_unicast_sid)
+ res = check_route(
+ tgen.gears["r3"],
+ "show ip route 10.0.0.2/32 json",
+ "10.0.0.2/32",
+ r1_unicast_sid,
+ )
assert res is True, res
logger.info("Check prefix 10.0.0.2/32 no SRv6 encap on R4")
- res = check_route(tgen.gears["r4"], "show ip route 10.0.0.2/32 json", "10.0.0.2/32", "")
+ res = check_route(
+ tgen.gears["r4"], "show ip route 10.0.0.2/32 json", "10.0.0.2/32", ""
+ )
assert res is True, res
@@ -281,17 +314,30 @@ def test_bgp_srv6_update2():
)
logger.info("Check prefix 10.0.0.3/32 SRv6 encap on R1")
- res = check_route(tgen.gears["r1"], "show ip route 10.0.0.3/32 json", "10.0.0.3/32", r3_unicast_sid)
+ res = check_route(
+ tgen.gears["r1"],
+ "show ip route 10.0.0.3/32 json",
+ "10.0.0.3/32",
+ r3_unicast_sid,
+ )
assert res is True, res
logger.info("Check prefix 10.0.0.3/32 SRv6 encap on R2")
- res = check_route(tgen.gears["r2"], "show ip route 10.0.0.3/32 json", "10.0.0.3/32", r3_unicast_sid)
+ res = check_route(
+ tgen.gears["r2"],
+ "show ip route 10.0.0.3/32 json",
+ "10.0.0.3/32",
+ r3_unicast_sid,
+ )
assert res is True, res
logger.info("Check prefix 10.0.0.3/32 no SRv6 encap on R4")
- res = check_route(tgen.gears["r4"], "show ip route 10.0.0.3/32 json", "10.0.0.3/32", "")
+ res = check_route(
+ tgen.gears["r4"], "show ip route 10.0.0.3/32 json", "10.0.0.3/32", ""
+ )
assert res is True, res
+
def test_bgp_srv6_sid_rmap():
"""
Configure prefix 172.16.0.0/24 on r1 and check it is blocked.
@@ -307,13 +353,19 @@ def test_bgp_srv6_sid_rmap():
)
logger.info("Check prefix 172.16.0.0/24 no SRv6 encap on R2")
- res = check_route(tgen.gears["r2"], "show ip route 172.16.0.0/24 json",
- "172.16.0.0/24", "")
+ res = check_route(
+ tgen.gears["r2"], "show ip route 172.16.0.0/24 json", "172.16.0.0/24", ""
+ )
assert res is True, res
logger.info("Check prefix 172.16.0.0/24 is not installed on R3")
- res = check_route(tgen.gears["r3"], "show ip route 172.16.0.0/24 json",
- "172.16.0.0/24", "", expect_installed=False)
+ res = check_route(
+ tgen.gears["r3"],
+ "show ip route 172.16.0.0/24 json",
+ "172.16.0.0/24",
+ "",
+ expect_installed=False,
+ )
assert res is True, res
@@ -475,10 +527,16 @@ def test_bgp_srv6_sid_unexport():
prefixes = ["10.0.0.1/32", "10.0.0.2/32", "10.0.0.3/32"]
logger.info("Check 10.0.0.1-3/32 are not installed on R3")
for prefix in prefixes:
- res = check_route(tgen.gears["r3"], "show ip route %s json" % prefix, prefix,
- "", expect_installed=False)
+ res = check_route(
+ tgen.gears["r3"],
+ "show ip route %s json" % prefix,
+ prefix,
+ "",
+ expect_installed=False,
+ )
assert res is True, res
+
def test_bgp_srv6_sid_export():
"""
Enable sid export explicit on R1 and recheck prefixes 10.0.0.1-3/32 srv6 encap.
@@ -496,23 +554,44 @@ def test_bgp_srv6_sid_export():
res = get_unicast_sid("AFI_IP")
assert res is True, res
- logger.info("R1 sid[AFI_IP]: %s, R3 sid[AFI_IP]: %s" % (r1_unicast_sid, r3_unicast_sid))
+ logger.info(
+ "R1 sid[AFI_IP]: %s, R3 sid[AFI_IP]: %s" % (r1_unicast_sid, r3_unicast_sid)
+ )
logger.info("Check 10.0.0.1/32 sid %s installed on R2" % r1_unicast_sid)
- res = check_route(tgen.gears["r2"], "show ip route 10.0.0.1/32 json", "10.0.0.1/32", r1_unicast_sid)
+ res = check_route(
+ tgen.gears["r2"],
+ "show ip route 10.0.0.1/32 json",
+ "10.0.0.1/32",
+ r1_unicast_sid,
+ )
assert res is True, res
logger.info("Check 10.0.0.1/32 sid %s installed on R3" % r1_unicast_sid)
- res = check_route(tgen.gears["r3"], "show ip route 10.0.0.1/32 json", "10.0.0.1/32", r1_unicast_sid)
+ res = check_route(
+ tgen.gears["r3"],
+ "show ip route 10.0.0.1/32 json",
+ "10.0.0.1/32",
+ r1_unicast_sid,
+ )
assert res is True, res
-
logger.info("Check 10.0.0.3/32 sid %s installed on R2" % r3_unicast_sid)
- res = check_route(tgen.gears["r2"], "show ip route 10.0.0.3/32 json", "10.0.0.3/32", r3_unicast_sid)
+ res = check_route(
+ tgen.gears["r2"],
+ "show ip route 10.0.0.3/32 json",
+ "10.0.0.3/32",
+ r3_unicast_sid,
+ )
assert res is True, res
logger.info("Check 10.0.0.3/32 sid %s installed on R1" % r3_unicast_sid)
- res = check_route(tgen.gears["r1"], "show ip route 10.0.0.3/32 json", "10.0.0.3/32", r3_unicast_sid)
+ res = check_route(
+ tgen.gears["r1"],
+ "show ip route 10.0.0.3/32 json",
+ "10.0.0.3/32",
+ r3_unicast_sid,
+ )
assert res is True, res
@@ -541,37 +620,57 @@ def test_bgp_srv6_sid_v6_update():
res = get_unicast_sid("AFI_IP6")
assert res is True, res
- logger.info("R1 sid[AFI_IP6]: %s, R3 sid[AFI_IP6]: %s" % (r1_unicast_sid, r3_unicast_sid))
+ logger.info(
+ "R1 sid[AFI_IP6]: %s, R3 sid[AFI_IP6]: %s" % (r1_unicast_sid, r3_unicast_sid)
+ )
logger.info("Check fd00:200::/64 sid %s installed on R2" % r1_unicast_sid)
- res = check_route(tgen.gears["r2"], "show ipv6 route fd00:200::/64 json",
- "fd00:200::/64", r1_unicast_sid)
+ res = check_route(
+ tgen.gears["r2"],
+ "show ipv6 route fd00:200::/64 json",
+ "fd00:200::/64",
+ r1_unicast_sid,
+ )
assert res is True, res
logger.info("Check fd00:200::/64 sid %s installed on R3" % r1_unicast_sid)
- res = check_route(tgen.gears["r3"], "show ipv6 route fd00:200::/64 json",
- "fd00:200::/64", r1_unicast_sid)
+ res = check_route(
+ tgen.gears["r3"],
+ "show ipv6 route fd00:200::/64 json",
+ "fd00:200::/64",
+ r1_unicast_sid,
+ )
assert res is True, res
logger.info("Check fd00:300::/64 sid %s installed on R1" % r3_unicast_sid)
- res = check_route(tgen.gears["r1"], "show ipv6 route fd00:300::/64 json",
- "fd00:300::/64", r3_unicast_sid)
+ res = check_route(
+ tgen.gears["r1"],
+ "show ipv6 route fd00:300::/64 json",
+ "fd00:300::/64",
+ r3_unicast_sid,
+ )
assert res is True, res
logger.info("Check fd00:300::/64 sid %s installed on R2" % r3_unicast_sid)
- res = check_route(tgen.gears["r2"], "show ipv6 route fd00:300::/64 json",
- "fd00:300::/64", r3_unicast_sid)
+ res = check_route(
+ tgen.gears["r2"],
+ "show ipv6 route fd00:300::/64 json",
+ "fd00:300::/64",
+ r3_unicast_sid,
+ )
assert res is True, res
logger.info("Check fd00:200::/64 sid %s is not installed on R4" % r1_unicast_sid)
- res = check_route(tgen.gears["r4"], "show ipv6 route fd00:200::/64 json",
- "fd00:200::/64", "")
+ res = check_route(
+ tgen.gears["r4"], "show ipv6 route fd00:200::/64 json", "fd00:200::/64", ""
+ )
assert res is True, res
logger.info("Check fd00:300::/64 sid %s is not installed on R4" % r3_unicast_sid)
- res = check_route(tgen.gears["r4"], "show ipv6 route fd00:300::/64 json",
- "fd00:300::/64", "")
+ res = check_route(
+ tgen.gears["r4"], "show ipv6 route fd00:300::/64 json", "fd00:300::/64", ""
+ )
assert res is True, res
@@ -608,23 +707,43 @@ def test_srv6_withdraw():
)
logger.info("Check 10.0.0.1/32 is withdrawn on R3")
- res = check_route(tgen.gears["r3"], "show ip route 10.0.0.1/32 json",
- "10.0.0.1/32", r1_unicast_sid, expect_installed=False)
+ res = check_route(
+ tgen.gears["r3"],
+ "show ip route 10.0.0.1/32 json",
+ "10.0.0.1/32",
+ r1_unicast_sid,
+ expect_installed=False,
+ )
assert res is True, res
logger.info("Check 10.0.0.3/32 is withdrawn on R2")
- res = check_route(tgen.gears["r2"], "show ip route 10.0.0.3/32 json",
- "10.0.0.3/32", r3_unicast_sid, expect_installed=False)
+ res = check_route(
+ tgen.gears["r2"],
+ "show ip route 10.0.0.3/32 json",
+ "10.0.0.3/32",
+ r3_unicast_sid,
+ expect_installed=False,
+ )
assert res is True, res
logger.info("Check fd00:200::/64 is withdrawn on R3")
- res = check_route(tgen.gears["r3"], "show ipv6 route fd00:200::/64 json",
- "fd00:200::/64", r1_unicast_sid, expect_installed=False)
+ res = check_route(
+ tgen.gears["r3"],
+ "show ipv6 route fd00:200::/64 json",
+ "fd00:200::/64",
+ r1_unicast_sid,
+ expect_installed=False,
+ )
assert res is True, res
logger.info("Check fd00:300::/64 is withdrawn on R2")
- res = check_route(tgen.gears["r2"], "show ipv6 route fd00:300::/64 json",
- "fd00:300::/64", r3_unicast_sid, expect_installed=False)
+ res = check_route(
+ tgen.gears["r2"],
+ "show ipv6 route fd00:300::/64 json",
+ "fd00:300::/64",
+ r3_unicast_sid,
+ expect_installed=False,
+ )
assert res is True, res
@@ -896,17 +1015,24 @@ def test_bgp_srv6_sid_dt46_disable_ipv4():
assert res is True, res
logger.info("Check 10.0.0.1/32 sid %s installed on R2" % r1_sid_v4)
- res = check_route(tgen.gears["r2"], "show ip route 10.0.0.1/32 json",
- "10.0.0.1/32", r1_sid_v4)
+ res = check_route(
+ tgen.gears["r2"], "show ip route 10.0.0.1/32 json", "10.0.0.1/32", r1_sid_v4
+ )
assert res is True, res
- logger.info("Check R1 SID %s still has behavior End.DT46 (IPv6 unaffected)" % r1_sid_v6)
+ logger.info(
+ "Check R1 SID %s still has behavior End.DT46 (IPv6 unaffected)" % r1_sid_v6
+ )
res = check_srv6_localsid_behavior(tgen.gears["r1"], r1_sid_v6, "End.DT46")
assert res is True, res
logger.info("Check fd00:200::/64 sid %s still installed on R3" % r1_sid_v6)
- res = check_route(tgen.gears["r3"], "show ipv6 route fd00:200::/64 json",
- "fd00:200::/64", r1_sid_v6)
+ res = check_route(
+ tgen.gears["r3"],
+ "show ipv6 route fd00:200::/64 json",
+ "fd00:200::/64",
+ r1_sid_v6,
+ )
assert res is True, res
logger.info("Check connectivity c1 -> c2 (IPv4)")
@@ -955,17 +1081,24 @@ def test_bgp_srv6_sid_dt46_disable_ipv6():
assert res is True, res
logger.info("Check fd00:200::/64 sid %s installed on R3" % r1_sid_v6)
- res = check_route(tgen.gears["r3"], "show ipv6 route fd00:200::/64 json",
- "fd00:200::/64", r1_sid_v6)
+ res = check_route(
+ tgen.gears["r3"],
+ "show ipv6 route fd00:200::/64 json",
+ "fd00:200::/64",
+ r1_sid_v6,
+ )
assert res is True, res
- logger.info("Check R1 SID %s still has behavior End.DT4 (IPv4 unaffected)" % r1_sid_v4)
+ logger.info(
+ "Check R1 SID %s still has behavior End.DT4 (IPv4 unaffected)" % r1_sid_v4
+ )
res = check_srv6_localsid_behavior(tgen.gears["r1"], r1_sid_v4, "End.DT4")
assert res is True, res
logger.info("Check 10.0.0.1/32 sid %s still installed on R2" % r1_sid_v4)
- res = check_route(tgen.gears["r2"], "show ip route 10.0.0.1/32 json",
- "10.0.0.1/32", r1_sid_v4)
+ res = check_route(
+ tgen.gears["r2"], "show ip route 10.0.0.1/32 json", "10.0.0.1/32", r1_sid_v4
+ )
assert res is True, res
logger.info("Check connectivity c1 -> c2 (IPv4)")
@@ -1091,13 +1224,13 @@ def test_bgp_srv6_locator_reapply():
res = check_route(r3, "show ip route 10.0.0.1/32 json", "10.0.0.1/32", ipv4_sid)
assert res is True, res
- res = check_route(r3, "show ipv6 route fd00:200::/64 json", "fd00:200::/64", ipv6_sid)
+ res = check_route(
+ r3, "show ipv6 route fd00:200::/64 json", "fd00:200::/64", ipv6_sid
+ )
assert res is True, res
table_versions_before = {
- afi: r1.vtysh_cmd("show bgp %s unicast json" % afi, isjson=True)[
- "tableVersion"
- ]
+ afi: r1.vtysh_cmd("show bgp %s unicast json" % afi, isjson=True)["tableVersion"]
for afi in ("ipv4", "ipv6")
}
@@ -1112,9 +1245,7 @@ def test_bgp_srv6_locator_reapply():
)
table_versions_after = {
- afi: r1.vtysh_cmd("show bgp %s unicast json" % afi, isjson=True)[
- "tableVersion"
- ]
+ afi: r1.vtysh_cmd("show bgp %s unicast json" % afi, isjson=True)["tableVersion"]
for afi in ("ipv4", "ipv6")
}
assert table_versions_after == table_versions_before, (
@@ -1131,9 +1262,12 @@ def test_bgp_srv6_locator_reapply():
res = check_route(r3, "show ip route 10.0.0.1/32 json", "10.0.0.1/32", ipv4_sid)
assert res is True, res
- res = check_route(r3, "show ipv6 route fd00:200::/64 json", "fd00:200::/64", ipv6_sid)
+ res = check_route(
+ r3, "show ipv6 route fd00:200::/64 json", "fd00:200::/64", ipv6_sid
+ )
assert res is True, res
+
def test_bgp_srv6_no_locator():
"""
Delete the SRv6 locator on R1 with 'no locator default' and verify that:
@@ -1169,14 +1303,26 @@ def test_bgp_srv6_no_locator():
r1_ipv6_unicast_sid = r1_unicast_sid
logger.info("R1 sid[AFI_IP6] before no locator: %s" % r1_ipv6_unicast_sid)
- logger.info("Check 10.0.0.1/32 with SRv6 SID %s is installed on R3" % r1_ipv4_unicast_sid)
- res = check_route(tgen.gears["r3"], "show ip route 10.0.0.1/32 json",
- "10.0.0.1/32", r1_ipv4_unicast_sid)
+ logger.info(
+ "Check 10.0.0.1/32 with SRv6 SID %s is installed on R3" % r1_ipv4_unicast_sid
+ )
+ res = check_route(
+ tgen.gears["r3"],
+ "show ip route 10.0.0.1/32 json",
+ "10.0.0.1/32",
+ r1_ipv4_unicast_sid,
+ )
assert res is True, res
- logger.info("Check fd00:200::/64 with SRv6 SID %s is installed on R3" % r1_ipv6_unicast_sid)
- res = check_route(tgen.gears["r3"], "show ipv6 route fd00:200::/64 json",
- "fd00:200::/64", r1_ipv6_unicast_sid)
+ logger.info(
+ "Check fd00:200::/64 with SRv6 SID %s is installed on R3" % r1_ipv6_unicast_sid
+ )
+ res = check_route(
+ tgen.gears["r3"],
+ "show ipv6 route fd00:200::/64 json",
+ "fd00:200::/64",
+ r1_ipv6_unicast_sid,
+ )
assert res is True, res
logger.info("Issue 'no locator default' on R1")
@@ -1199,18 +1345,29 @@ def test_bgp_srv6_no_locator():
assert res is True, res
logger.info("Check 10.0.0.1/32 is withdrawn from R3 (strict encap-srv6 peer)")
- res = check_route(tgen.gears["r3"], "show ip route 10.0.0.1/32 json",
- "10.0.0.1/32", r1_ipv4_unicast_sid, expect_installed=False)
+ res = check_route(
+ tgen.gears["r3"],
+ "show ip route 10.0.0.1/32 json",
+ "10.0.0.1/32",
+ r1_ipv4_unicast_sid,
+ expect_installed=False,
+ )
assert res is True, res
logger.info("Check fd00:200::/64 is withdrawn from R3 (strict encap-srv6 peer)")
- res = check_route(tgen.gears["r3"], "show ipv6 route fd00:200::/64 json",
- "fd00:200::/64", r1_ipv6_unicast_sid, expect_installed=False)
+ res = check_route(
+ tgen.gears["r3"],
+ "show ipv6 route fd00:200::/64 json",
+ "fd00:200::/64",
+ r1_ipv6_unicast_sid,
+ expect_installed=False,
+ )
assert res is True, res
logger.info("Check 10.0.0.1/32 on R2 has no SRv6 encap (encap-srv6-relax peer)")
- res = check_route(tgen.gears["r2"], "show ip route 10.0.0.1/32 json",
- "10.0.0.1/32", "")
+ res = check_route(
+ tgen.gears["r2"], "show ip route 10.0.0.1/32 json", "10.0.0.1/32", ""
+ )
assert res is True, res
# Re-add the locator and verify SIDs are re-allocated and routes re-announced.
@@ -1232,14 +1389,26 @@ def test_bgp_srv6_no_locator():
r1_ipv4_unicast_sid = r1_unicast_sid
logger.info("R1 sid[AFI_IP] after re-add: %s" % r1_ipv4_unicast_sid)
- logger.info("Check 10.0.0.1/32 with new SID %s is installed on R3" % r1_ipv4_unicast_sid)
- res = check_route(tgen.gears["r3"], "show ip route 10.0.0.1/32 json",
- "10.0.0.1/32", r1_ipv4_unicast_sid)
+ logger.info(
+ "Check 10.0.0.1/32 with new SID %s is installed on R3" % r1_ipv4_unicast_sid
+ )
+ res = check_route(
+ tgen.gears["r3"],
+ "show ip route 10.0.0.1/32 json",
+ "10.0.0.1/32",
+ r1_ipv4_unicast_sid,
+ )
assert res is True, res
- logger.info("Check 10.0.0.1/32 with new SID %s is installed on R2" % r1_ipv4_unicast_sid)
- res = check_route(tgen.gears["r2"], "show ip route 10.0.0.1/32 json",
- "10.0.0.1/32", r1_ipv4_unicast_sid)
+ logger.info(
+ "Check 10.0.0.1/32 with new SID %s is installed on R2" % r1_ipv4_unicast_sid
+ )
+ res = check_route(
+ tgen.gears["r2"],
+ "show ip route 10.0.0.1/32 json",
+ "10.0.0.1/32",
+ r1_ipv4_unicast_sid,
+ )
assert res is True, res
logger.info("Wait for R1 GRT unicast SID[AFI_IP6] to be re-allocated")
@@ -1248,14 +1417,26 @@ def test_bgp_srv6_no_locator():
r1_ipv6_unicast_sid = r1_unicast_sid
logger.info("R1 sid[AFI_IP6] after re-add: %s" % r1_ipv6_unicast_sid)
- logger.info("Check fd00:200::/64 with new SID %s is installed on R3" % r1_ipv6_unicast_sid)
- res = check_route(tgen.gears["r3"], "show ipv6 route fd00:200::/64 json",
- "fd00:200::/64", r1_ipv6_unicast_sid)
+ logger.info(
+ "Check fd00:200::/64 with new SID %s is installed on R3" % r1_ipv6_unicast_sid
+ )
+ res = check_route(
+ tgen.gears["r3"],
+ "show ipv6 route fd00:200::/64 json",
+ "fd00:200::/64",
+ r1_ipv6_unicast_sid,
+ )
assert res is True, res
- logger.info("Check fd00:200::/64 with new SID %s is installed on R2" % r1_ipv6_unicast_sid)
- res = check_route(tgen.gears["r2"], "show ipv6 route fd00:200::/64 json",
- "fd00:200::/64", r1_ipv6_unicast_sid)
+ logger.info(
+ "Check fd00:200::/64 with new SID %s is installed on R2" % r1_ipv6_unicast_sid
+ )
+ res = check_route(
+ tgen.gears["r2"],
+ "show ipv6 route fd00:200::/64 json",
+ "fd00:200::/64",
+ r1_ipv6_unicast_sid,
+ )
assert res is True, res