Skip to content

Add test implementation for BGP aggregate address with BBR awareness#6

Open
bpar9 wants to merge 2 commits into
masterfrom
devin/1768378303-bgp-aggregate-address-bbr-test
Open

Add test implementation for BGP aggregate address with BBR awareness#6
bpar9 wants to merge 2 commits into
masterfrom
devin/1768378303-bgp-aggregate-address-bbr-test

Conversation

@bpar9
Copy link
Copy Markdown
Owner

@bpar9 bpar9 commented Jan 14, 2026

Description of PR

Summary:
This PR adds pytest test implementation and a new testplan document for the BGP aggregate address with BBR (Bounce Back Routing) awareness feature.

The test file validates that aggregate addresses can be configured with the bbr_required flag, and that these addresses become active/inactive based on the BBR feature state.

Link to Devin run: https://cisco-demo.devinenterprise.com/sessions/71c0f42835ce4a9586a92d30b6615c2c
Requested by: @bpar9

Updates since last revision

  • Added new testplan document: docs/testplan/BGP-Aggregate-Address-BBR-Awareness-Test-Plan.md
  • Updated test file to reference the new testplan document

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?

Implement automated tests for the BGP aggregate address with BBR awareness feature to ensure proper functionality and prevent regressions.

How did you do it?

Added a new test file tests/bgp/test_bgp_aggregate_address.py with the following test cases:

  1. test_aggregate_address_parameters_combination - Parametrized test covering all combinations of as_set, summary_only, and bbr_required flags (8 test cases)
  2. test_aggregate_address_ipv6 - Validates IPv6 aggregate address support
  3. test_bbr_state_change - Tests aggregate address state transitions when BBR is enabled/disabled
  4. test_bbr_state_change_mixed_addresses - Tests behavior with mixed bbr_required settings
  5. test_bgp_container_restart - Validates aggregate address persistence after BGP container restart
  6. test_capacity_stress - Stress test adding 1000 aggregate addresses
  7. test_link_flapping - Tests behavior during interface shutdown/startup
  8. test_aggregate_address_update - Tests updating existing aggregate address configuration

The tests use GCU (Generic Config Update) to apply configuration changes and validate state across config_db, state_db, and BGP running configuration.

How did you verify/test it?

  • Code passes flake8 linting checks
  • Test structure follows existing patterns from test_bgp_bbr.py and other BGP tests

Important for reviewers:

  • Tests have not been executed against a real testbed - please verify DB table names (BGP_AGGREGATE_ADDR, BGP_AGGREGATE_ADDR_TABLE) match the actual implementation
  • Verify the JSON patch format for GCU operations matches the expected schema
  • Review hardcoded sleep times for appropriateness

Any platform specific information?

N/A

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

  • t1
  • t1-multi-asic

Documentation

New testplan document added: docs/testplan/BGP-Aggregate-Address-BBR-Awareness-Test-Plan.md

This commit adds pytest test cases to verify the BGP aggregate address
with BBR (Bounce Back Routing) awareness feature as described in the
test plan at docs/testplan/BGP-Aggregate-Address.md.

Test cases implemented:
- test_aggregate_address_parameters_combination: Tests aggregate address
  add/remove with various parameter combinations (as_set, summary_only,
  bbr_required)
- test_aggregate_address_ipv6: Tests IPv6 aggregate address support
- test_bbr_state_change: Tests aggregate address behavior when BBR state
  changes (enable/disable)
- test_bbr_state_change_mixed_addresses: Tests mixed bbr_required settings
- test_bgp_container_restart: Tests aggregate address persistence after
  BGP container restart
- test_capacity_stress: Capacity test with 1000 aggregate addresses
- test_link_flapping: Tests behavior during interface shutdown/startup
- test_aggregate_address_update: Tests updating existing aggregate address

The tests validate:
- Config DB entries for aggregate addresses
- State DB entries showing active/inactive state
- BGP running configuration for aggregate addresses
- Proper state transitions based on BBR status

Co-Authored-By: bhavani@cisco.com <bhavani@cisco.com>
@devin-ai-integration
Copy link
Copy Markdown

🤖 Devin AI Engineer

I'll be helping with this pull request! Here's what you should know:

✅ I will automatically:

  • Address comments on this PR. Add '(aside)' to your comment to have me ignore it.
  • Look at CI failures and help fix them

Note: I can only respond to comments from users who have write access to this repository.

⚙️ Control Options:

  • Disable automatic comment and CI monitoring

This commit adds a new testplan document that describes the test cases
for the BGP aggregate address with BBR awareness feature. The testplan
is independent of the existing BGP-Aggregate-Address.md and provides
comprehensive documentation of:

- Feature overview and scope
- Related DUT CLI commands
- Supported topologies (t1, t1-multi-asic)
- 8 detailed test cases with steps and expected results
- Test implementation details including helper functions and fixtures
- Database table references

Also updates the test file docstring to reference the new testplan.

Co-Authored-By: bhavani@cisco.com <bhavani@cisco.com>
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.

1 participant