Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 16 additions & 5 deletions tests/topotests/bgp_srv6_unicast/test_bgp_srv6_unicast.py
Original file line number Diff line number Diff line change
Expand Up @@ -122,6 +122,9 @@ def check_route(router, cmd, expect_route, expect_sid, expect_installed=True):
return "route is installed on %s" % router.name

route = route[0]
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:
Expand Down Expand Up @@ -264,12 +267,20 @@ def test_bgp_srv6_sid_unexport():
no sid export auto
"""
)
prefixes = ["10.0.0.1/32", "10.0.0.3/32"]
logger.info("Check 10.0.0.1/32 is installed without SRv6 SID on R2")
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

logger.info("Check 10.0.0.1/32 and 10.0.0.3/32 are installed on R2")
for prefix in prefixes:
res = check_route(tgen.gears["r2"], "show ip route %s json" % prefix, prefix, "")
assert res is True, res
logger.info("Check 10.0.0.3/32 keeps SRv6 SID from R3 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,
)
assert res is True, res

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")
Expand Down
Loading