sonic-mgmt icon indicating copy to clipboard operation
sonic-mgmt copied to clipboard

Fixed test issues for dualtor topologies.

Open vivekverma-arista opened this issue 1 year ago • 10 comments

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?

  1. 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.
  2. 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?

  1. 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

  2. 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

vivekverma-arista avatar Mar 07 '24 05:03 vivekverma-arista

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:

  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>

mssonicbld avatar Mar 07 '24 05:03 mssonicbld

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:

  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>

mssonicbld avatar Mar 23 '24 10:03 mssonicbld

hi @vivekverma-arista could I ask your help to validate these changes with T0/T1? to avoid regression. pls verify with 202305 image also.

StormLiangMS avatar Mar 29 '24 04:03 StormLiangMS

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:

  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>

mssonicbld avatar Apr 01 '24 05:04 mssonicbld

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:

  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>

mssonicbld avatar Apr 01 '24 06:04 mssonicbld

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:

  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>

mssonicbld avatar Apr 01 '24 07:04 mssonicbld

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.

vivekverma-arista avatar Apr 01 '24 09:04 vivekverma-arista

Hi @vivekverma-arista , current PR has conflicts with master branch

yaqiangz avatar Apr 02 '24 04:04 yaqiangz

Hi @vivekverma-arista , current PR has conflicts with master branch

Merge conflicts have been resolved.

vivekverma-arista avatar Apr 02 '24 06:04 vivekverma-arista

Hi @StormLiangMS can we merge this PR?

vivekverma-arista avatar Apr 16 '24 07:04 vivekverma-arista

Cherry-pick PR to 202305: https://github.com/sonic-net/sonic-mgmt/pull/12488

mssonicbld avatar Apr 17 '24 12:04 mssonicbld

Cherry-pick PR to 202311: https://github.com/sonic-net/sonic-mgmt/pull/12489

mssonicbld avatar Apr 17 '24 12:04 mssonicbld