diff options
| author | Carmine Scarpitta <cscarpit@cisco.com> | 2025-04-08 14:53:26 +0200 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2025-04-08 14:53:26 +0200 |
| commit | 46a526568fc262334c4959bdff40f96e992b51d7 (patch) | |
| tree | 268243927252eb8f285bd9bcd1cd9d836461283d /tests | |
| parent | 5e092d0e25cad3227cbe54b5179d559d4f244285 (diff) | |
| parent | dbd9fed0b30dd1d3475686f71f87d326eeafd26c (diff) | |
Merge pull request #18580 from raja-rajasekar/rajasekarr/check_sid_loc_block_beforehand
staticd: Avoid requesting SRv6 sid from zebra when loc and sid block dont match
Diffstat (limited to 'tests')
| -rwxr-xr-x | tests/topotests/static_srv6_sids/test_static_srv6_sids.py | 30 |
1 files changed, 30 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 1ea94c8c07..abf49df046 100755 --- a/tests/topotests/static_srv6_sids/test_static_srv6_sids.py +++ b/tests/topotests/static_srv6_sids/test_static_srv6_sids.py @@ -210,6 +210,36 @@ def test_srv6_static_sids_sid_modify(): check_srv6_static_sids(router, "expected_srv6_sids_sid_modify.json") +def test_srv6_static_sids_wrong_sid_block(): + """ + The purpose of this test is to verify how FRR behaves when the user + provides an invalid configuration. + Add a new static Sid with a mismatch in locator and sid block + to make sure no Sid is allocated by zebra (TBD: Strict verify once show cmd + commit is merged (#16836)) + """ + router = get_topogen().gears["r1"] + router.vtysh_cmd( + """ + configure terminal + segment-routing + srv6 + locators + locator MAIN1 + prefix fcbb:1234:1::/48 block-len 32 node-len 16 func-bits 16 + srv6 + static-sids + sid fcbb:bbbb:1:fe50::/64 locator MAIN1 behavior uA interface sr0 nexthop 2001::3 + """ + ) + + output = json.loads(router.vtysh_cmd("show ipv6 route static json")) + if "fcbb:bbbb:1:fe50::/64" in output: + assert ( + False + ), "Failed. Expected no entry for fcbb:bbbb:1:fe50::/64 since loc and node block dont match" + + def test_srv6_static_sids_sid_delete_all(): """ Remove all static SIDs and verify they get removed |
