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

[action] [PR:16394] snappi: T2: Convert all udp port numbers to serial sequence. #16435

Open
wants to merge 1 commit into
base: 202405
Choose a base branch
from

Conversation

mssonicbld
Copy link
Collaborator

Description of PR

Summary:
In snappi tests, we have a number of tests with UDP streams. We need them to be counted sequentially instead of random, or any other order. This PR addresses some of the mistakes in the udp port count logic.

Type of change

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

Back port request

  • 202012
  • 202205
  • 202305
  • 202311
  • 202405
  • 202411

Approach

What is the motivation for this PR?

The tests fail in cisco-8000 due to backplane bandwidth limitations. The backplane bandwidth limit will be avoided if the number of streams we use in the traffic is large enough to cause load balancing across the backplane, so that many backplane ports are used instead of just one. This PR addresses some of the script locations where the udp port numbers are not correctly calculated.

How did you do it?

How did you verify/test it?

Ran it on my TB, with a -e --count=2 option, for repeating the tests 2 times:

=========================================================================================================== PASSES ===========================================================================================================
___________________________________________________________________________________ test_ecn_marking_port_toggle[multidut_port_info0-1-2] ____________________________________________________________________________________
___________________________________________________________________________________ test_ecn_marking_port_toggle[multidut_port_info0-2-2] ____________________________________________________________________________________
___________________________________________________________________________________ test_ecn_marking_port_toggle[multidut_port_info1-1-2] ____________________________________________________________________________________
___________________________________________________________________________________ test_ecn_marking_port_toggle[multidut_port_info1-2-2] ____________________________________________________________________________________
___________________________________________________________________________________ test_ecn_marking_port_toggle[multidut_port_info2-1-2] ____________________________________________________________________________________
___________________________________________________________________________________ test_ecn_marking_port_toggle[multidut_port_info2-2-2] ____________________________________________________________________________________
___________________________________________________________________________________ test_ecn_marking_port_toggle[multidut_port_info3-1-2] ____________________________________________________________________________________
___________________________________________________________________________________ test_ecn_marking_port_toggle[multidut_port_info3-2-2] ____________________________________________________________________________________
_________________________________________________________________________ test_ecn_marking_lossless_prio[multidut_port_info1-test_flow_percent0-1-2] _________________________________________________________________________
_________________________________________________________________________ test_ecn_marking_lossless_prio[multidut_port_info1-test_flow_percent0-2-2] _________________________________________________________________________
_________________________________________________________________________ test_ecn_marking_lossless_prio[multidut_port_info1-test_flow_percent1-1-2] _________________________________________________________________________
_________________________________________________________________________ test_ecn_marking_lossless_prio[multidut_port_info1-test_flow_percent1-2-2] _________________________________________________________________________
_________________________________________________________________________ test_ecn_marking_lossless_prio[multidut_port_info1-test_flow_percent2-1-2] _________________________________________________________________________
_________________________________________________________________________ test_ecn_marking_lossless_prio[multidut_port_info1-test_flow_percent2-2-2] _________________________________________________________________________
_________________________________________________________________________ test_ecn_marking_lossless_prio[multidut_port_info1-test_flow_percent3-1-2] _________________________________________________________________________
_________________________________________________________________________ test_ecn_marking_lossless_prio[multidut_port_info1-test_flow_percent3-2-2] _________________________________________________________________________
_________________________________________________________________________ test_ecn_marking_lossless_prio[multidut_port_info1-test_flow_percent4-1-2] _________________________________________________________________________
_________________________________________________________________________ test_ecn_marking_lossless_prio[multidut_port_info1-test_flow_percent4-2-2] _________________________________________________________________________
_________________________________________________________________________ test_ecn_marking_lossless_prio[multidut_port_info1-test_flow_percent5-1-2] _________________________________________________________________________
_________________________________________________________________________ test_ecn_marking_lossless_prio[multidut_port_info1-test_flow_percent5-2-2] _________________________________________________________________________
_________________________________________________________________________ test_ecn_marking_lossless_prio[multidut_port_info1-test_flow_percent6-1-2] _________________________________________________________________________
_________________________________________________________________________ test_ecn_marking_lossless_prio[multidut_port_info1-test_flow_percent6-2-2] _________________________________________________________________________
_________________________________________________________________________ test_ecn_marking_lossless_prio[multidut_port_info1-test_flow_percent7-1-2] _________________________________________________________________________
_________________________________________________________________________ test_ecn_marking_lossless_prio[multidut_port_info1-test_flow_percent7-2-2] _________________________________________________________________________
---------------------------------------------------------------- generated xml file: /run_logs/ixia/ecn_repeat/2025-01-08-22-40-28/tr_2025-01-08-22-40-28.xml ----------------------------------------------------------------
INFO:root:Can not get Allure report URL. Please check logs
================================================================================================== short test summary info ===================================================================================================
PASSED snappi_tests/multidut/ecn/test_multidut_ecn_marking_with_snappi.py::test_ecn_marking_port_toggle[multidut_port_info0-1-2]
PASSED snappi_tests/multidut/ecn/test_multidut_ecn_marking_with_snappi.py::test_ecn_marking_port_toggle[multidut_port_info0-2-2]
PASSED snappi_tests/multidut/ecn/test_multidut_ecn_marking_with_snappi.py::test_ecn_marking_port_toggle[multidut_port_info1-1-2]
PASSED snappi_tests/multidut/ecn/test_multidut_ecn_marking_with_snappi.py::test_ecn_marking_port_toggle[multidut_port_info1-2-2]
PASSED snappi_tests/multidut/ecn/test_multidut_ecn_marking_with_snappi.py::test_ecn_marking_port_toggle[multidut_port_info2-1-2]
PASSED snappi_tests/multidut/ecn/test_multidut_ecn_marking_with_snappi.py::test_ecn_marking_port_toggle[multidut_port_info2-2-2]
PASSED snappi_tests/multidut/ecn/test_multidut_ecn_marking_with_snappi.py::test_ecn_marking_port_toggle[multidut_port_info3-1-2]
PASSED snappi_tests/multidut/ecn/test_multidut_ecn_marking_with_snappi.py::test_ecn_marking_port_toggle[multidut_port_info3-2-2]
PASSED snappi_tests/multidut/ecn/test_multidut_ecn_marking_with_snappi.py::test_ecn_marking_lossless_prio[multidut_port_info1-test_flow_percent0-1-2]
PASSED snappi_tests/multidut/ecn/test_multidut_ecn_marking_with_snappi.py::test_ecn_marking_lossless_prio[multidut_port_info1-test_flow_percent0-2-2]
PASSED snappi_tests/multidut/ecn/test_multidut_ecn_marking_with_snappi.py::test_ecn_marking_lossless_prio[multidut_port_info1-test_flow_percent1-1-2]
PASSED snappi_tests/multidut/ecn/test_multidut_ecn_marking_with_snappi.py::test_ecn_marking_lossless_prio[multidut_port_info1-test_flow_percent1-2-2]
PASSED snappi_tests/multidut/ecn/test_multidut_ecn_marking_with_snappi.py::test_ecn_marking_lossless_prio[multidut_port_info1-test_flow_percent2-1-2]
PASSED snappi_tests/multidut/ecn/test_multidut_ecn_marking_with_snappi.py::test_ecn_marking_lossless_prio[multidut_port_info1-test_flow_percent2-2-2]
PASSED snappi_tests/multidut/ecn/test_multidut_ecn_marking_with_snappi.py::test_ecn_marking_lossless_prio[multidut_port_info1-test_flow_percent3-1-2]
PASSED snappi_tests/multidut/ecn/test_multidut_ecn_marking_with_snappi.py::test_ecn_marking_lossless_prio[multidut_port_info1-test_flow_percent3-2-2]
PASSED snappi_tests/multidut/ecn/test_multidut_ecn_marking_with_snappi.py::test_ecn_marking_lossless_prio[multidut_port_info1-test_flow_percent4-1-2]
PASSED snappi_tests/multidut/ecn/test_multidut_ecn_marking_with_snappi.py::test_ecn_marking_lossless_prio[multidut_port_info1-test_flow_percent4-2-2]
PASSED snappi_tests/multidut/ecn/test_multidut_ecn_marking_with_snappi.py::test_ecn_marking_lossless_prio[multidut_port_info1-test_flow_percent5-1-2]
PASSED snappi_tests/multidut/ecn/test_multidut_ecn_marking_with_snappi.py::test_ecn_marking_lossless_prio[multidut_port_info1-test_flow_percent5-2-2]
PASSED snappi_tests/multidut/ecn/test_multidut_ecn_marking_with_snappi.py::test_ecn_marking_lossless_prio[multidut_port_info1-test_flow_percent6-1-2]
PASSED snappi_tests/multidut/ecn/test_multidut_ecn_marking_with_snappi.py::test_ecn_marking_lossless_prio[multidut_port_info1-test_flow_percent6-2-2]
PASSED snappi_tests/multidut/ecn/test_multidut_ecn_marking_with_snappi.py::test_ecn_marking_lossless_prio[multidut_port_info1-test_flow_percent7-1-2]
PASSED snappi_tests/multidut/ecn/test_multidut_ecn_marking_with_snappi.py::test_ecn_marking_lossless_prio[multidut_port_info1-test_flow_percent7-2-2]
SKIPPED [16] common/helpers/assertions.py:16: ECN tests are not supported on Cisco switches yet.
SKIPPED [48] common/helpers/assertions.py:16: Invalid combination of duthosts or ASICs in snappi_ports
================================================================================= 24 passed, 64 skipped, 28 warnings in 12774.71s (3:32:54) ==================================================================================
sonic@snappi-sonic-mgmt-vanilla-202405-t2:/data/tests$ 

Description of PR
Summary:
In snappi tests, we have a number of tests with UDP streams. We need them to be counted sequentially instead of random, or any other order. This PR addresses some of the mistakes in the udp port count logic.

Approach
What is the motivation for this PR?
The tests fail in cisco-8000 due to backplane bandwidth limitations. The backplane bandwidth limit will be avoided if the number of streams we use in the traffic is large enough to cause load balancing across the backplane, so that many backplane ports are used instead of just one. This PR addresses some of the script locations where the udp port numbers are not correctly calculated.

How did you do it?
How did you verify/test it?
Ran it on my TB, with a -e --count=2 option, for repeating the tests 2 times:

=========================================================================================================== PASSES ===========================================================================================================
___________________________________________________________________________________ test_ecn_marking_port_toggle[multidut_port_info0-1-2] ____________________________________________________________________________________
___________________________________________________________________________________ test_ecn_marking_port_toggle[multidut_port_info0-2-2] ____________________________________________________________________________________
___________________________________________________________________________________ test_ecn_marking_port_toggle[multidut_port_info1-1-2] ____________________________________________________________________________________
___________________________________________________________________________________ test_ecn_marking_port_toggle[multidut_port_info1-2-2] ____________________________________________________________________________________
___________________________________________________________________________________ test_ecn_marking_port_toggle[multidut_port_info2-1-2] ____________________________________________________________________________________
___________________________________________________________________________________ test_ecn_marking_port_toggle[multidut_port_info2-2-2] ____________________________________________________________________________________
___________________________________________________________________________________ test_ecn_marking_port_toggle[multidut_port_info3-1-2] ____________________________________________________________________________________
___________________________________________________________________________________ test_ecn_marking_port_toggle[multidut_port_info3-2-2] ____________________________________________________________________________________
_________________________________________________________________________ test_ecn_marking_lossless_prio[multidut_port_info1-test_flow_percent0-1-2] _________________________________________________________________________
_________________________________________________________________________ test_ecn_marking_lossless_prio[multidut_port_info1-test_flow_percent0-2-2] _________________________________________________________________________
_________________________________________________________________________ test_ecn_marking_lossless_prio[multidut_port_info1-test_flow_percent1-1-2] _________________________________________________________________________
_________________________________________________________________________ test_ecn_marking_lossless_prio[multidut_port_info1-test_flow_percent1-2-2] _________________________________________________________________________
_________________________________________________________________________ test_ecn_marking_lossless_prio[multidut_port_info1-test_flow_percent2-1-2] _________________________________________________________________________
_________________________________________________________________________ test_ecn_marking_lossless_prio[multidut_port_info1-test_flow_percent2-2-2] _________________________________________________________________________
_________________________________________________________________________ test_ecn_marking_lossless_prio[multidut_port_info1-test_flow_percent3-1-2] _________________________________________________________________________
_________________________________________________________________________ test_ecn_marking_lossless_prio[multidut_port_info1-test_flow_percent3-2-2] _________________________________________________________________________
_________________________________________________________________________ test_ecn_marking_lossless_prio[multidut_port_info1-test_flow_percent4-1-2] _________________________________________________________________________
_________________________________________________________________________ test_ecn_marking_lossless_prio[multidut_port_info1-test_flow_percent4-2-2] _________________________________________________________________________
_________________________________________________________________________ test_ecn_marking_lossless_prio[multidut_port_info1-test_flow_percent5-1-2] _________________________________________________________________________
_________________________________________________________________________ test_ecn_marking_lossless_prio[multidut_port_info1-test_flow_percent5-2-2] _________________________________________________________________________
_________________________________________________________________________ test_ecn_marking_lossless_prio[multidut_port_info1-test_flow_percent6-1-2] _________________________________________________________________________
_________________________________________________________________________ test_ecn_marking_lossless_prio[multidut_port_info1-test_flow_percent6-2-2] _________________________________________________________________________
_________________________________________________________________________ test_ecn_marking_lossless_prio[multidut_port_info1-test_flow_percent7-1-2] _________________________________________________________________________
_________________________________________________________________________ test_ecn_marking_lossless_prio[multidut_port_info1-test_flow_percent7-2-2] _________________________________________________________________________
---------------------------------------------------------------- generated xml file: /run_logs/ixia/ecn_repeat/2025-01-08-22-40-28/tr_2025-01-08-22-40-28.xml ----------------------------------------------------------------
INFO:root:Can not get Allure report URL. Please check logs
================================================================================================== short test summary info ===================================================================================================
PASSED snappi_tests/multidut/ecn/test_multidut_ecn_marking_with_snappi.py::test_ecn_marking_port_toggle[multidut_port_info0-1-2]
PASSED snappi_tests/multidut/ecn/test_multidut_ecn_marking_with_snappi.py::test_ecn_marking_port_toggle[multidut_port_info0-2-2]
PASSED snappi_tests/multidut/ecn/test_multidut_ecn_marking_with_snappi.py::test_ecn_marking_port_toggle[multidut_port_info1-1-2]
PASSED snappi_tests/multidut/ecn/test_multidut_ecn_marking_with_snappi.py::test_ecn_marking_port_toggle[multidut_port_info1-2-2]
PASSED snappi_tests/multidut/ecn/test_multidut_ecn_marking_with_snappi.py::test_ecn_marking_port_toggle[multidut_port_info2-1-2]
PASSED snappi_tests/multidut/ecn/test_multidut_ecn_marking_with_snappi.py::test_ecn_marking_port_toggle[multidut_port_info2-2-2]
PASSED snappi_tests/multidut/ecn/test_multidut_ecn_marking_with_snappi.py::test_ecn_marking_port_toggle[multidut_port_info3-1-2]
PASSED snappi_tests/multidut/ecn/test_multidut_ecn_marking_with_snappi.py::test_ecn_marking_port_toggle[multidut_port_info3-2-2]
PASSED snappi_tests/multidut/ecn/test_multidut_ecn_marking_with_snappi.py::test_ecn_marking_lossless_prio[multidut_port_info1-test_flow_percent0-1-2]
PASSED snappi_tests/multidut/ecn/test_multidut_ecn_marking_with_snappi.py::test_ecn_marking_lossless_prio[multidut_port_info1-test_flow_percent0-2-2]
PASSED snappi_tests/multidut/ecn/test_multidut_ecn_marking_with_snappi.py::test_ecn_marking_lossless_prio[multidut_port_info1-test_flow_percent1-1-2]
PASSED snappi_tests/multidut/ecn/test_multidut_ecn_marking_with_snappi.py::test_ecn_marking_lossless_prio[multidut_port_info1-test_flow_percent1-2-2]
PASSED snappi_tests/multidut/ecn/test_multidut_ecn_marking_with_snappi.py::test_ecn_marking_lossless_prio[multidut_port_info1-test_flow_percent2-1-2]
PASSED snappi_tests/multidut/ecn/test_multidut_ecn_marking_with_snappi.py::test_ecn_marking_lossless_prio[multidut_port_info1-test_flow_percent2-2-2]
PASSED snappi_tests/multidut/ecn/test_multidut_ecn_marking_with_snappi.py::test_ecn_marking_lossless_prio[multidut_port_info1-test_flow_percent3-1-2]
PASSED snappi_tests/multidut/ecn/test_multidut_ecn_marking_with_snappi.py::test_ecn_marking_lossless_prio[multidut_port_info1-test_flow_percent3-2-2]
PASSED snappi_tests/multidut/ecn/test_multidut_ecn_marking_with_snappi.py::test_ecn_marking_lossless_prio[multidut_port_info1-test_flow_percent4-1-2]
PASSED snappi_tests/multidut/ecn/test_multidut_ecn_marking_with_snappi.py::test_ecn_marking_lossless_prio[multidut_port_info1-test_flow_percent4-2-2]
PASSED snappi_tests/multidut/ecn/test_multidut_ecn_marking_with_snappi.py::test_ecn_marking_lossless_prio[multidut_port_info1-test_flow_percent5-1-2]
PASSED snappi_tests/multidut/ecn/test_multidut_ecn_marking_with_snappi.py::test_ecn_marking_lossless_prio[multidut_port_info1-test_flow_percent5-2-2]
PASSED snappi_tests/multidut/ecn/test_multidut_ecn_marking_with_snappi.py::test_ecn_marking_lossless_prio[multidut_port_info1-test_flow_percent6-1-2]
PASSED snappi_tests/multidut/ecn/test_multidut_ecn_marking_with_snappi.py::test_ecn_marking_lossless_prio[multidut_port_info1-test_flow_percent6-2-2]
PASSED snappi_tests/multidut/ecn/test_multidut_ecn_marking_with_snappi.py::test_ecn_marking_lossless_prio[multidut_port_info1-test_flow_percent7-1-2]
PASSED snappi_tests/multidut/ecn/test_multidut_ecn_marking_with_snappi.py::test_ecn_marking_lossless_prio[multidut_port_info1-test_flow_percent7-2-2]
SKIPPED [16] common/helpers/assertions.py:16: ECN tests are not supported on Cisco switches yet.
SKIPPED [48] common/helpers/assertions.py:16: Invalid combination of duthosts or ASICs in snappi_ports
================================================================================= 24 passed, 64 skipped, 28 warnings in 12774.71s (3:32:54) ==================================================================================
sonic@snappi-sonic-mgmt-vanilla-202405-t2:/data/tests$ 

co-authorized by: [email protected]
@mssonicbld
Copy link
Collaborator Author

/azp run

@mssonicbld
Copy link
Collaborator Author

Original PR: #16394

Copy link

Azure Pipelines successfully started running 1 pipeline(s).

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.

2 participants