Skip to content

Comments

[DT2] Improve test infra to support BGP confederation#22417

Open
bingwang-ms wants to merge 4 commits intosonic-net:masterfrom
bingwang-ms:bgp_confed_support
Open

[DT2] Improve test infra to support BGP confederation#22417
bingwang-ms wants to merge 4 commits intosonic-net:masterfrom
bingwang-ms:bgp_confed_support

Conversation

@bingwang-ms
Copy link
Collaborator

@bingwang-ms bingwang-ms commented Feb 14, 2026

Description of PR

Summary:
Fixes # (issue)
This PR is to improve test infra to support BGP confederation on LT2/FT2/UT2.
Changes include

  • Update topology definition to support BGP confederation
  • Update BGP library to support parsing BGP confederation from topology definition
  • Update golden configuration generation to support generating BGP confederation configuration in golden_config_db.json
  • Update Ansible playbook to support new parameters for generating golden configuration

Type of change

  • Bug fix
  • Testbed and Framework(new/improvement)
  • New Test case
    • Skipped for non-supported platforms
  • Test case improvement

Back port request

  • 202205
  • 202305
  • 202311
  • 202405
  • 202411
  • 202505
  • 202511

Approach

What is the motivation for this PR?

This PR is to improve test infra to support BGP confederation on LT2/FT2/UT2.

How did you do it?

  • Update topology definition to support BGP confederation
  • Update BGP library to support parsing BGP confederation from topology definition
  • Update golden configuration generation to support generating BGP confederation configuration in golden_config_db.json
  • Update Ansible playbook to support new parameters for generating golden configuration

How did you verify/test it?

The change is verified in internal regression test pipeline.

Any platform specific information?

No.

Supported testbed topology if it's a new test case?

Not a new test.

Documentation

bingwang-ms and others added 2 commits February 14, 2026 00:34
…nfed

Merged PR 16507: [Disagg T2] Test infra changes for BGP confed

This pull request implements test infrastructure changes to enable BGP confederation support for disaggregated T2 devices.

The pull request updates Ansible modules, templates, and topology configurations to incorporate BGP confederation parameters and support a new ut2 device configuration. Key changes include:
- `ansible/library/generate_golden_config_db.py`: Added the `generate_ut2_golden_config_db` method and adjusted config generation logic based on topology names.
- `ansible/library/topo_facts.py`: Modified the BGP peer extraction to use a new `peer_in_bgp_confed` flag and select the appropriate ASN.
- `ansible/roles/eos/templates/t2-leaf.j2` and `t1-lag-spine.j2`: Updated templates to conditionally include BGP confederation identifier and peer settings.
- Topology YAML files (e.g., `ansible/vars/topo_lt2-p32o64.yml` and `ansible/vars/topo_t2_single_node_max.yml`): Revised ASNs and introduced confederation parameters (`confed_asn`, `confed_peers`) along with the `peer_in_bgp_confed` flag.
- `ansible/config_sonic_basedon_testbed.yml`: Added the `num_asics` parameter to support configurations for devices with multiple ASICs.
<!-- GitOpsUserAgent=GitOps.Apps.Server.pullrequestcopilot -->

----
This pull request implements test infrastructure changes to support BGP confederation in disaggregated T2 and related platforms.

The PR enhances golden configuration generation, device templates, and test utilities to include BGP confederation settings by introducing new parameters and logic for processing BGP confederation ASN and peers.
- **`ansible/library/generate_golden_config_db.py`**: Adds a new function for UT2 devices and updates existing functions to incorporate `bgp_confd_asn` and `bgp_confd_peers` for embedding BGP confederation configurations into the golden config JSON.
- **`ansible/config_sonic_basedon_testbed.yml`**: Updates playbook tasks to pass new BGP confed parameters and copy necessary templates and profile files for t2 devices.
- **EOS Templates (`ansible/roles/eos/templates/*.j2`)**: Modifies multiple device templates to conditionally render BGP confederation settings when related parameters are defined.
- **BGP Test and Helper Modules**: Updates in files such as `tests/common/helpers/bgp.py`, `ansible/library/bgp_facts.py`, `ansible/library/topo_facts.py`, and route checkers adjust parsing and validation logic to correctly handle confederation peers.

Signed-off-by: bingwang <bingwang@microsoft.com>
Signed-off-by: bingwang <bingwang@microsoft.com>
@mssonicbld
Copy link
Collaborator

/azp run

@azure-pipelines
Copy link

Azure Pipelines successfully started running 1 pipeline(s).

@bingwang-ms bingwang-ms changed the title [DT2] Improve test infra changes for BGP confederation [DT2] Improve test infra to support BGP confederation Feb 14, 2026
@bingwang-ms
Copy link
Collaborator Author

PR for 202503 Azure/sonic-mgmt.msft#1034

@mssonicbld
Copy link
Collaborator

/azp run

@azure-pipelines
Copy link

Azure Pipelines successfully started running 1 pipeline(s).

@mssonicbld
Copy link
Collaborator

/azp run

@azure-pipelines
Copy link

Azure Pipelines successfully started running 1 pipeline(s).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants