[action] [PR:23347] [bgp/agg]: Add BGP aggregate address test cases for Config Persistence and Recovery - #1178
Merged
Conversation
…e and Recovery
### Description of PR
Summary:
Add new test file `test_bgp_aggregate_address_resilience.py` (Test Group 5) that validates BGP aggregate-address configuration persistence and recovery across various disruption scenarios. These 5 new test cases verify that aggregate address configuration written via GCU survives BGP container restarts, config reloads, cold reboots, warm reboots, and BBR state transitions.
ADO: 37526899
New test cases:
- **TC 5.1** `test_aggregate_persists_bgp_container_restart`: Aggregate config survives BGP container restart; CONFIG_DB + STATE_DB + FRR are consistent after recovery.
- **TC 5.2** `test_aggregate_persists_config_reload`: Aggregate config (with summary-only=true) survives config save + config reload.
- **TC 5.3** `test_aggregate_persists_config_save_and_reboot`: IPv6 aggregate config survives config save + cold reboot.
- **TC 5.4** `test_aggregate_bbr_required_inactive_persists_bgp_restart`: BBR-required aggregate stays inactive after BGP restart when BBR is disabled; activates once BBR is enabled.
- **TC 5.5** `test_aggregate_persists_warm_reboot`: Aggregate config survives warm reboot.
### Type of change
- [ ] Bug fix
- [ ] Testbed and Framework(new/improvement)
- [x] New Test case
- [x] 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?
Existing BGP aggregate-address tests cover configuration validation and route propagation behavior, but there are no tests verifying that aggregate address configuration persists across operational disruptions such as BGP container restarts, config reloads, and device reboots. This PR fills that gap by adding resilience tests that validate CONFIG_DB, STATE_DB, and FRR running-config consistency after each disruption type.
#### How did you do it?
- Created `test_bgp_aggregate_address_resilience.py` reusing existing helpers and fixtures from `test_bgp_aggregate_address.py` (`AggregateCfg`, `gcu_add_aggregate`, `gcu_remove_aggregate`, `verify_bgp_aggregate_consistence`, `verify_bgp_aggregate_cleanup`, `dump_db`, and the `setup_teardown` checkpoint/rollback fixture).
- Added a `bgp_neighbors` fixture to discover BGP neighbor IPs for session-state polling after disruptions.
- Pre-disruption verification only checks CONFIG_DB (GCU write is synchronous). Post-disruption verification checks the full stack (CONFIG_DB + STATE_DB + FRR) after bgpcfgd has re-processed the config.
- Added `wait_for_aggregate_state()` helper to handle the asynchronous bgpcfgd STATE_DB population after disruptions.
- All test cases include proper cleanup in `finally` blocks with graceful fallback to checkpoint rollback.
#### How did you verify/test it?
Ran all test cases on a physical m1-48 testbed with Arista EOS neighbors.
<img width="735" height="274" alt="image" src="https://github.com/user-attachments/assets/2ce20c22-740f-4050-8e71-2ea710d0cb75" />
#### Any platform specific information?
No platform-specific dependencies. Tests use GCU for configuration and standard SONiC reboot/reload utilities, which are platform-agnostic.
#### Supported testbed topology if it's a new test case?
t1, m1 (declared via `@pytest.mark.topology("t1", "m1")`)
### Documentation
Aligned with [BGP-Aggregate-Address test plan](https://github.com/sonic-net/sonic-mgmt/blob/master/docs/testplan/BGP-Aggregate-Address.md)
Signed-off-by: Sonic Build Admin <sonicbld@microsoft.com>
Collaborator
Author
|
Original PR: sonic-net/sonic-mgmt#23347 |
Collaborator
Author
|
/azp run |
|
Azure Pipelines could not run because the pipeline triggers exclude this branch/path. |
12 tasks
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
Summary:
Add new test file
test_bgp_aggregate_address_resilience.py(Test Group 5) that validates BGP aggregate-address configuration persistence and recovery across various disruption scenarios. These 5 new test cases verify that aggregate address configuration written via GCU survives BGP container restarts, config reloads, cold reboots, warm reboots, and BBR state transitions.ADO: 37526899
New test cases:
test_aggregate_persists_bgp_container_restart: Aggregate config survives BGP container restart; CONFIG_DB + STATE_DB + FRR are consistent after recovery.test_aggregate_persists_config_reload: Aggregate config (with summary-only=true) survives config save + config reload.test_aggregate_persists_config_save_and_reboot: IPv6 aggregate config survives config save + cold reboot.test_aggregate_bbr_required_inactive_persists_bgp_restart: BBR-required aggregate stays inactive after BGP restart when BBR is disabled; activates once BBR is enabled.test_aggregate_persists_warm_reboot: Aggregate config survives warm reboot.Type of change
Back port request
Approach
What is the motivation for this PR?
Existing BGP aggregate-address tests cover configuration validation and route propagation behavior, but there are no tests verifying that aggregate address configuration persists across operational disruptions such as BGP container restarts, config reloads, and device reboots. This PR fills that gap by adding resilience tests that validate CONFIG_DB, STATE_DB, and FRR running-config consistency after each disruption type.
How did you do it?
test_bgp_aggregate_address_resilience.pyreusing existing helpers and fixtures fromtest_bgp_aggregate_address.py(AggregateCfg,gcu_add_aggregate,gcu_remove_aggregate,verify_bgp_aggregate_consistence,verify_bgp_aggregate_cleanup,dump_db, and thesetup_teardowncheckpoint/rollback fixture).bgp_neighborsfixture to discover BGP neighbor IPs for session-state polling after disruptions.wait_for_aggregate_state()helper to handle the asynchronous bgpcfgd STATE_DB population after disruptions.finallyblocks with graceful fallback to checkpoint rollback.How did you verify/test it?
Ran all test cases on a physical m1-48 testbed with Arista EOS neighbors.

Any platform specific information?
No platform-specific dependencies. Tests use GCU for configuration and standard SONiC reboot/reload utilities, which are platform-agnostic.
Supported testbed topology if it's a new test case?
t1, m1 (declared via
@pytest.mark.topology("t1", "m1"))Documentation
Aligned with BGP-Aggregate-Address test plan
Signed-off-by: Sonic Build Admin sonicbld@microsoft.com