sonic-mgmt
sonic-mgmt copied to clipboard
Fixed test issues for dualtor topologies.
Description of PR
Summary: Fixed test issue in dualtor topology. Fixes # (issue): https://github.com/aristanetworks/sonic-qual.msft/issues/69
Type of change
- [ ] Bug fix
- [ ] Testbed and Framework(new/improvement)
- [x] Test case(new/improvement)
Back port request
- [ ] 201911
- [ ] 202012
- [ ] 202205
- [x] 202305
- [x] 202311
Approach
What is the motivation for this PR?
- In some test cases the packets go to unselected ToR in case of active-active links or forwarded by the unselected ToR in case of active-standby links.
- Some tests verify queue counters, but this check fails for UC1 in presence of active active links as UC1 always has gRPC traffic flowing through it.
How did you do it?
-
First issue can be addressed by using the following fixtures in case of active-standby (wherever missing, commit 1) :- a) toggle_all_simulator_ports_to_rand_selected_tor b) toggle_all_simulator_ports_to_enum_rand_one_per_hwsku_frontend_host_m
To handle this in case of active-active links new fixtures are introduced (commit 3 & 4) a) setup_standby_ports_on_rand_unselected_tor b) setup_standby_ports_on_non_enum_rand_one_per_hwsku_frontend_host_m c) setup_standby_ports_on_rand_unselected_tor_unconditionally d) setup_standby_ports_on_non_enum_rand_one_per_hwsku_frontend_host_m_unconditionally
-
Second issue can be addressed by simply skipping the check for UC1 in presence of active-active links. (commit 2)
How did you verify/test it?
Verified on Arista 7260 device using dualtor/dualtor-aa topology.
Any platform specific information?
Supported testbed topology if it's a new test case?
Documentation
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/bgp/test_bgp_queue.py:4:1: F401 'tests.common.dualtor.dual_tor_common.active_active_ports' imported but unused
tests/bgp/test_bgp_queue.py:32:84: F811 redefinition of unused 'active_active_ports' from line 4
tests/common/dualtor/dual_tor_utils.py:1733:1: E302 expected 2 blank lines, found 1
tests/common/dualtor/dual_tor_utils.py:1741:1: E302 expected 2 blank lines, found 1
tests/common/dualtor/dual_tor_utils.py:1749:1: E302 expected 2 blank lines, found 1
tests/common/dualtor/dual_tor_utils.py:1750:72: F811 redefinition of unused 'active_active_ports' from line 38
tests/common/dualtor/dual_tor_utils.py:1750:91: E231 missing whitespace after ','
tests/common/dualtor/dual_tor_utils.py:1750:121: E501 line too long (133 > 120 characters)
tests/common/dualtor/dual_tor_utils.py:1761:1: E302 expected 2 blank lines, found 1
tests/common/dualtor/dual_tor_utils.py:1768:1: E302 expected 2 blank lines, found 1
tests/common/dualtor/dual_tor_utils.py:1769:88: F811 redefinition of unused 'active_active_ports' from line 38
...
[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:
- 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.
- Ensure that the
pre-commitpackage is installed:
sudo pip install pre-commit
- Go to repository root folder
- Install the pre-commit hooks:
pre-commit install
- Use pre-commit to check staged file:
pre-commit
- Alternatively, you can check committed files using:
pre-commit run --from-ref <commit_id> --to-ref <commit_id>
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/qos/test_tunnel_qos_remap.py:245:9: E128 continuation line under-indented for visual indent
tests/qos/test_tunnel_qos_remap.py:354:9: E128 continuation line under-indented for visual indent
tests/qos/test_tunnel_qos_remap.py:432:9: E128 continuation line under-indented for visual indent
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:
- 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.
- Ensure that the
pre-commitpackage is installed:
sudo pip install pre-commit
- Go to repository root folder
- Install the pre-commit hooks:
pre-commit install
- Use pre-commit to check staged file:
pre-commit
- Alternatively, you can check committed files using:
pre-commit run --from-ref <commit_id> --to-ref <commit_id>
hi @vivekverma-arista could I ask your help to validate these changes with T0/T1? to avoid regression. pls verify with 202305 image also.
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.........................................................Failed
- hook id: end-of-file-fixer
- exit code: 1
- files were modified by this hook
Fixing tests/dhcp_relay/test_dhcpv6_relay.py
check yaml...........................................(no files to check)Skipped
check for added large files..............................................Passed
check python ast.........................................................Passed
flake8...................................................................Passed
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:
- 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.
- Ensure that the
pre-commitpackage is installed:
sudo pip install pre-commit
- Go to repository root folder
- Install the pre-commit hooks:
pre-commit install
- Use pre-commit to check staged file:
pre-commit
- Alternatively, you can check committed files using:
pre-commit run --from-ref <commit_id> --to-ref <commit_id>
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.........................................................Failed
- hook id: end-of-file-fixer
- exit code: 1
- files were modified by this hook
Fixing tests/dhcp_relay/test_dhcpv6_relay.py
check yaml...........................................(no files to check)Skipped
check for added large files..............................................Passed
check python ast.........................................................Passed
flake8...................................................................Passed
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:
- 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.
- Ensure that the
pre-commitpackage is installed:
sudo pip install pre-commit
- Go to repository root folder
- Install the pre-commit hooks:
pre-commit install
- Use pre-commit to check staged file:
pre-commit
- Alternatively, you can check committed files using:
pre-commit run --from-ref <commit_id> --to-ref <commit_id>
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.........................................................Failed
- hook id: end-of-file-fixer
- exit code: 1
- files were modified by this hook
Fixing tests/dhcp_relay/test_dhcpv6_relay.py
check yaml...........................................(no files to check)Skipped
check for added large files..............................................Passed
check python ast.........................................................Passed
flake8...................................................................Passed
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:
- 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.
- Ensure that the
pre-commitpackage is installed:
sudo pip install pre-commit
- Go to repository root folder
- Install the pre-commit hooks:
pre-commit install
- Use pre-commit to check staged file:
pre-commit
- Alternatively, you can check committed files using:
pre-commit run --from-ref <commit_id> --to-ref <commit_id>
hi @vivekverma-arista could I ask your help to validate these changes with T0/T1? to avoid regression. pls verify with 202305 image also.
Hi @StormLiangMS, I have verified this on t0 and t1, this doesn't introduce any new regression.
Hi @vivekverma-arista , current PR has conflicts with master branch
Hi @vivekverma-arista , current PR has conflicts with master branch
Merge conflicts have been resolved.
Hi @StormLiangMS can we merge this PR?
Cherry-pick PR to 202305: https://github.com/sonic-net/sonic-mgmt/pull/12488
Cherry-pick PR to 202311: https://github.com/sonic-net/sonic-mgmt/pull/12489