Skip to content

test_radv_ipv6_ra is unnecessarily skipped on non-dualtor topology#9048

Merged
wangxin merged 3 commits intosonic-net:masterfrom
wangxin:cabletype-no-skip
Aug 4, 2023
Merged

test_radv_ipv6_ra is unnecessarily skipped on non-dualtor topology#9048
wangxin merged 3 commits intosonic-net:masterfrom
wangxin:cabletype-no-skip

Conversation

@wangxin
Copy link
Collaborator

@wangxin wangxin commented Jul 20, 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?

Script test_radv_ipv6_ra.py is unnecessarily skipped on non-dualtor topology. The reason is that this script uses fixture toggle_all_simulator_ports_to_upper_tor which depends on cable_type fixture.

The cable_type fixture requires that the topology must has "dualtor", otherwise skip the test.

How did you do it?

This change updated the test_radv_ipv6_ra.py to use fixture toggle_all_simulator_ports_to_random_side.

How did you verify/test it?

Any platform specific information?

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

Documentation

Copy link
Collaborator

@lolyu lolyu left a comment

Choose a reason for hiding this comment

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

test_radv_ipv6.py uses fixture toggle_all_simulator_ports_to_upper_tor to do the mux toggle, which depends on cable_type. Actually, toggle_all_simulator_ports_to_upper_tor is designed for dualtor-io testcases. For normal t0 testcases, the practice is using fixture toggle_all_simulator_ports_to_random_side and choosing the random ToR as the testing device.
Suggest use toggle_all_simulator_ports_to_random_side instead.

Some test scripts need to support both dualtor and other topologies.
These scripts may need to call a dualtor specific fixture `cable_type`.

Fixture `cable_type` enforced that the topology must has "dualtor", otherwise
skip the test.

For scripts depend on the `cable_type` fixture, they are unnecessarily skipped
on non-dualtor topologies.

This change updated the check in the `cable_type` fixture. When "dualtor" is
not in topology name, simply return None instead of force skip the test script.

Signed-off-by: Xin Wang <[email protected]>
@wangxin wangxin force-pushed the cabletype-no-skip branch from b230cae to de58f3d Compare July 24, 2023 08:08
@wangxin wangxin requested a review from jcaiMR as a code owner July 24, 2023 08:08
@wangxin wangxin changed the title Dualtor fixture cable_type caused unnecessary skip on non-dualtor topo test_radv_ipv6_ra is unnecessarily skipped on non-dualtor topology Jul 24, 2023
@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/radv/test_radv_ipv6_ra.py:119:5: E125 continuation line with same indent as next logical line
tests/radv/test_radv_ipv6_ra.py:145:5: E125 continuation line with same indent as next logical line
tests/radv/test_radv_ipv6_ra.py:172:5: E125 continuation line with same indent as next logical line
tests/radv/test_radv_ipv6_ra.py:198:5: E125 continuation line with same indent as next logical line

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
Copy link
Collaborator

@wangxin PR conflicts with 202205 branch

mssonicbld pushed a commit to mssonicbld/sonic-mgmt that referenced this pull request Aug 4, 2023
…onic-net#9048)

What is the motivation for this PR?
Script test_radv_ipv6_ra.py is unnecessarily skipped on non-dualtor topology. The reason is that this script uses fixture toggle_all_simulator_ports_to_upper_tor which depends on cable_type fixture.

The cable_type fixture requires that the topology must has "dualtor", otherwise skip the test.

How did you do it?
This change updated the test_radv_ipv6_ra.py to use fixture toggle_all_simulator_ports_to_random_side.

Signed-off-by: Xin Wang <[email protected]>
@mssonicbld
Copy link
Collaborator

Cherry-pick PR to 202305: #9299

wangxin added a commit to wangxin/sonic-mgmt that referenced this pull request Aug 4, 2023
…pology

Cherry-pick sonic-net#9048

What is the motivation for this PR?
Script test_radv_ipv6_ra.py is unnecessarily skipped on non-dualtor topology. The reason is that this script uses fixture toggle_all_simulator_ports_to_upper_tor which depends on cable_type fixture.

The cable_type fixture requires that the topology must has "dualtor", otherwise skip the test.

How did you do it?
This change updated the test_radv_ipv6_ra.py to use fixture toggle_all_simulator_ports_to_random_side.

Signed-off-by: Xin Wang <[email protected]>
mssonicbld pushed a commit that referenced this pull request Aug 4, 2023
…9048)

What is the motivation for this PR?
Script test_radv_ipv6_ra.py is unnecessarily skipped on non-dualtor topology. The reason is that this script uses fixture toggle_all_simulator_ports_to_upper_tor which depends on cable_type fixture.

The cable_type fixture requires that the topology must has "dualtor", otherwise skip the test.

How did you do it?
This change updated the test_radv_ipv6_ra.py to use fixture toggle_all_simulator_ports_to_random_side.

Signed-off-by: Xin Wang <[email protected]>
@wangxin wangxin deleted the cabletype-no-skip branch August 7, 2023 04:49
wangxin added a commit that referenced this pull request Aug 9, 2023
…pology (#9300)

Cherry-pick #9048

What is the motivation for this PR?
Script test_radv_ipv6_ra.py is unnecessarily skipped on non-dualtor topology. The reason is that this script uses fixture toggle_all_simulator_ports_to_upper_tor which depends on cable_type fixture.

The cable_type fixture requires that the topology must has "dualtor", otherwise skip the test.

How did you do it?
This change updated the test_radv_ipv6_ra.py to use fixture toggle_all_simulator_ports_to_random_side.

Signed-off-by: Xin Wang <[email protected]>
AharonMalkin pushed a commit to AharonMalkin/sonic-mgmt that referenced this pull request Jan 25, 2024
…onic-net#9048)

What is the motivation for this PR?
Script test_radv_ipv6_ra.py is unnecessarily skipped on non-dualtor topology. The reason is that this script uses fixture toggle_all_simulator_ports_to_upper_tor which depends on cable_type fixture.

The cable_type fixture requires that the topology must has "dualtor", otherwise skip the test.

How did you do it?
This change updated the test_radv_ipv6_ra.py to use fixture toggle_all_simulator_ports_to_random_side.

Signed-off-by: Xin Wang <[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