Skip to content

Add confd integration tests for BGPFilter#12142

Open
song-jiang wants to merge 2 commits intoprojectcalico:masterfrom
song-jiang:song-bgpfilter-confd-ut
Open

Add confd integration tests for BGPFilter#12142
song-jiang wants to merge 2 commits intoprojectcalico:masterfrom
song-jiang:song-bgpfilter-confd-ut

Conversation

@song-jiang
Copy link
Member

@song-jiang song-jiang commented Mar 16, 2026

Summary

  • Add confd compiled template test fixtures for BGPFilter covering: AS path + priority,
    communities + operations, kubevirt live migration, large communities, and peer type scenarios
  • Address review markups from PR Enhance BGPFilter API with new match criteria and route operations #12002: simplify BGPFilterBIRDFuncs doc comment,
    inline emitFilterRules, and deduplicate import/export logic with a direction loop

Release note:

TBD

@song-jiang song-jiang requested a review from a team as a code owner March 16, 2026 16:09
Copilot AI review requested due to automatic review settings March 16, 2026 16:09
@marvin-tigera marvin-tigera added this to the Calico v3.32.0 milestone Mar 16, 2026
@marvin-tigera marvin-tigera added release-note-required Change has user-facing impact (no matter how small) docs-pr-required Change is not yet documented labels Mar 16, 2026
@song-jiang song-jiang added docs-not-required Docs not required for this change release-note-not-required Change has no user-facing impact labels Mar 16, 2026
@marvin-tigera marvin-tigera removed release-note-required Change has user-facing impact (no matter how small) docs-pr-required Change is not yet documented labels Mar 16, 2026
@song-jiang song-jiang changed the title [WIP]Added Confd UT for bgpFilter Add confd integration tests for BGPFilter Mar 16, 2026
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds new confd test-suite coverage for additional BGPFilter match/operation combinations (communities, large communities, AS-path, priority, PeerType) and a KubeVirt live migration scenario, along with the corresponding expected compiled BIRD configs. Also refactors BGP filter BIRD function generation to reduce repeated import/export logic.

Changes:

  • Add new test_bgp_filters sub-tests covering communities+operations, peerType, AS path+priority, large communities, and a KubeVirt live-migration scenario.
  • Add expected compiled template outputs for the new bgpfilter scenarios.
  • Refactor BGPFilterBIRDFuncs generation logic to unify import/export processing and inline rule emission.

Reviewed changes

Copilot reviewed 32 out of 32 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
confd/tests/test_suite_common.sh Adds new bgpfilter-related test cases and wires them into the existing test_bgp_filters suite.
confd/pkg/resource/template/template_funcs.go Refactors BGPFilter BIRD function generation to reduce duplication and centralize rule emission logic.
confd/tests/compiled_templates/bgpfilter/peer_type/bird.cfg Adds expected BIRD v4 output for peerType rules test.
confd/tests/compiled_templates/bgpfilter/peer_type/bird6.cfg Adds expected BIRD v6 output for peerType rules test.
confd/tests/compiled_templates/bgpfilter/peer_type/bird_aggr.cfg Adds expected aggregation config for peerType scenario (v4).
confd/tests/compiled_templates/bgpfilter/peer_type/bird6_aggr.cfg Adds expected aggregation config for peerType scenario (v6).
confd/tests/compiled_templates/bgpfilter/peer_type/bird_ipam.cfg Adds expected IPAM config for peerType scenario (v4).
confd/tests/compiled_templates/bgpfilter/peer_type/bird6_ipam.cfg Adds expected IPAM config for peerType scenario (v6).
confd/tests/compiled_templates/bgpfilter/large_community/bird.cfg Adds expected BIRD v4 output for large-community matching/ops.
confd/tests/compiled_templates/bgpfilter/large_community/bird6.cfg Adds expected BIRD v6 output for large-community matching/ops.
confd/tests/compiled_templates/bgpfilter/large_community/bird_aggr.cfg Adds expected aggregation config for large-community scenario (v4).
confd/tests/compiled_templates/bgpfilter/large_community/bird6_aggr.cfg Adds expected aggregation config for large-community scenario (v6).
confd/tests/compiled_templates/bgpfilter/large_community/bird_ipam.cfg Adds expected IPAM config for large-community scenario (v4).
confd/tests/compiled_templates/bgpfilter/large_community/bird6_ipam.cfg Adds expected IPAM config for large-community scenario (v6).
confd/tests/compiled_templates/bgpfilter/communities_and_operations/bird.cfg Adds expected BIRD v4 output for standard communities + operations.
confd/tests/compiled_templates/bgpfilter/communities_and_operations/bird6.cfg Adds expected BIRD v6 output for standard communities + operations.
confd/tests/compiled_templates/bgpfilter/communities_and_operations/bird_aggr.cfg Adds expected aggregation config for communities+ops scenario (v4).
confd/tests/compiled_templates/bgpfilter/communities_and_operations/bird6_aggr.cfg Adds expected aggregation config for communities+ops scenario (v6).
confd/tests/compiled_templates/bgpfilter/communities_and_operations/bird_ipam.cfg Adds expected IPAM config for communities+ops scenario (v4).
confd/tests/compiled_templates/bgpfilter/communities_and_operations/bird6_ipam.cfg Adds expected IPAM config for communities+ops scenario (v6).
confd/tests/compiled_templates/bgpfilter/as_path_and_priority/bird.cfg Adds expected BIRD v4 output for AS-path prefix + priority match/ops.
confd/tests/compiled_templates/bgpfilter/as_path_and_priority/bird6.cfg Adds expected BIRD v6 output for AS-path prefix + priority match/ops.
confd/tests/compiled_templates/bgpfilter/as_path_and_priority/bird_aggr.cfg Adds expected aggregation config for AS-path+priority scenario (v4).
confd/tests/compiled_templates/bgpfilter/as_path_and_priority/bird6_aggr.cfg Adds expected aggregation config for AS-path+priority scenario (v6).
confd/tests/compiled_templates/bgpfilter/as_path_and_priority/bird_ipam.cfg Adds expected IPAM config for AS-path+priority scenario (v4).
confd/tests/compiled_templates/bgpfilter/as_path_and_priority/bird6_ipam.cfg Adds expected IPAM config for AS-path+priority scenario (v6).
confd/tests/compiled_templates/bgpfilter/kubevirt_live_migration/bird.cfg Adds expected BIRD v4 output for KubeVirt live-migration bgpfilter behavior.
confd/tests/compiled_templates/bgpfilter/kubevirt_live_migration/bird6.cfg Adds expected BIRD v6 output for KubeVirt live-migration bgpfilter behavior.
confd/tests/compiled_templates/bgpfilter/kubevirt_live_migration/bird_aggr.cfg Adds expected aggregation config for KubeVirt live-migration scenario (v4).
confd/tests/compiled_templates/bgpfilter/kubevirt_live_migration/bird6_aggr.cfg Adds expected aggregation config for KubeVirt live-migration scenario (v6).
confd/tests/compiled_templates/bgpfilter/kubevirt_live_migration/bird_ipam.cfg Adds expected IPAM config for KubeVirt live-migration scenario (v4).
confd/tests/compiled_templates/bgpfilter/kubevirt_live_migration/bird6_ipam.cfg Adds expected IPAM config for KubeVirt live-migration scenario (v6).

You can also share your feedback on Copilot code review. Take the survey.

@song-jiang song-jiang changed the title Add confd integration tests for BGPFilter [WIP]Add confd integration tests for BGPFilter Mar 16, 2026
@song-jiang song-jiang changed the title [WIP]Add confd integration tests for BGPFilter Add confd integration tests for BGPFilter Mar 16, 2026
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
@song-jiang song-jiang force-pushed the song-bgpfilter-confd-ut branch from aa4d551 to 2ba9e70 Compare March 16, 2026 16:55
@song-jiang song-jiang requested a review from nelljerram March 16, 2026 17:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

docs-not-required Docs not required for this change release-note-not-required Change has no user-facing impact

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants