Add UpperRegionalHub BGP anchor-prefix and table-map tests - #26892
Open
narasim-microsoft wants to merge 1 commit into
Open
Add UpperRegionalHub BGP anchor-prefix and table-map tests#26892narasim-microsoft wants to merge 1 commit into
narasim-microsoft wants to merge 1 commit into
Conversation
Collaborator
|
/azp run |
|
Azure Pipelines: There may be pipelines that require an authorized user to comment /azp run to run. |
|
Azure Pipelines: Successfully started running 1 pipeline(s). |
| # Helpers | ||
| # ============================================================ | ||
|
|
||
| def get_anchor_community(duthost): |
| duthost.shell("docker exec bgp vtysh {}".format(cmd_args)) | ||
|
|
||
|
|
||
| def get_bgp_asn(duthost): |
Add three test files exercising the ANCHOR_PREFIX/SELECTIVE_ROUTE_DOWNLOAD table-map mechanism for the UpperRegionalHub device type, complementing the corresponding sonic-buildimage allowlist/table-map changes: - test_urh_anchor_prefix.py: end-to-end DUT-local verification of the ANCHOR_PREFIX CONFIG_DB -> BGP table-map -> community-tagged aggregate route pipeline for UpperRegionalHub. On topologies where the static minigraph-driven general/peer-group.conf.j2 template doesn't render (e.g. dynamic-neighbor KVM t0), falls back to applying the equivalent route-maps directly via vtysh so the underlying bgpcfgd production code path is still exercised end-to-end. - test_bgp_table_map.py: generic, parametrized FIB-filtering tests across multiple device types (UpperSpineRouter, UpperRegionalHub) validating that table-map suppression only removes routes from the FIB while the BGP RIB retains them. - test_bgp_table_map_device_type.py: device-type gating test confirming the table-map is rendered only for device types where it's expected (SpineRouter+UpstreamLC, UpperSpineRouter, UpperRegionalHub) and absent otherwise. These tests are topology-agnostic (t0, t1, t2, lrh, urh, any) and exercise the same bgpcfgd/PrefixListMgr and FRR template code paths introduced in sonic-buildimage PR #28893 (add UpperRegionalHub to the ANCHOR_PREFIX allowlist and SELECTIVE_ROUTE_DOWNLOAD table-map condition). Note: the UpperRegionalHub-specific paths in these tests depend on sonic-buildimage PR #28893 landing; until then, DUTs built from current master will not have gained ANCHOR_PREFIX/table-map support for this device type. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Signed-off-by: Narasimhan Ganapathiraman <narasimhang@microsoft.com>
narasim-microsoft
force-pushed
the
narasimhang/urh-anchor-prefix-tests
branch
from
August 7, 2026 22:36
2874e84 to
01049cb
Compare
Collaborator
|
/azp run |
|
Azure Pipelines: Successfully started running 1 pipeline(s). |
narasim-microsoft
marked this pull request as ready for review
August 7, 2026 22:38
|
Azure Pipelines: There may be pipelines that require an authorized user to comment /azp run to run. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description of PR
Adds three test files exercising the ANCHOR_PREFIX / SELECTIVE_ROUTE_DOWNLOAD table-map mechanism for the
UpperRegionalHubdevice type. These complement the sonic-buildimage code change in sonic-net/sonic-buildimage#28893 (addsUpperRegionalHubto the ANCHOR_PREFIX allowlist and SELECTIVE_ROUTE_DOWNLOAD table-map condition).tests/bgp/test_urh_anchor_prefix.py: end-to-end DUT-local verification of the ANCHOR_PREFIX CONFIG_DB -> BGP table-map -> community-tagged aggregate route pipeline forUpperRegionalHub. On topologies where the static minigraph-drivengeneral/peer-group.conf.j2template doesn't render (e.g. dynamic-neighbor KVM t0), falls back to applying the equivalent route-maps directly via vtysh so the underlying bgpcfgd production code path is still exercised end-to-end.tests/bgp/test_bgp_table_map.py: generic, parametrized FIB-filtering tests across multiple device types (UpperSpineRouter,UpperRegionalHub) validating that table-map suppression only removes routes from the FIB while the BGP RIB retains them.tests/bgp/test_bgp_table_map_device_type.py: device-type gating test confirming the table-map is rendered only for device types where it's expected (SpineRouter+UpstreamLC,UpperSpineRouter,UpperRegionalHub) and absent otherwise.These tests are topology-agnostic (
t0,t1,t2,lrh,urh,any).Depends on
UpperRegionalHub-specific paths in these tests depend on that PR landing; until it merges, DUTs built from currentmasterwill not have gained ANCHOR_PREFIX/table-map support for this device type, so those specific paths will not exercise the new behavior.How did you do it
Verified via flake8 (clean) and pytest
--collect-only(fails identically to pre-existing test files without a live--testbed/--testbed-file, confirming no import/collection issues specific to these new files).How did you verify/test it
Marking as draft pending: (1) sonic-buildimage#28893 merging, (2) a full run against a deployed KVM testbed with a
UpperRegionalHubDUT.