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

[TestGap] New tests to cover VNET route advertisement. #14666

Merged

Conversation

siqbal1986
Copy link
Contributor

Description of PR

Summary:
Fixes # (issue)
Added new tests to cover the previously untested scenario. These tests create VNET Vxlan ECMP routes and then chekc if they are advertised to the upstream neighbors.

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?

How did you do it?

Create the BGP profile
Create a VNET routes.
check neighbor bgp routes to verify the advertisements.
The following tests are performed for Both V4 and V6 routes.

Step Goal Expected results
Create a tunnel route and advertise the tunnel route to all neighbor without community id BGP ALL BGP neighbors can recieve the advertised BGP routes
Create a tunnel route and advertise the tunnel route to all neighbor with community id BGP ALL BGP neighbors can recieve the advertised BGP routes with community id
Update a tunnel route and advertise the tunnel route to all neighbor with new community id BGP ALL BGP neighbors can recieve the advertised BGP routes with new community id
Create a tunnel route and advertise the tunnel route to all neighbor with BGP profile, but create the profile later BGP ALL BGP neighbors can recieve the advertised BGP routes without community id first, after the profile table created, the community id would be added and all BGP neighbors can recieve this update and associate the community id with the route
Delete a tunnel route BGP ALL BGP neighbors can remove the previously advertised BGP routes
Create 400 tunnel routes and advertise all tunnel routes to all neighbor with community id BGP scale ALL BGP neighbors can recieve 400 advertised BGP routes with community id and record the time
Updat BGP_PROFILE_TABLE with new community id for 400 tunnel routes and advertise all tunnel routes to all neighbor with new community id BGP scale ALL BGP neighbors can recieve 400 advertised BGP routes with new community id and record the time

How did you verify/test it?

image

Any platform specific information?

These scale tests are set to un with 400 routes. Altough I have ran these tests with 4k routes without any problem, but that takes the test run time to around 40 minutes.

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

T1 Cisco, T1 Mlnx, VS

Documentation

@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.................................................Passed
fix end of files.........................................................Passed
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

tests/common/vxlan_ecmp_utils.py:612:12: F632 use ==/!= to compare constant literals (str, bytes, int, float, tuple)

flake8...............................................(no files to check)Skipped
check conditional mark sort..........................(no files to check)Skipped

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>

for vnet in routes:
for prefix in routes[vnet]:
route = f'{prefix}/{prefix_mask}'
result = self.vxlan_test_setup['t2']['host'].get_route(route)
Copy link
Collaborator

@StormLiangMS StormLiangMS Oct 23, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

seems only verified on one T2? Should we check all uplink neighbors? @siqbal1986

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

if the advertisement is happening, then it either reach all T2s or none of them. The get_route operation is slow and time consuming. In order to speed up the test, i checked only one t2.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@StormLiangMS I have made the changes, now the test is looking at the T2s.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@StormLiangMS please review and approve so that this can be merged

@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.................................................Passed
fix end of files.........................................................Passed
check yaml...........................................(no files to check)Skipped
check for added large files..............................................Passed
check python ast.........................................................Failed
- hook id: check-ast
- exit code: 1

tests/common/devices/eos.py: failed parsing with CPython 3.10.12:

Traceback (most recent call last):
File "/home/AzDevOps/.cache/pre-commit/repo_q_dgsjw/py_env-python3/lib/python3.10/site-packages/pre_commit_hooks/check_ast.py", line 21, in main
ast.parse(f.read(), filename=filename)
File "/usr/lib/python3.10/ast.py", line 50, in parse
return compile(source, filename, mode, flags,
File "tests/common/devices/eos.py", line 325
def run_command_list(self, cmd):
^
IndentationError: unindent does not match any outer indentation level
...
[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>

Copy link
Collaborator

@StormLiangMS StormLiangMS left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@StormLiangMS StormLiangMS merged commit 1eecddc into sonic-net:master Nov 4, 2024
15 checks passed
veronica-arista pushed a commit to veronica-arista/sonic-mgmt that referenced this pull request Nov 7, 2024
What is the motivation for this PR?
How did you do it?
Create the BGP profile
Create a VNET routes.
check neighbor bgp routes to verify the advertisements.
The following tests are performed for Both V4 and V6 routes.

Step	Goal	Expected results
Create a tunnel route and advertise the tunnel route to all neighbor without community id	BGP	ALL BGP neighbors can recieve the advertised BGP routes
Create a tunnel route and advertise the tunnel route to all neighbor with community id	BGP	ALL BGP neighbors can recieve the advertised BGP routes with community id
Update a tunnel route and advertise the tunnel route to all neighbor with new community id	BGP	ALL BGP neighbors can recieve the advertised BGP routes with new community id
Create a tunnel route and advertise the tunnel route to all neighbor with BGP profile, but create the profile later	BGP	ALL BGP neighbors can recieve the advertised BGP routes without community id first, after the profile table created, the community id would be added and all BGP neighbors can recieve this update and associate the community id with the route
Delete a tunnel route	BGP	ALL BGP neighbors can remove the previously advertised BGP routes
Create 400 tunnel routes and advertise all tunnel routes to all neighbor with community id	BGP scale	ALL BGP neighbors can recieve 400 advertised BGP routes with community id and record the time
Updat BGP_PROFILE_TABLE with new community id for 400 tunnel routes and advertise all tunnel routes to all neighbor with new community id	BGP scale	ALL BGP neighbors can recieve 400 advertised BGP routes with new community id and record the time
How did you verify/test it?
image

Any platform specific information?
These scale tests are set to un with 400 routes. Altough I have ran these tests with 4k routes without any problem, but that takes the test run time to around 40 minutes.

Supported testbed topology if it's a new test case?
T1 Cisco, T1 Mlnx, VS
sreejithsreekumaran pushed a commit to sreejithsreekumaran/sonic-mgmt that referenced this pull request Nov 15, 2024
What is the motivation for this PR?
How did you do it?
Create the BGP profile
Create a VNET routes.
check neighbor bgp routes to verify the advertisements.
The following tests are performed for Both V4 and V6 routes.

Step	Goal	Expected results
Create a tunnel route and advertise the tunnel route to all neighbor without community id	BGP	ALL BGP neighbors can recieve the advertised BGP routes
Create a tunnel route and advertise the tunnel route to all neighbor with community id	BGP	ALL BGP neighbors can recieve the advertised BGP routes with community id
Update a tunnel route and advertise the tunnel route to all neighbor with new community id	BGP	ALL BGP neighbors can recieve the advertised BGP routes with new community id
Create a tunnel route and advertise the tunnel route to all neighbor with BGP profile, but create the profile later	BGP	ALL BGP neighbors can recieve the advertised BGP routes without community id first, after the profile table created, the community id would be added and all BGP neighbors can recieve this update and associate the community id with the route
Delete a tunnel route	BGP	ALL BGP neighbors can remove the previously advertised BGP routes
Create 400 tunnel routes and advertise all tunnel routes to all neighbor with community id	BGP scale	ALL BGP neighbors can recieve 400 advertised BGP routes with community id and record the time
Updat BGP_PROFILE_TABLE with new community id for 400 tunnel routes and advertise all tunnel routes to all neighbor with new community id	BGP scale	ALL BGP neighbors can recieve 400 advertised BGP routes with new community id and record the time
How did you verify/test it?
image

Any platform specific information?
These scale tests are set to un with 400 routes. Altough I have ran these tests with 4k routes without any problem, but that takes the test run time to around 40 minutes.

Supported testbed topology if it's a new test case?
T1 Cisco, T1 Mlnx, VS
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.

3 participants