Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[202405 - cherry pick]: Enhancement of port selection criteria for multidut RDMA cases… #14256

Closed
wants to merge 3 commits into from

Conversation

selldinesh
Copy link
Contributor

… based on testbed informaition (#14127)

Description of PR
Summary: This PR enhances the logic for port selection for multidut RDMA cases based on the conf-name defined in the testbed.csv / testbed.yaml file. And also a generic fixture for single and multidut topology to get the snappi ports, dut port, asic_type, asic_value information Fixes # (issue)

Approach
What is the motivation for this PR?
For enhancing the port selection logic and a generic fixture for single and multidut topology

How did you do it?
Added a pytest fixture called get_snappi_ports and get_snappi_ports_for_rdma whcih selects the ports from the information provided in MULTIDUT_PORT_INFO in variables.py and the testbed info as shown below in testbed.csv

vms-snappi-sonic,vms6-1,ptf64,docker-ptf-snappi,snappi-sonic-ptf,10.36.78.59,,Server_6,,sonic-s6100-dut1,snappi-sonic,True,Batman vms-snappi-sonic-multidut,vms6-1,ptf64,docker-ptf-snappi,snappi-sonic-ptf,10.36.78.59,,Server_6,,[sonic-s6100-dut1;sonic-s6100-dut2],snappi-sonic,True,Batman vms-snappi-single-dut-multi-asic,vms6-1,ptf64,docker-ptf-snappi,snappi-sonic-ptf,10.36.78.59,,Server_6,,sonic-s6100-dut1,snappi-sonic,True,Batman vms-snappi-multi-dut-multi-asic,vms6-1,ptf64,docker-ptf-snappi,snappi-sonic-ptf,10.36.78.59,,Server_6,,[sonic-s6100-dut1;sonic-s6100-dut2],snappi-sonic,True,Batman How did you verify/test it?
Tested the logic on pfc cases

co-authorized by: [email protected]

Description of PR

Summary:
Fixes # (issue)

Type of change

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

Back port request

  • 202012
  • 202205
  • 202305
  • 202311
  • 202405

Approach

What is the motivation for this PR?

How did you do it?

How did you verify/test it?

Any platform specific information?

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

Documentation

… based on testbed informaition (sonic-net#14127)

Description of PR
Summary: This PR enhances the logic for port selection for multidut RDMA cases based on the conf-name defined in the testbed.csv / testbed.yaml file. And also a generic fixture for single and multidut topology to get the snappi ports, dut port, asic_type, asic_value information
Fixes # (issue)

Approach
What is the motivation for this PR?
For enhancing the port selection logic and a generic fixture for single and multidut topology

How did you do it?
Added a pytest fixture called get_snappi_ports and get_snappi_ports_for_rdma whcih selects the ports from the information provided in MULTIDUT_PORT_INFO in variables.py and the testbed info as shown below in testbed.csv

vms-snappi-sonic,vms6-1,ptf64,docker-ptf-snappi,snappi-sonic-ptf,10.36.78.59,,Server_6,,sonic-s6100-dut1,snappi-sonic,True,Batman
vms-snappi-sonic-multidut,vms6-1,ptf64,docker-ptf-snappi,snappi-sonic-ptf,10.36.78.59,,Server_6,,[sonic-s6100-dut1;sonic-s6100-dut2],snappi-sonic,True,Batman
vms-snappi-single-dut-multi-asic,vms6-1,ptf64,docker-ptf-snappi,snappi-sonic-ptf,10.36.78.59,,Server_6,,sonic-s6100-dut1,snappi-sonic,True,Batman
vms-snappi-multi-dut-multi-asic,vms6-1,ptf64,docker-ptf-snappi,snappi-sonic-ptf,10.36.78.59,,Server_6,,[sonic-s6100-dut1;sonic-s6100-dut2],snappi-sonic,True,Batman
How did you verify/test it?
Tested the logic on pfc cases

co-authorized by: [email protected]
@selldinesh selldinesh changed the title [Fix]: Enhancement of port selection criteria for multidut RDMA cases… [202405 - cherry pick]: Enhancement of port selection criteria for multidut RDMA cases… Aug 26, 2024
… based on testbed informaition (sonic-net#14127)

Description of PR
Summary: This PR enhances the logic for port selection for multidut RDMA cases based on the conf-name defined in the testbed.csv / testbed.yaml file. And also a generic fixture for single and multidut topology to get the snappi ports, dut port, asic_type, asic_value information
Fixes # (issue)

Approach
What is the motivation for this PR?
For enhancing the port selection logic and a generic fixture for single and multidut topology

How did you do it?
Added a pytest fixture called get_snappi_ports and get_snappi_ports_for_rdma whcih selects the ports from the information provided in MULTIDUT_PORT_INFO in variables.py and the testbed info as shown below in testbed.csv

vms-snappi-sonic,vms6-1,ptf64,docker-ptf-snappi,snappi-sonic-ptf,10.36.78.59,,Server_6,,sonic-s6100-dut1,snappi-sonic,True,Batman
vms-snappi-sonic-multidut,vms6-1,ptf64,docker-ptf-snappi,snappi-sonic-ptf,10.36.78.59,,Server_6,,[sonic-s6100-dut1;sonic-s6100-dut2],snappi-sonic,True,Batman
vms-snappi-single-dut-multi-asic,vms6-1,ptf64,docker-ptf-snappi,snappi-sonic-ptf,10.36.78.59,,Server_6,,sonic-s6100-dut1,snappi-sonic,True,Batman
vms-snappi-multi-dut-multi-asic,vms6-1,ptf64,docker-ptf-snappi,snappi-sonic-ptf,10.36.78.59,,Server_6,,[sonic-s6100-dut1;sonic-s6100-dut2],snappi-sonic,True,Batman
How did you verify/test it?
Tested the logic on pfc cases

co-authorized by: [email protected]
@sdszhang sdszhang self-requested a review August 26, 2024 23:43
Copy link
Contributor

@sdszhang sdszhang left a comment

Choose a reason for hiding this comment

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

LGTM

@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/snappi_tests/variables.py:1:1: F401 'sys' imported but unused
tests/snappi_tests/variables.py:2:1: F401 'ipaddress' imported but unused
tests/snappi_tests/variables.py:3:1: F401 'ipaddress.ip_address' imported but unused
tests/snappi_tests/variables.py:3:1: F401 'ipaddress.IPv4Address' imported but unused
tests/snappi_tests/variables.py:3:1: F401 'ipaddress.IPv6Address' imported but unused

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>

@sdszhang
Copy link
Contributor

after PR #13638 is merged into 202405, the original PR has been auto-merged into 202405 after re-try. No need for a manual cherry-pick now. We can close this one. Thanks.

@sdszhang sdszhang closed this Sep 29, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants