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

Tests for VNET route precedence over BGP learnt route. #15710

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

siqbal1986
Copy link
Contributor

Description of PR

These tests check the Vnet route precedence over bgp learnt route.

Summary:
Fixes # (issue)

Type of change

  • Bug fix
  • Testbed and Framework(new/improvement)
  • Test case(new/improvement)

Back port request

  • 202012
  • 202205
  • 202305
  • 202311
  • 202405

Approach

What is the motivation for this PR?

Currently if a route is learnt via BGP and added into the hardware, adding a VNET route results in failure. In addition due to a bug in VnetOrch, we start advertising the failed route, This prompts the BGP to remove the learnt route in favor of the local route. Since the Vnet Orch doesn't retry adding the Vnet route, This results in no route being present in the Hardware.

How I verified it

The fix is in PR sonic-net/sonic-swss#3345
These tests cover various scenario in which VNET and BGP routes are added and removed in different order

How did you do it?

How did you verify/test it?

Any platform specific information?

Cisco-8000 and mlnx.

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

Documentation

There are 5 differnet scenarios which are checked. Each scenario is tested with with the following options.
Encap types [v4_inv4, v6_inV4]
Monitor Type [BFD, Custom]
Init NH state( BFD/monitor sessions for nexthops are initially up or not.)

  1. test_vnet_route_after_bgp
    ADD BGP ROUTE on TOR
    Add VNET route
    Configure monitor (BFD or custom) with nexthop state (UP)
    Test with traffic
    Remove VNET route
    Remove BGP route
  2. test_vnet_route_before_bgp_after_ep_up
    Add VNET route
    Configure monitor (BFD or custom) with nexthop state (UP)
    Add BGP ROUTE on TOR
    Test with traffic
    Remove VNET ROUTE
    Remove BGP route
  3. test_vnet_route_bgp_removal_before_ep
    ADD BGP ROUTE on TOR
    Add VNET route
    Remove BGP route
    Configure monitor (BFD or custom) with nexthop state (UP)
    Test with traffic
    Remove VNET route
  4. test_vnet_route_after_bgp_with_early_bgp_removal
    Add VNET route
    Add BGP ROUTE on TOR
    Configure monitor (BFD or custom) with nexthop state (UP)
    Test with traffic
    Remove BGP route
    Test with traffic
    Remove VNET route
  5. test_vnet_route_after_bgp_multi_flap
    ADD BGP ROUTE on TOR
    Add VNET route
    Configure monitor (BFD or custom) with nexthop state (UP)
    Test with traffic
    flap the bfd/monitor sessions.
    Test with traffic
    Remove VNET route
    Remove BGP route

image

Note: Some scenarios are skipped because they are not valid.

@mssonicbld
Copy link
Collaborator

The pre-commit check detected issues in the files touched by this pull request.
The pre-commit check is a mandatory check, please fix detected issues.

Detailed pre-commit check results:
trim trailing whitespace.................................................Failed
- hook id: trailing-whitespace
- exit code: 1
- files were modified by this hook

Fixing tests/vxlan/test_vnet_bgp_route_precedence.py

fix end of files.........................................................Failed
- hook id: end-of-file-fixer
- exit code: 1
- files were modified by this hook

Fixing tests/vxlan/test_vnet_bgp_route_precedence.py

check yaml...........................................(no files to check)Skipped
check for added large files..............................................Passed
check python ast.........................................................Passed
flake8...................................................................Failed
- hook id: flake8
- exit code: 1
...
[truncated extra lines, please run pre-commit locally to view full check results]

To run the pre-commit checks locally, you can follow below steps:

  1. Ensure that default python is python3. In sonic-mgmt docker container, default python is python2. You can run
    the check by activating the python3 virtual environment in sonic-mgmt docker container or outside of sonic-mgmt
    docker container.
  2. Ensure that the pre-commit package is installed:
sudo pip install pre-commit
  1. Go to repository root folder
  2. Install the pre-commit hooks:
pre-commit install
  1. Use pre-commit to check staged file:
pre-commit
  1. Alternatively, you can check committed files using:
pre-commit run --from-ref <commit_id> --to-ref <commit_id>

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