summaryrefslogtreecommitdiff
path: root/tests/topotests/static_srv6_sids/test_static_srv6_sids.py
diff options
context:
space:
mode:
authorDonatas Abraitis <donatas@opensourcerouting.org>2025-03-24 14:16:37 +0200
committerGitHub <noreply@github.com>2025-03-24 14:16:37 +0200
commit927e2a9c81b638c035a834a3c5c693c93e7bfce7 (patch)
treee3754db54c58a69eebba1befd09a959d58916c9c /tests/topotests/static_srv6_sids/test_static_srv6_sids.py
parent073a670ed756d98460821edbf850d89c8ba663b1 (diff)
parent23403e01a3ece0b206bc8acf36c08b4bb538cb79 (diff)
Merge pull request #18467 from cscarpitta/fix/fix_srv6_static_sids_crash_2
staticd: Fix a crash that occurs when modifying an SRv6 SID
Diffstat (limited to 'tests/topotests/static_srv6_sids/test_static_srv6_sids.py')
-rwxr-xr-xtests/topotests/static_srv6_sids/test_static_srv6_sids.py38
1 files changed, 38 insertions, 0 deletions
diff --git a/tests/topotests/static_srv6_sids/test_static_srv6_sids.py b/tests/topotests/static_srv6_sids/test_static_srv6_sids.py
index 565b38f625..1ea94c8c07 100755
--- a/tests/topotests/static_srv6_sids/test_static_srv6_sids.py
+++ b/tests/topotests/static_srv6_sids/test_static_srv6_sids.py
@@ -172,6 +172,44 @@ def test_srv6_static_sids_sid_readd():
check_srv6_static_sids(router, "expected_srv6_sids.json")
+def test_srv6_static_sids_sid_modify():
+ """
+ Modify the static SIDs and verify the routing table
+ """
+ tgen = get_topogen()
+ if tgen.routers_have_failure():
+ pytest.skip(tgen.errors)
+ router = tgen.gears["r1"]
+
+ def _check_srv6_static_sids(router, expected_route_file):
+ logger.info("checking zebra srv6 static sids")
+ output = json.loads(router.vtysh_cmd("show ipv6 route static json"))
+ expected = open_json_file("{}/{}".format(CWD, expected_route_file))
+ return topotest.json_cmp(output, expected)
+
+ def check_srv6_static_sids(router, expected_file):
+ func = functools.partial(_check_srv6_static_sids, router, expected_file)
+ _, result = topotest.run_and_expect(func, None, count=15, wait=1)
+ assert result is None, "Failed"
+
+ router.vtysh_cmd(
+ """
+ configure terminal
+ segment-routing
+ srv6
+ static-sids
+ sid fcbb:bbbb:1:fe20::/64 locator MAIN behavior uDT46 vrf Vrf40
+ """
+ )
+
+ # FOR DEVELOPER:
+ # If you want to stop some specific line and start interactive shell,
+ # please use tgen.mininet_cli() to start it.
+
+ logger.info("Test for srv6 sids configuration")
+ check_srv6_static_sids(router, "expected_srv6_sids_sid_modify.json")
+
+
def test_srv6_static_sids_sid_delete_all():
"""
Remove all static SIDs and verify they get removed