Skip to content

[m0][bgp] Add support for m0 in bgp test to simulate both t0 and t1 scenario#7581

Merged
yaqiangz merged 2 commits intosonic-net:masterfrom
yaqiangz:azure-master_m0_t0_t1
Feb 27, 2023
Merged

[m0][bgp] Add support for m0 in bgp test to simulate both t0 and t1 scenario#7581
yaqiangz merged 2 commits intosonic-net:masterfrom
yaqiangz:azure-master_m0_t0_t1

Conversation

@yaqiangz
Copy link
Contributor

@yaqiangz yaqiangz commented Feb 27, 2023

Description of PR

Summary:
Fixes # (issue)

Type of change

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

Back port request

  • 201911
  • 202012
  • 202205

Approach

What is the motivation for this PR?

In current bgp test for m0, just simulate scenario that m0 device performs like t1. But m0 is like both t1 and t0.

How did you do it?

Add suport for m0 in bgp test to simulate both t0 and t1 scenario

How did you verify/test it?

Run tests on m0 topo and t0 topo
M0 topo:

bgp/test_bgp_update_timer.py::test_bgp_update_timer[testbed-m0_t0_scenario] PASSED                                                                                            [ 50%]
bgp/test_bgp_update_timer.py::test_bgp_update_timer[testbed-m0_t1_scenario] PASSED                                                                                            [100%]

T0 topo:

bgp/test_bgp_update_timer.py::test_bgp_update_timer[testbed-default] PASSED                                                                                            [100%]

Any platform specific information?

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

Documentation

@wangxin
Copy link
Collaborator

wangxin commented Feb 27, 2023

The pre-commit check detected issues in the files touched by this pull request.
The detected issues may be old or new. For new issues, please try to fix them.

For old issues, it is not mandatory to fix them because they were not caused by this change. It is unfair to blame
author of this pull request. But if you can take extra effort to fix the old issues as well, that would be great!

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/bgp/conftest.py:253:121: E501 line too long (136 > 120 characters)
tests/conftest.py:1714:1: E302 expected 2 blank lines, found 1

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>

@wangxin
Copy link
Collaborator

wangxin commented Feb 27, 2023

The pre-commit check detected issues in the files touched by this pull request.
The detected issues may be old or new. For new issues, please try to fix them.

For old issues, it is not mandatory to fix them because they were not caused by this change. It is unfair to blame
author of this pull request. But if you can take extra effort to fix the old issues as well, that would be great!

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/bgp/conftest.py:253:121: E501 line too long (136 > 120 characters)
tests/conftest.py:1714:1: E302 expected 2 blank lines, found 1

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>

@yaqiangz yaqiangz merged commit dc9ae21 into sonic-net:master Feb 27, 2023
yaqiangz added a commit to yaqiangz/sonic-mgmt that referenced this pull request Feb 27, 2023
…cenario (sonic-net#7581)

What is the motivation for this PR?
In current bgp test for m0, just simulate scenario that m0 device performs like t1. But m0 is like both t1 and t0.

How did you do it?
Add suport for m0 in bgp test to simulate both t0 and t1 scenario

How did you verify/test it?
Run tests on m0 topo and t0 topo

Signed-off-by: Yaqiang Zhu <[email protected]>
yaqiangz added a commit that referenced this pull request Feb 27, 2023
…and t1 scenario (#7581) (#7585)

What is the motivation for this PR?
In current bgp test for m0, just simulate scenario that m0 device performs like t1. But m0 is like both t1 and t0.

How did you do it?
Add suport for m0 in bgp test to simulate both t0 and t1 scenario

How did you verify/test it?
Run tests on m0 topo and t0 topo

Signed-off-by: Yaqiang Zhu <[email protected]>
wangxin pushed a commit that referenced this pull request Feb 28, 2023
…cenario (#7581)

What is the motivation for this PR?
In current bgp test for m0, just simulate scenario that m0 device performs like t1. But m0 is like both t1 and t0.

How did you do it?
Add suport for m0 in bgp test to simulate both t0 and t1 scenario

How did you verify/test it?
Run tests on m0 topo and t0 topo

Signed-off-by: Yaqiang Zhu <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants