Skip to content

Skip iface loopback test if Leaf-fanout switch is running SONiC and Mellanox ASIC #12931

Merged
bingwang-ms merged 3 commits intosonic-net:masterfrom
bingwang-ms:skip_iface_loopback_if_sonic_mlnx_leaf_master
Jun 4, 2024
Merged

Skip iface loopback test if Leaf-fanout switch is running SONiC and Mellanox ASIC #12931
bingwang-ms merged 3 commits intosonic-net:masterfrom
bingwang-ms:skip_iface_loopback_if_sonic_mlnx_leaf_master

Conversation

@bingwang-ms
Copy link
Copy Markdown
Collaborator

Description of PR

Summary:
The test cases in test_iface_loopback_action.py is failing consistently on some testbed when the leaf-fanout is Mellanox and running SONiC. This is because the test sends packets with Vlan tag for testing, while TPID is not supported on Mellanox if running SONiC OS.
So the test needs to be skipped in the above setup.

Type of change

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

Back port request

  • 201911
  • 202012
  • 202205
  • 202305
  • 202311

Approach

What is the motivation for this PR?

This PR is to skip test_iface_loopback_action.py if the leaf-fanout is Mellanox and running SONiC.

How did you do it?

Add a fixture to check OS and ASIC of leaf-fanout switch.

How did you verify/test it?

The change is verified on a physical testbed.

collected 3 items                                                                                                                                                                                     

iface_loopback_action/test_iface_loopback_action.py::test_loopback_action_basic SKIPPED (Not supporteds on Mellanox leaf-fanout running SONiC)                                                  [ 33%]
iface_loopback_action/test_iface_loopback_action.py::test_loopback_action_port_flap SKIPPED (Not supporteds on Mellanox leaf-fanout running SONiC)                                              [ 66%]
iface_loopback_action/test_iface_loopback_action.py::test_loopback_action_reload SKIPPED (Not supporteds on Mellanox leaf-fanout running SONiC)                                                 [100%]

Any platform specific information?

Mellanox platform specific.

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

Not a new test case.

Documentation

@bingwang-ms
Copy link
Copy Markdown
Collaborator Author

@nhe-NV @roy-sror Can you please help review? Thanks

@mssonicbld
Copy link
Copy Markdown
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.........................................................Failed
- hook id: end-of-file-fixer
- exit code: 1
- files were modified by this hook

Fixing tests/iface_loopback_action/conftest.py

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/iface_loopback_action/conftest.py:186:121: E501 line too long (121 > 120 characters)

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>

@wsycqyz
Copy link
Copy Markdown
Contributor

wsycqyz commented May 23, 2024

Can we do this kind of skip in condition mark?

@roy-sror
Copy link
Copy Markdown
Contributor

@nhe-NV @roy-sror Can you please help review? Thanks

@nhe-NV - does it mean that we won't have coverage for this feature?

@bingwang-ms
Copy link
Copy Markdown
Collaborator Author

Can we do this kind of skip in condition mark?

Unfortunately no. We can only check the ASIC type for DUT in condition_mark.yml. Checking the OS and ASIC of leaf fanout is not supported.

Copy link
Copy Markdown
Contributor

@wsycqyz wsycqyz left a comment

Choose a reason for hiding this comment

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

LGTM

@bingwang-ms
Copy link
Copy Markdown
Collaborator Author

@roy-sror I would like to merge this PR to unblock the nightly test, and revert it once TPID is available in the image. Please let me know if you have any concern. Thanks!

@bingwang-ms bingwang-ms merged commit 8b38a8a into sonic-net:master Jun 4, 2024
mssonicbld pushed a commit to mssonicbld/sonic-mgmt that referenced this pull request Jun 4, 2024
…ellanox ASIC (sonic-net#12931)

* Skip iface_loopback_action test if leaf-fanout switch is Mellanox and running SONiC
@mssonicbld
Copy link
Copy Markdown
Collaborator

Cherry-pick PR to 202311: #13128

mssonicbld pushed a commit that referenced this pull request Jun 4, 2024
…ellanox ASIC (#12931)

* Skip iface_loopback_action test if leaf-fanout switch is Mellanox and running SONiC
mrkcmo pushed a commit to Azarack/sonic-mgmt that referenced this pull request Jul 17, 2024
…ellanox ASIC (sonic-net#12931)

* Skip iface_loopback_action test if leaf-fanout switch is Mellanox and running SONiC
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.

4 participants