Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[bgp][test plan] Add test plan for bgp router id #16896

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
124 changes: 124 additions & 0 deletions docs/testplan/BGP-Router-ID-test-plan.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,124 @@
# IPv4 Port Based DHCP Server Test Plan

## Related Documents
|**Document Name**|**Link**|
|-----------------|--------|
|BGP Router ID Explicitly Configured|[BGP Router ID Explicitly Configured HLD](https://github.com/sonic-net/SONiC/blob/master/doc/BGP/BGP-router-id.md)|

## Overview

With the feature **BGP Router ID Explicitly Configured**, we can decouple BGP sessions with Loopback IPv4 address in device.

## Scope

### Test Scenario

The tests will include:

1. Verify router ID specifying has higher priority than Loopback IP.
2. Verify BGP would work well without Loopback IP.

### Supported Topology

Test cases should run on all topologies.

## Test Case

### Common function

#### verify_bgp
1. Verify BGP router ID in DUT by parsing output of `show ip bgp sum`
2. Verify peer BGP router ID (DUT) in BGP neighbor side by parsing output of `show ip bgp neighbors <remote p2p ip>`
3. Verify BGP sessions are established and align with running config

### Test module test_bgp_router_id.py
This module is to test BGP router ID in single asic.

#### test_bgp_router_id_default

* **Test objective**

To test in default scenario (BGP router ID is not specified explicitly), BGP router ID would be set as IPv4 address of Loopback0.

* **Test detail**
* `verify_bgp` to check BGP router ID and sessions status.

#### test_bgp_router_id_set

* **Test objective**

To test when BGP router ID is set and Loopback0 IPv4 address is configured, BGP router ID would be set as router ID in CONFIG_DB rather than IPv4 address of Loopback0 and BGP would work well.

* **Setup**
* Add BGP router ID to CONFIG_DB.
* Restart BGP container.
* **Teardown**
* Remove BGP router ID in CONFIG_DB.
* Restart BGP container.

* **Test detail**
* `verify_bgp` to check BGP router ID and sessions status.

#### test_bgp_router_id_set_without_loopback_ipv4

* **Test objective**

To test when BGP router ID is set and Loopback0 IPv4 address is not configured, BGP router ID would be set as router ID in CONFIG_DB and BGP would work well

* **Setup**
* Add BGP router ID to CONFIG_DB.
* Remove IPv4 address of Loopback0.
* Restart BGP container.
* **Teardown**
* Remove BGP router ID in CONFIG_DB.
* Add IPv4 address of Loopback back.
* Restart BGP container.

* **Test detail**
* `verify_bgp` to check BGP router ID and sessions status.

### Test module test_bgp_router_id_multi_asic.py
This module is to test BGP router ID in multi asic.

#### test_bgp_router_id_default

* **Test objective**

To test in default scenario (BGP router ID is not specified explicitly), eBGP router ID would be set as IPv4 address of Loopback0 and iBGP router ID would be set as IPv4 address of Loopback4096.

* **Test detail**
* `verify_bgp` to check iBGP and eBGP router ID and sessions status.

#### test_bgp_router_id_set

* **Test objective**

To test when BGP router ID is set and Loopback0 and Loopback4096 IPv4 address are configured, BGP router ID would be set as router ID in CONFIG_DB rather than IPv4 address of Loopback0 and BGP would work well.

* **Setup**
* Add BGP router ID to CONFIG_DB of corresponding asic.
* Restart BGP container.
* **Teardown**
* Remove BGP router ID in CONFIG_DB of corresponding asic.
* Restart BGP container.

* **Test detail**
* `verify_bgp` to check BGP router ID and sessions status.

#### test_bgp_router_id_set_without_loopback_ipv4

* **Test objective**

To test when BGP router ID is set and Loopback0 and Loopback4096 IPv4 address are not configured, BGP router ID would be set as router ID in CONFIG_DB and BGP would work well

* **Setup**
* Add BGP router ID to CONFIG_DB of corresponding asic.
* Remove IPv4 address of Loopback0 of corresponding asic.
* Restart BGP container.
* **Teardown**
* Remove BGP router ID in CONFIG_DB of corresponding asic.
* Add IPv4 address of Loopback back of corresponding asic.
* Restart BGP container.

* **Test detail**
* `verify_bgp` to check BGP router ID and sessions status.
Loading