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

[Snappi] New testcases for PFC-ECN. #13865

Merged

Conversation

amitpawar12
Copy link
Contributor

@amitpawar12 amitpawar12 commented Jul 29, 2024

Description of PR

This pull-request has changes specifically for the following commit-IDs:
a82b489
180af4d
3da40bc

This PR specifically handles the testcases pertaining to the new PFC-ECN testplan added.

Summary:
Fixes # (issue)
#13655
#13215

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?

Three test-scripts have been added to specifically test: non-congestion scenarios (line-rate tests), congestion testcases via over-subscription and PFCWD (drop and forward mode).

How did you do it?

  1. Test case has dictionary called test_def which defines various testcases parameters necessary to run the testcase. An example of this, is packet-size (default is IMIX but can be changed to 1024B), test-duration, stats capture, file log at the end of the test.

  2. Similarly, there is test_check which passes test-case uses for verification info. Lossless and lossy priorities are selected from the available list.

  3. Most important change comes in form of port_map definition. Port map is a list with first two parameters defining the egress port count and egress speed. Last two parameters define the ingress port count and ingress speed. Example - [1, 100, 2 , 100] defines single egress port of speed 100Gbps and 2 ingress ports of 100Gbps.
    This definition is important because, multi-speed ingress and egress ports needs to be supported. Example - [1, 100, 1, 400] will define single ingress and egress of 400Gbps and 100Gbps respectively.

  4. A new function is provided to capture snappi_ports. This will pick the line-card choice from variable.py and choose the ports as defined in port_map. The port_map is used to filter out the available ports for the required port-speed.

  5. At the end of the test, a CSV is created as raw data for the test-case execution. Summary of the test-case is generated in form of text file with same name. Additional checks are present in multi_dut helper file, depending upon the type of the test. The test passes the verification parameters in test_check in dictionary format.

  6. There is important change in variables.py file. The line_card_choice is sent as dictionary from variables.py, which then is parameterized in the test. Depending upon the type of line_card_choice, the tests are ran for that specific line_card choice and set of ports.

  7. Testcases:
    a. tests/snappi_tests/pfc/test_pfc_no_congestion_throughput.py:
    -- This testcase has testcases to test line-rate speeds with single ingress and egress. Traffic combination around lossless and lossy priorities have been used. Expectations is that no PFCs will be generated, line-rate will be achieved, no drops will be seen on both DUT and TGEN.
    b. tests/snappi_tests/pfc/test_pfc_port_congestion.py:
    -- This testcase has testcases to test behavior with 2 ingress ports and 1 egress port on the DUT. Traffic combination around lossless and lossy priorities.
    c. tests/snappi_tests/pfcwd/test_pfcwd_actions.py:
    -- Testcases cover PFCWD action - DROP and FORWARD mode. DROP and FORWARD mode is also tested for two ingresses and single egress with pause frames on egress.

How did you verify/test it?

Test case was executed on local clone.

Results of the verification:

  • Test cases executed for 100Gbps interfaces.
  • Two combinations - single-line-card-multi-asic and multiple-dut
    Non-congestion:
19:06:48 test_sys_non_congestion.test_multiple_pr L0095 INFO   | Running test for testbed subtype: single-dut-multi-asic
19:15:21 traffic_generation.run_sys_traffic       L1190 INFO   | Writing statistics to file : /tmp/Single_Ingress_Egress_diff_dist_100Gbps_single-dut-multi-asic_1024B-2024-10-08-19-15.csv
PASSED                                                                                                                                                                                                                                        [ 16%]
snappi_tests/multidut/systest/test_sys_non_congestion.py::test_multiple_prio_diff_dist[multidut_port_info1-port_map0] 
19:15:26 test_sys_non_congestion.test_multiple_pr L0095 INFO   | Running test for testbed subtype: single-dut-single-asic
19:23:37 traffic_generation.run_sys_traffic       L1190 INFO   | Writing statistics to file : /tmp/Single_Ingress_Egress_diff_dist_100Gbps_single-dut-single-asic_1024B-2024-10-08-19-23.csv
PASSED                                                                                                                                                                                                                                        [ 33%]
snappi_tests/multidut/systest/test_sys_non_congestion.py::test_multiple_prio_uni_dist[multidut_port_info0-port_map0] 
19:23:42 test_sys_non_congestion.test_multiple_pr L0235 INFO   | Running test for testbed subtype: single-dut-multi-asic
19:31:57 traffic_generation.run_sys_traffic       L1190 INFO   | Writing statistics to file : /tmp/Single_Ingress_Egress_uni_dist_100Gbps_single-dut-multi-asic_1024B-2024-10-08-19-31.csv
PASSED                                                                                                                                                                                                                                        [ 50%]
snappi_tests/multidut/systest/test_sys_non_congestion.py::test_multiple_prio_uni_dist[multidut_port_info1-port_map0] 
19:32:02 test_sys_non_congestion.test_multiple_pr L0235 INFO   | Running test for testbed subtype: single-dut-single-asic
19:40:12 traffic_generation.run_sys_traffic       L1190 INFO   | Writing statistics to file : /tmp/Single_Ingress_Egress_uni_dist_100Gbps_single-dut-single-asic_1024B-2024-10-08-19-40.csv
PASSED                                                                                                                                                                                                                                        [ 66%]
snappi_tests/multidut/systest/test_sys_non_congestion.py::test_single_lossless_prio[multidut_port_info0-port_map0] 
19:40:18 test_sys_non_congestion.test_single_loss L0375 INFO   | Running test for testbed subtype: single-dut-multi-asic
19:48:26 traffic_generation.run_sys_traffic       L1190 INFO   | Writing statistics to file : /tmp/Single_Ingress_Egress_1Prio_linerate_100Gbps_single-dut-multi-asic_1024B-2024-10-08-19-48.csv
PASSED                                                                                                                                                                                                                                        [ 83%]
snappi_tests/multidut/systest/test_sys_non_congestion.py::test_single_lossless_prio[multidut_port_info1-port_map0] 
19:48:31 test_sys_non_congestion.test_single_loss L0375 INFO   | Running test for testbed subtype: single-dut-single-asic
19:56:38 traffic_generation.run_sys_traffic       L1190 INFO   | Writing statistics to file : /tmp/Single_Ingress_Egress_1Prio_linerate_100Gbps_single-dut-single-asic_1024B-2024-10-08-19-56.csv
PASSED                                                                                                                                                                                                                                        [100%]
 

Over-subscription:

20:13:40 test_sys_over_subscription.test_multiple L0093 INFO   | Running test for testbed subtype: single-dut-multi-asic
20:23:07 traffic_generation.run_sys_traffic       L1190 INFO   | Writing statistics to file : /tmp/Two_Ingress_Single_Egress_diff_dist_100Gbps_single-dut-multi-asic_1024B-2024-10-08-20-23.csv
PASSED                                                                                                                                                                                                                                        [ 12%]
snappi_tests/multidut/systest/test_sys_over_subscription.py::test_multiple_prio_diff_dist[multidut_port_info1-port_map0] 
20:23:16 test_sys_over_subscription.test_multiple L0093 INFO   | Running test for testbed subtype: single-dut-single-asic
20:32:20 traffic_generation.run_sys_traffic       L1190 INFO   | Writing statistics to file : /tmp/Two_Ingress_Single_Egress_diff_dist_100Gbps_single-dut-single-asic_1024B-2024-10-08-20-32.csv
PASSED                                                                                                                                                                                                                                        [ 25%]
snappi_tests/multidut/systest/test_sys_over_subscription.py::test_multiple_prio_uni_dist[multidut_port_info0-port_map0] 
20:32:29 test_sys_over_subscription.test_multiple L0227 INFO   | Running test for testbed subtype: single-dut-multi-asic
20:41:39 traffic_generation.run_sys_traffic       L1190 INFO   | Writing statistics to file : /tmp/Two_Ingress_Single_Egress_uni_dist_full100Gbps_single-dut-multi-asic_1024B-2024-10-08-20-41.csv
PASSED                                                                                                                                                                                                                                        [ 37%]
snappi_tests/multidut/systest/test_sys_over_subscription.py::test_multiple_prio_uni_dist[multidut_port_info1-port_map0] 
20:41:48 test_sys_over_subscription.test_multiple L0227 INFO   | Running test for testbed subtype: single-dut-single-asic
20:50:53 traffic_generation.run_sys_traffic       L1190 INFO   | Writing statistics to file : /tmp/Two_Ingress_Single_Egress_uni_dist_full100Gbps_single-dut-single-asic_1024B-2024-10-08-20-50.csv
PASSED                                                                                                                                                                                                                                        [ 50%]
snappi_tests/multidut/systest/test_sys_over_subscription.py::test_multiple_prio_uni_dist_full[multidut_port_info0-port_map0] 
20:51:02 test_sys_over_subscription.test_multiple L0364 INFO   | Running test for testbed subtype: single-dut-multi-asic
21:00:11 traffic_generation.run_sys_traffic       L1190 INFO   | Writing statistics to file : /tmp/Two_Ingress_Single_Egress_uni_dist_full100Gbps_single-dut-multi-asic_1024B-2024-10-08-21-00.csv
PASSED                                                                                                                                                                                                                                        [ 62%]
snappi_tests/multidut/systest/test_sys_over_subscription.py::test_multiple_prio_uni_dist_full[multidut_port_info1-port_map0] 
21:00:20 test_sys_over_subscription.test_multiple L0364 INFO   | Running test for testbed subtype: single-dut-single-asic
21:09:25 traffic_generation.run_sys_traffic       L1190 INFO   | Writing statistics to file : /tmp/Two_Ingress_Single_Egress_uni_dist_full100Gbps_single-dut-single-asic_1024B-2024-10-08-21-09.csv
PASSED                                                                                                                                                                                                                                        [ 75%]
snappi_tests/multidut/systest/test_sys_over_subscription.py::test_multiple_prio_non_cngtn[multidut_port_info0-port_map0] 
21:09:34 test_sys_over_subscription.test_multiple L0502 INFO   | Running test for testbed subtype: single-dut-multi-asic
21:18:38 traffic_generation.run_sys_traffic       L1190 INFO   | Writing statistics to file : /tmp/Two_Ingress_Single_Egress_non_cngstn_100Gbps_single-dut-multi-asic_1024B-2024-10-08-21-18.csv
PASSED                                                                                                                                                                                                                                        [ 87%]
snappi_tests/multidut/systest/test_sys_over_subscription.py::test_multiple_prio_non_cngtn[multidut_port_info1-port_map0] 
21:18:47 test_sys_over_subscription.test_multiple L0502 INFO   | Running test for testbed subtype: single-dut-single-asic
21:27:45 traffic_generation.run_sys_traffic       L1190 INFO   | Writing statistics to file : /tmp/Two_Ingress_Single_Egress_non_cngstn_100Gbps_single-dut-single-asic_1024B-2024-10-08-21-27.csv
PASSED                                                                                                                                                                                                                                        [100%]

PFCWD:

01:08:43 traffic_generation.run_sys_traffic       L1190 INFO   | Writing statistics to file : /tmp/One_Ingress_Egress_pfcwd_drop_90_10_dist100Gbps_single-dut-multi-asic_1024B-2024-10-09-01-08.csv
PASSED                                                                                                                                                                                                                                        [ 10%]
01:19:33 traffic_generation.run_sys_traffic       L1190 INFO   | Writing statistics to file : /tmp/One_Ingress_Egress_pfcwd_drop_90_10_dist100Gbps_single-dut-single-asic_1024B-2024-10-09-01-19.csv
PASSED                                                                                                                                                                                                                                        [ 20%]
01:30:32 traffic_generation.run_sys_traffic       L1190 INFO   | Writing statistics to file : /tmp/One_Ingress_Egress_pfcwd_frwd_90_10_dist100Gbps_single-dut-multi-asic_1024B-2024-10-09-01-30.csv
PASSED                                                                                                                                                                                                                                        [ 30%]
01:41:25 traffic_generation.run_sys_traffic       L1190 INFO   | Writing statistics to file : /tmp/One_Ingress_Egress_pfcwd_frwd_90_10_dist100Gbps_single-dut-single-asic_1024B-2024-10-09-01-41.csv
PASSED                                                                                                                                                                                                                                        [ 40%]
01:53:08 traffic_generation.run_sys_traffic       L1190 INFO   | Writing statistics to file : /tmp/Two_Ingress_Single_Egress_pfcwd_drop_40_9_dist100Gbps_single-dut-multi-asic_1024B-2024-10-09-01-53.csv
PASSED                                                                                                                                                                                                                                        [ 50%]
02:04:49 traffic_generation.run_sys_traffic       L1190 INFO   | Writing statistics to file : /tmp/Two_Ingress_Single_Egress_pfcwd_drop_40_9_dist100Gbps_single-dut-single-asic_1024B-2024-10-09-02-04.csv
PASSED                                                                                                                                                                                                                                        [ 60%]
02:16:26 traffic_generation.run_sys_traffic       L1190 INFO   | Writing statistics to file : /tmp/Two_Ingress_Single_Egress_pfcwd_frwd_40_9_dist100Gbps_single-dut-multi-asic_1024B-2024-10-09-02-16.csv
PASSED                                                                                                                                                                                                                                        [ 70%]
02:27:53 traffic_generation.run_sys_traffic       L1190 INFO   | Writing statistics to file : /tmp/Two_Ingress_Single_Egress_pfcwd_frwd_40_9_dist100Gbps_single-dut-single-asic_1024B-2024-10-09-02-27.csv
PASSED                                                                                                                                                                                                                                        [ 80%]
02:38:45 traffic_generation.run_sys_traffic       L1190 INFO   | Writing statistics to file : /tmp/Single_Ingress_Single_Egress_pause_cngstn_100Gbps_single-dut-multi-asic_1024B-2024-10-09-02-38.csv
PASSED                                                                                                                                                                                                                                        [ 90%]
02:49:22 traffic_generation.run_sys_traffic       L1190 INFO   | Writing statistics to file : /tmp/Single_Ingress_Single_Egress_pause_cngstn_100Gbps_single-dut-single-asic_1024B-2024-10-09-02-49.csv
PASSED                                                                                                                                                                                                                                        [100%]

Any platform specific information?

The testcases are specifically meant for Broadcom DNX Multi-ASIC platform DUT.

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

Documentation

@sdszhang
Copy link
Contributor

@vmittal-msft @kamalsahu0001 to review. Thanks.

@vmittal-msft vmittal-msft self-assigned this Aug 2, 2024

@pytest.mark.parametrize('linecard_configuration_set', [config_set])
@pytest.mark.parametrize('line_card_choice', line_card_choice)
def test_pfcwd_frwd_90_10(snappi_api, # noqa: F811
Copy link
Contributor

@zhixzhu zhixzhu Aug 16, 2024

Choose a reason for hiding this comment

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

Skip pfcwd forward mode case if cisco-8000.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I think the vendor-specific skip should be added by the corresponding team.

bg_prio_list (list): priorities of background flows
prio_dscp_map (dict): Priority vs. DSCP map (key = priority).
test_traffic_pause (bool): if test flows are expected to be paused
test_def['enable_pause'] (bool) : if test expects no pause flow traffic.
Copy link
Contributor

Choose a reason for hiding this comment

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

What's the difference between test_traffic_pause and test_def['enable_pause']?

Copy link
Contributor Author

@amitpawar12 amitpawar12 Oct 9, 2024

Choose a reason for hiding this comment

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

Addressed the comment. Just kept the test_traffic_pause to enable/disable pause frames in the test.

snappi_ports,
snappi_api)

test_prio_list = [3, 4]
Copy link
Contributor

Choose a reason for hiding this comment

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

can be replaced by fixture lossless_prio_list, and bg_prio_list can be replaced by fixture lossy_prio_list

Copy link
Contributor Author

Choose a reason for hiding this comment

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

This is replaced by fixture lossless_prio_list and bg_prio_list.

@rlhui rlhui assigned amitpawar12 and unassigned vmittal-msft Sep 1, 2024
@amitpawar12 amitpawar12 force-pushed the Snappi-Base-PR-13655-New-Testcases branch from fa00bb8 to 3da40bc Compare October 7, 2024 21:22
@amitpawar12
Copy link
Contributor Author

@vmittal-msft - There are failure in macsec/interop testcases in the above checks. The PR code has no changes in those code paths. Can you please restart the checks again for this PR?

Thanks in advance,
-A

@amitpawar12 amitpawar12 force-pushed the Snappi-Base-PR-13655-New-Testcases branch from b364cce to 3edc05b Compare October 29, 2024 17:31
@amitpawar12 amitpawar12 force-pushed the Snappi-Base-PR-13655-New-Testcases branch from 3edc05b to a0cdd58 Compare December 4, 2024 22:37
@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/pfc/test_pfc_port_congestion.py:19:1: E265 block comment should start with '# '
tests/snappi_tests/pfc/test_pfc_port_congestion.py:302:38: E127 continuation line over-indented for visual indent
tests/snappi_tests/pfc/test_pfc_port_congestion.py:303:38: E127 continuation line over-indented for visual indent
tests/snappi_tests/pfc/test_pfc_port_congestion.py:304:38: E127 continuation line over-indented for visual indent
tests/snappi_tests/pfc/test_pfc_port_congestion.py:305:38: E127 continuation line over-indented for visual indent
tests/snappi_tests/pfc/test_pfc_port_congestion.py:306:38: E127 continuation line over-indented for visual indent
tests/snappi_tests/pfc/test_pfc_port_congestion.py:307:38: E127 continuation line over-indented for visual indent
tests/snappi_tests/pfc/test_pfc_port_congestion.py:308:38: E127 continuation line over-indented for visual indent
tests/snappi_tests/pfc/test_pfc_port_congestion.py:309:38: E127 continuation line over-indented for visual indent
tests/snappi_tests/pfc/test_pfc_port_congestion.py:310:38: E127 continuation line over-indented for visual indent
tests/snappi_tests/pfc/test_pfc_port_congestion.py:311:38: E127 continuation line over-indented for visual indent
...
[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>

@amitpawar12 amitpawar12 force-pushed the Snappi-Base-PR-13655-New-Testcases branch from c477caa to 027c7dc Compare December 11, 2024 21:18
@amitpawar12
Copy link
Contributor Author

amitpawar12 commented Dec 18, 2024

pfc-oversubscription execution run output log:
results-pfc-over-subscription.txt

pfc-no-congestion execution run output log:
results-pfc-no-congestion.txt

pfcwd-actions execution run output log:
results-pfcwd-actions.txt

@amitpawar12 amitpawar12 force-pushed the Snappi-Base-PR-13655-New-Testcases branch from 027c7dc to d63efd4 Compare January 9, 2025 21:12
@mssonicbld
Copy link
Collaborator

/azp run

Copy link

Azure Pipelines successfully started running 1 pipeline(s).

@amitpawar12 amitpawar12 force-pushed the Snappi-Base-PR-13655-New-Testcases branch from d63efd4 to 553c5a3 Compare January 10, 2025 22:40
@mssonicbld
Copy link
Collaborator

/azp run

Copy link

Azure Pipelines successfully started running 1 pipeline(s).

@selldinesh
Copy link
Contributor

selldinesh commented Jan 13, 2025

OUTPUT on T0/T1 Run

snappi_tests/multidut/pfc/test_pfc_port_congestion.py::test_multiple_prio_equal_dist[multidut_port_info0-port_map0]
---------------------------------------------------------------------------------------- live log setup -----------------------------------------------------------------------------------------
00:36:47 init.set_default L0053 INFO | Completeness level not set during test execution. Setting to default level: CompletenessLevel.basic
00:36:47 init.check_test_completeness L0151 INFO | Test has no defined levels. Continue without test completeness checks
00:36:47 init.loganalyzer L0067 INFO | Log analyzer is disabled
00:36:47 init.memory_utilization L0091 INFO | Hostname: sonic-s6100-dut1, Hwsku: Accton-AS7726-32X, Platform: x86_64-accton_as7726_32x-r0
00:36:47 init.store_fixture_values L0017 INFO | store memory_utilization test_multiple_prio_equal_dist[multidut_port_info0-port_map0]
00:36:47 init.pytest_runtest_setup L0024 INFO | collect memory before test test_multiple_prio_equal_dist[multidut_port_info0-port_map0]
00:36:47 init.pytest_runtest_setup L0044 INFO | Before test: collected memory_values {'before_test': {'sonic-s6100-dut1': {'monit': {'memory_usage': 21.6}}}, 'after_test': {'sonic-s6100-dut1': {}}}
----------------------------------------------------------------------------------------- live log call -----------------------------------------------------------------------------------------
00:36:47 test_pfc_port_congestion.test_multiple_p L0364 INFO | Running test for testbed subtype: multi-dut-single-asic
00:36:47 snappi_fixtures.__intf_config_multidut L0963 INFO | Configuring Dut: sonic-s6100-dut1 with port Ethernet76 with IP 20.1.1.0/31
00:36:48 snappi_fixtures.__intf_config_multidut L0963 INFO | Configuring Dut: sonic-s6100-dut1 with port Ethernet72 with IP 20.1.1.2/31
00:36:49 snappi_fixtures.__intf_config_multidut L0963 INFO | Configuring Dut: sonic-s6100-dut1 with port Ethernet64 with IP 20.1.1.4/31
00:36:50 test_pfc_port_congestion.test_multiple_p L0398 INFO | Selected lossless :[3, 4] and lossy priorities:[2, 0] for the test
00:37:04 snappi_api.info L1132 INFO | Config validation 0.024s
00:37:05 snappi_api.info L1132 INFO | Ports configuration 0.250s
00:37:05 snappi_api.info L1132 INFO | Captures configuration 0.148s
00:37:14 snappi_api.info L1132 INFO | Location hosts ready [10.36.78.53] 2.077s
00:37:14 snappi_api.info L1132 INFO | Speed change not require due to redundant Layer1 config
00:37:14 snappi_api.info L1132 INFO | Aggregation mode speed change 0.017s
00:37:14 snappi_api.info L1132 INFO | Location configuration 8.557s
00:37:26 snappi_api.info L1132 INFO | Layer1 configuration 11.708s
00:37:26 snappi_api.info L1132 INFO | Lag Configuration 0.068s
00:37:26 snappi_api.info L1132 INFO | Convert device config : 0.509s
00:37:26 snappi_api.info L1132 INFO | Create IxNetwork device config : 0.000s
00:37:27 snappi_api.info L1132 INFO | Push IxNetwork device config : 0.262s
00:37:27 snappi_api.info L1132 INFO | Devices configuration 0.844s
00:37:34 snappi_api.info L1132 INFO | Flows configuration 7.180s
00:37:38 snappi_api.info L1132 INFO | Start interfaces 4.435s
00:37:39 snappi_api.info L1132 INFO | IxNet - The Traffic Item was modified. Please perform a Traffic Generate to update the associated traffic Flow Groups
00:37:39 traffic_generation.run_traffic_and_colle L0969 INFO | Wait for Arp to Resolve ...
00:38:11 traffic_generation.run_traffic_and_colle L1013 INFO | Starting transmit on all flows ...
00:38:16 snappi_api.info L1132 INFO | Flows generate/apply 4.489s
00:38:27 snappi_api.info L1132 INFO | Flows clear statistics 10.502s
00:38:27 snappi_api.info L1132 INFO | Captures start 0.000s
00:38:30 snappi_api.info L1132 INFO | Flows start 3.558s
00:38:36 traffic_generation.run_traffic_and_colle L1022 INFO | Polling DUT and tool for traffic statistics for 4 iterations and 308 seconds
00:38:36 traffic_generation.run_traffic_and_colle L1035 INFO | ----------- Collecting Stats for Iteration : 1 ------------
00:39:09 traffic_generation.run_traffic_and_colle L1049 INFO | Polling DUT for Egress Queue statistics
00:39:09 traffic_generation.run_traffic_and_colle L1056 INFO | Egress Queue Count for DUT:sonic-s6100-dut1 and Port:Ethernet76 - 112833837
00:39:10 traffic_generation.run_traffic_and_colle L1062 INFO | Ingress Queue Count for DUT:sonic-s6100-dut1 and Port:Ethernet64 - 0
00:39:11 traffic_generation.run_traffic_and_colle L1062 INFO | Ingress Queue Count for DUT:sonic-s6100-dut1 and Port:Ethernet72 - 0
00:39:12 traffic_generation.run_traffic_and_colle L1056 INFO | Egress Queue Count for DUT:sonic-s6100-dut1 and Port:Ethernet76 - 112844082
00:39:13 traffic_generation.run_traffic_and_colle L1062 INFO | Ingress Queue Count for DUT:sonic-s6100-dut1 and Port:Ethernet64 - 0
00:39:14 traffic_generation.run_traffic_and_colle L1062 INFO | Ingress Queue Count for DUT:sonic-s6100-dut1 and Port:Ethernet72 - 0
00:39:36 traffic_generation.run_traffic_and_colle L1066 INFO | ------------------------------------------------------------
00:39:36 traffic_generation.run_traffic_and_colle L1035 INFO | ----------- Collecting Stats for Iteration : 2 ------------
00:40:08 traffic_generation.run_traffic_and_colle L1049 INFO | Polling DUT for Egress Queue statistics
00:40:09 traffic_generation.run_traffic_and_colle L1056 INFO | Egress Queue Count for DUT:sonic-s6100-dut1 and Port:Ethernet76 - 264153882
00:40:10 traffic_generation.run_traffic_and_colle L1062 INFO | Ingress Queue Count for DUT:sonic-s6100-dut1 and Port:Ethernet64 - 0
00:40:11 traffic_generation.run_traffic_and_colle L1062 INFO | Ingress Queue Count for DUT:sonic-s6100-dut1 and Port:Ethernet72 - 0
00:40:12 traffic_generation.run_traffic_and_colle L1056 INFO | Egress Queue Count for DUT:sonic-s6100-dut1 and Port:Ethernet76 - 294247184
00:40:13 traffic_generation.run_traffic_and_colle L1062 INFO | Ingress Queue Count for DUT:sonic-s6100-dut1 and Port:Ethernet64 - 0
00:40:13 traffic_generation.run_traffic_and_colle L1062 INFO | Ingress Queue Count for DUT:sonic-s6100-dut1 and Port:Ethernet72 - 0
00:40:36 traffic_generation.run_traffic_and_colle L1066 INFO | ------------------------------------------------------------
00:40:36 traffic_generation.run_traffic_and_colle L1035 INFO | ----------- Collecting Stats for Iteration : 3 ------------
00:41:08 traffic_generation.run_traffic_and_colle L1049 INFO | Polling DUT for Egress Queue statistics
00:41:09 traffic_generation.run_traffic_and_colle L1056 INFO | Egress Queue Count for DUT:sonic-s6100-dut1 and Port:Ethernet76 - 445556940
00:41:10 traffic_generation.run_traffic_and_colle L1062 INFO | Ingress Queue Count for DUT:sonic-s6100-dut1 and Port:Ethernet64 - 0
00:41:11 traffic_generation.run_traffic_and_colle L1062 INFO | Ingress Queue Count for DUT:sonic-s6100-dut1 and Port:Ethernet72 - 0
00:41:12 traffic_generation.run_traffic_and_colle L1056 INFO | Egress Queue Count for DUT:sonic-s6100-dut1 and Port:Ethernet76 - 475749210
00:41:13 traffic_generation.run_traffic_and_colle L1062 INFO | Ingress Queue Count for DUT:sonic-s6100-dut1 and Port:Ethernet64 - 0
00:41:14 traffic_generation.run_traffic_and_colle L1062 INFO | Ingress Queue Count for DUT:sonic-s6100-dut1 and Port:Ethernet72 - 0
00:41:35 traffic_generation.run_traffic_and_colle L1066 INFO | ------------------------------------------------------------
00:41:35 traffic_generation.run_traffic_and_colle L1035 INFO | ----------- Collecting Stats for Iteration : 4 ------------
00:42:07 traffic_generation.run_traffic_and_colle L1049 INFO | Polling DUT for Egress Queue statistics
00:42:08 traffic_generation.run_traffic_and_colle L1056 INFO | Egress Queue Count for DUT:sonic-s6100-dut1 and Port:Ethernet76 - 626968956
00:42:09 traffic_generation.run_traffic_and_colle L1062 INFO | Ingress Queue Count for DUT:sonic-s6100-dut1 and Port:Ethernet64 - 0
00:42:10 traffic_generation.run_traffic_and_colle L1062 INFO | Ingress Queue Count for DUT:sonic-s6100-dut1 and Port:Ethernet72 - 0
00:42:11 traffic_generation.run_traffic_and_colle L1056 INFO | Egress Queue Count for DUT:sonic-s6100-dut1 and Port:Ethernet76 - 657197470
00:42:12 traffic_generation.run_traffic_and_colle L1062 INFO | Ingress Queue Count for DUT:sonic-s6100-dut1 and Port:Ethernet64 - 0
00:42:13 traffic_generation.run_traffic_and_colle L1062 INFO | Ingress Queue Count for DUT:sonic-s6100-dut1 and Port:Ethernet72 - 0
00:42:35 traffic_generation.run_traffic_and_colle L1066 INFO | ------------------------------------------------------------
00:42:35 traffic_generation.run_traffic_and_colle L1072 INFO | Checking if all flows have stopped. Attempt #1
00:42:52 traffic_generation.run_traffic_and_colle L1072 INFO | Checking if all flows have stopped. Attempt #2
00:43:08 traffic_generation.run_traffic_and_colle L1072 INFO | Checking if all flows have stopped. Attempt #3
00:43:24 traffic_generation.run_traffic_and_colle L1072 INFO | Checking if all flows have stopped. Attempt #4
00:43:40 traffic_generation.run_traffic_and_colle L1072 INFO | Checking if all flows have stopped. Attempt #5
00:43:41 traffic_generation.run_traffic_and_colle L1084 INFO | Stopping transmit on all remaining flows
00:43:48 snappi_api.info L1132 INFO | Flows stop 6.271s
00:44:03 traffic_generation.run_traffic_and_colle L1072 INFO | Checking if all flows have stopped. Attempt #6
00:44:04 traffic_generation.run_traffic_and_colle L1079 INFO | All test and background traffic flows stopped
00:44:06 traffic_generation.run_traffic_and_colle L1107 INFO | Dumping per-flow statistics for final row
00:44:40 traffic_generation.run_traffic_and_colle L1124 INFO | Queue count for DUT: sonic-s6100-dut1, Port:Ethernet76 is 942275097
00:44:41 traffic_generation.run_traffic_and_colle L1124 INFO | Queue count for DUT: sonic-s6100-dut1, Port:Ethernet72 is 0
00:44:42 traffic_generation.run_traffic_and_colle L1124 INFO | Queue count for DUT: sonic-s6100-dut1, Port:Ethernet64 is 0
00:44:43 traffic_generation.run_traffic_and_colle L1124 INFO | Queue count for DUT: sonic-s6100-dut1, Port:Ethernet76 is 942275078
00:44:44 traffic_generation.run_traffic_and_colle L1124 INFO | Queue count for DUT: sonic-s6100-dut1, Port:Ethernet72 is 0
00:44:45 traffic_generation.run_traffic_and_colle L1124 INFO | Queue count for DUT: sonic-s6100-dut1, Port:Ethernet64 is 0
00:44:56 traffic_generation.run_traffic_and_colle L1246 INFO | Writing statistics to file : /tmp/Two_Ingress_Single_Egress_equal_dist100Gbps_multi-dut-single-asic_1024B-2024-12-11-00-44.csv
00:44:56 pfc_congestion_helper.run_pfc_test L0304 INFO | Lossless Drop %:0.0, Lossy Drop %:0.18
00:44:56 snappi_fixtures.cleanup_config L1127 INFO | Removing Configuration on Dut: sonic-s6100-dut1 with port Ethernet76 with ip :20.1.1.0/31
00:44:57 snappi_fixtures.cleanup_config L1127 INFO | Removing Configuration on Dut: sonic-s6100-dut1 with port Ethernet72 with ip :20.1.1.2/31
00:44:58 snappi_fixtures.cleanup_config L1127 INFO | Removing Configuration on Dut: sonic-s6100-dut1 with port Ethernet64 with ip :20.1.1.4/31
PASSED [ 75%]
--------------------------------------------------------------------------------------- live log teardown ---------------------------------------------------------------------------------------
00:44:59 init.pytest_runtest_teardown L0049 INFO | collect memory after test test_multiple_prio_equal_dist[multidut_port_info0-port_map0]
00:44:59 init.pytest_runtest_teardown L0072 INFO | After test: collected memory_values {'before_test': {'sonic-s6100-dut1': {'monit': {'memory_usage': 21.6}}}, 'after_test': {'sonic-s6100-dut1': {'monit': {'memory_usage': 21.9}}}}

@sdszhang
Copy link
Contributor

@amitpawar12 The infra change has been merged. Can you resolve the conflict.

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.

pls rebase to get latest change after #13864

@amitpawar12 amitpawar12 force-pushed the Snappi-Base-PR-13655-New-Testcases branch from 553c5a3 to 5d33073 Compare January 14, 2025 19:44
@mssonicbld
Copy link
Collaborator

/azp run

Copy link

Azure Pipelines successfully started running 1 pipeline(s).

@yejianquan yejianquan merged commit 35f5d8b into sonic-net:master Jan 15, 2025
22 checks passed
mssonicbld pushed a commit to mssonicbld/sonic-mgmt that referenced this pull request Jan 15, 2025
Description of PR
This pull-request has changes specifically for the following commit-IDs:
a82b489
180af4d
3da40bc

This PR specifically handles the testcases pertaining to the new PFC-ECN testplan added.

Summary:
Fixes # (issue)
sonic-net#13655
sonic-net#13215

Approach
What is the motivation for this PR?
Three test-scripts have been added to specifically test: non-congestion scenarios (line-rate tests), congestion testcases via over-subscription and PFCWD (drop and forward mode).

How did you do it?
Test case has dictionary called test_def which defines various testcases parameters necessary to run the testcase. An example of this, is packet-size (default is IMIX but can be changed to 1024B), test-duration, stats capture, file log at the end of the test.

Similarly, there is test_check which passes test-case uses for verification info. Lossless and lossy priorities are selected from the available list.

Most important change comes in form of port_map definition. Port map is a list with first two parameters defining the egress port count and egress speed. Last two parameters define the ingress port count and ingress speed. Example - [1, 100, 2 , 100] defines single egress port of speed 100Gbps and 2 ingress ports of 100Gbps.
This definition is important because, multi-speed ingress and egress ports needs to be supported. Example - [1, 100, 1, 400] will define single ingress and egress of 400Gbps and 100Gbps respectively.

A new function is provided to capture snappi_ports. This will pick the line-card choice from variable.py and choose the ports as defined in port_map. The port_map is used to filter out the available ports for the required port-speed.

At the end of the test, a CSV is created as raw data for the test-case execution. Summary of the test-case is generated in form of text file with same name. Additional checks are present in multi_dut helper file, depending upon the type of the test. The test passes the verification parameters in test_check in dictionary format.

There is important change in variables.py file. The line_card_choice is sent as dictionary from variables.py, which then is parameterized in the test. Depending upon the type of line_card_choice, the tests are ran for that specific line_card choice and set of ports.

Testcases:
a. tests/snappi_tests/pfc/test_pfc_no_congestion_throughput.py:
-- This testcase has testcases to test line-rate speeds with single ingress and egress. Traffic combination around lossless and lossy priorities have been used. Expectations is that no PFCs will be generated, line-rate will be achieved, no drops will be seen on both DUT and TGEN.
b. tests/snappi_tests/pfc/test_pfc_port_congestion.py:
-- This testcase has testcases to test behavior with 2 ingress ports and 1 egress port on the DUT. Traffic combination around lossless and lossy priorities.
c. tests/snappi_tests/pfcwd/test_pfcwd_actions.py:
-- Testcases cover PFCWD action - DROP and FORWARD mode. DROP and FORWARD mode is also tested for two ingresses and single egress with pause frames on egress.

How did you verify/test it?
Test case was executed on local clone.

Results of the verification:

Test cases executed for 100Gbps interfaces.
Two combinations - single-line-card-multi-asic and multiple-dut
Non-congestion:
19:06:48 test_sys_non_congestion.test_multiple_pr L0095 INFO   | Running test for testbed subtype: single-dut-multi-asic
19:15:21 traffic_generation.run_sys_traffic       L1190 INFO   | Writing statistics to file : /tmp/Single_Ingress_Egress_diff_dist_100Gbps_single-dut-multi-asic_1024B-2024-10-08-19-15.csv
PASSED                                                                                                                                                                                                                                        [ 16%]
snappi_tests/multidut/systest/test_sys_non_congestion.py::test_multiple_prio_diff_dist[multidut_port_info1-port_map0] 
19:15:26 test_sys_non_congestion.test_multiple_pr L0095 INFO   | Running test for testbed subtype: single-dut-single-asic
19:23:37 traffic_generation.run_sys_traffic       L1190 INFO   | Writing statistics to file : /tmp/Single_Ingress_Egress_diff_dist_100Gbps_single-dut-single-asic_1024B-2024-10-08-19-23.csv
PASSED                                                                                                                                                                                                                                        [ 33%]
snappi_tests/multidut/systest/test_sys_non_congestion.py::test_multiple_prio_uni_dist[multidut_port_info0-port_map0] 
19:23:42 test_sys_non_congestion.test_multiple_pr L0235 INFO   | Running test for testbed subtype: single-dut-multi-asic
19:31:57 traffic_generation.run_sys_traffic       L1190 INFO   | Writing statistics to file : /tmp/Single_Ingress_Egress_uni_dist_100Gbps_single-dut-multi-asic_1024B-2024-10-08-19-31.csv
PASSED                                                                                                                                                                                                                                        [ 50%]
snappi_tests/multidut/systest/test_sys_non_congestion.py::test_multiple_prio_uni_dist[multidut_port_info1-port_map0] 
19:32:02 test_sys_non_congestion.test_multiple_pr L0235 INFO   | Running test for testbed subtype: single-dut-single-asic
19:40:12 traffic_generation.run_sys_traffic       L1190 INFO   | Writing statistics to file : /tmp/Single_Ingress_Egress_uni_dist_100Gbps_single-dut-single-asic_1024B-2024-10-08-19-40.csv
PASSED                                                                                                                                                                                                                                        [ 66%]
snappi_tests/multidut/systest/test_sys_non_congestion.py::test_single_lossless_prio[multidut_port_info0-port_map0] 
19:40:18 test_sys_non_congestion.test_single_loss L0375 INFO   | Running test for testbed subtype: single-dut-multi-asic
19:48:26 traffic_generation.run_sys_traffic       L1190 INFO   | Writing statistics to file : /tmp/Single_Ingress_Egress_1Prio_linerate_100Gbps_single-dut-multi-asic_1024B-2024-10-08-19-48.csv
PASSED                                                                                                                                                                                                                                        [ 83%]
snappi_tests/multidut/systest/test_sys_non_congestion.py::test_single_lossless_prio[multidut_port_info1-port_map0] 
19:48:31 test_sys_non_congestion.test_single_loss L0375 INFO   | Running test for testbed subtype: single-dut-single-asic
19:56:38 traffic_generation.run_sys_traffic       L1190 INFO   | Writing statistics to file : /tmp/Single_Ingress_Egress_1Prio_linerate_100Gbps_single-dut-single-asic_1024B-2024-10-08-19-56.csv
PASSED                                                                                                                                                                                                                                        [100%]
 
Over-subscription:

20:13:40 test_sys_over_subscription.test_multiple L0093 INFO   | Running test for testbed subtype: single-dut-multi-asic
20:23:07 traffic_generation.run_sys_traffic       L1190 INFO   | Writing statistics to file : /tmp/Two_Ingress_Single_Egress_diff_dist_100Gbps_single-dut-multi-asic_1024B-2024-10-08-20-23.csv
PASSED                                                                                                                                                                                                                                        [ 12%]
snappi_tests/multidut/systest/test_sys_over_subscription.py::test_multiple_prio_diff_dist[multidut_port_info1-port_map0] 
20:23:16 test_sys_over_subscription.test_multiple L0093 INFO   | Running test for testbed subtype: single-dut-single-asic
20:32:20 traffic_generation.run_sys_traffic       L1190 INFO   | Writing statistics to file : /tmp/Two_Ingress_Single_Egress_diff_dist_100Gbps_single-dut-single-asic_1024B-2024-10-08-20-32.csv
PASSED                                                                                                                                                                                                                                        [ 25%]
snappi_tests/multidut/systest/test_sys_over_subscription.py::test_multiple_prio_uni_dist[multidut_port_info0-port_map0] 
20:32:29 test_sys_over_subscription.test_multiple L0227 INFO   | Running test for testbed subtype: single-dut-multi-asic
20:41:39 traffic_generation.run_sys_traffic       L1190 INFO   | Writing statistics to file : /tmp/Two_Ingress_Single_Egress_uni_dist_full100Gbps_single-dut-multi-asic_1024B-2024-10-08-20-41.csv
PASSED                                                                                                                                                                                                                                        [ 37%]
snappi_tests/multidut/systest/test_sys_over_subscription.py::test_multiple_prio_uni_dist[multidut_port_info1-port_map0] 
20:41:48 test_sys_over_subscription.test_multiple L0227 INFO   | Running test for testbed subtype: single-dut-single-asic
20:50:53 traffic_generation.run_sys_traffic       L1190 INFO   | Writing statistics to file : /tmp/Two_Ingress_Single_Egress_uni_dist_full100Gbps_single-dut-single-asic_1024B-2024-10-08-20-50.csv
PASSED                                                                                                                                                                                                                                        [ 50%]
snappi_tests/multidut/systest/test_sys_over_subscription.py::test_multiple_prio_uni_dist_full[multidut_port_info0-port_map0] 
20:51:02 test_sys_over_subscription.test_multiple L0364 INFO   | Running test for testbed subtype: single-dut-multi-asic
21:00:11 traffic_generation.run_sys_traffic       L1190 INFO   | Writing statistics to file : /tmp/Two_Ingress_Single_Egress_uni_dist_full100Gbps_single-dut-multi-asic_1024B-2024-10-08-21-00.csv
PASSED                                                                                                                                                                                                                                        [ 62%]
snappi_tests/multidut/systest/test_sys_over_subscription.py::test_multiple_prio_uni_dist_full[multidut_port_info1-port_map0] 
21:00:20 test_sys_over_subscription.test_multiple L0364 INFO   | Running test for testbed subtype: single-dut-single-asic
21:09:25 traffic_generation.run_sys_traffic       L1190 INFO   | Writing statistics to file : /tmp/Two_Ingress_Single_Egress_uni_dist_full100Gbps_single-dut-single-asic_1024B-2024-10-08-21-09.csv
PASSED                                                                                                                                                                                                                                        [ 75%]
snappi_tests/multidut/systest/test_sys_over_subscription.py::test_multiple_prio_non_cngtn[multidut_port_info0-port_map0] 
21:09:34 test_sys_over_subscription.test_multiple L0502 INFO   | Running test for testbed subtype: single-dut-multi-asic
21:18:38 traffic_generation.run_sys_traffic       L1190 INFO   | Writing statistics to file : /tmp/Two_Ingress_Single_Egress_non_cngstn_100Gbps_single-dut-multi-asic_1024B-2024-10-08-21-18.csv
PASSED                                                                                                                                                                                                                                        [ 87%]
snappi_tests/multidut/systest/test_sys_over_subscription.py::test_multiple_prio_non_cngtn[multidut_port_info1-port_map0] 
21:18:47 test_sys_over_subscription.test_multiple L0502 INFO   | Running test for testbed subtype: single-dut-single-asic
21:27:45 traffic_generation.run_sys_traffic       L1190 INFO   | Writing statistics to file : /tmp/Two_Ingress_Single_Egress_non_cngstn_100Gbps_single-dut-single-asic_1024B-2024-10-08-21-27.csv
PASSED                                                                                                                                                                                                                                        [100%]
PFCWD:

01:08:43 traffic_generation.run_sys_traffic       L1190 INFO   | Writing statistics to file : /tmp/One_Ingress_Egress_pfcwd_drop_90_10_dist100Gbps_single-dut-multi-asic_1024B-2024-10-09-01-08.csv
PASSED                                                                                                                                                                                                                                        [ 10%]
01:19:33 traffic_generation.run_sys_traffic       L1190 INFO   | Writing statistics to file : /tmp/One_Ingress_Egress_pfcwd_drop_90_10_dist100Gbps_single-dut-single-asic_1024B-2024-10-09-01-19.csv
PASSED                                                                                                                                                                                                                                        [ 20%]
01:30:32 traffic_generation.run_sys_traffic       L1190 INFO   | Writing statistics to file : /tmp/One_Ingress_Egress_pfcwd_frwd_90_10_dist100Gbps_single-dut-multi-asic_1024B-2024-10-09-01-30.csv
PASSED                                                                                                                                                                                                                                        [ 30%]
01:41:25 traffic_generation.run_sys_traffic       L1190 INFO   | Writing statistics to file : /tmp/One_Ingress_Egress_pfcwd_frwd_90_10_dist100Gbps_single-dut-single-asic_1024B-2024-10-09-01-41.csv
PASSED                                                                                                                                                                                                                                        [ 40%]
01:53:08 traffic_generation.run_sys_traffic       L1190 INFO   | Writing statistics to file : /tmp/Two_Ingress_Single_Egress_pfcwd_drop_40_9_dist100Gbps_single-dut-multi-asic_1024B-2024-10-09-01-53.csv
PASSED                                                                                                                                                                                                                                        [ 50%]
02:04:49 traffic_generation.run_sys_traffic       L1190 INFO   | Writing statistics to file : /tmp/Two_Ingress_Single_Egress_pfcwd_drop_40_9_dist100Gbps_single-dut-single-asic_1024B-2024-10-09-02-04.csv
PASSED                                                                                                                                                                                                                                        [ 60%]
02:16:26 traffic_generation.run_sys_traffic       L1190 INFO   | Writing statistics to file : /tmp/Two_Ingress_Single_Egress_pfcwd_frwd_40_9_dist100Gbps_single-dut-multi-asic_1024B-2024-10-09-02-16.csv
PASSED                                                                                                                                                                                                                                        [ 70%]
02:27:53 traffic_generation.run_sys_traffic       L1190 INFO   | Writing statistics to file : /tmp/Two_Ingress_Single_Egress_pfcwd_frwd_40_9_dist100Gbps_single-dut-single-asic_1024B-2024-10-09-02-27.csv
PASSED                                                                                                                                                                                                                                        [ 80%]
02:38:45 traffic_generation.run_sys_traffic       L1190 INFO   | Writing statistics to file : /tmp/Single_Ingress_Single_Egress_pause_cngstn_100Gbps_single-dut-multi-asic_1024B-2024-10-09-02-38.csv
PASSED                                                                                                                                                                                                                                        [ 90%]
02:49:22 traffic_generation.run_sys_traffic       L1190 INFO   | Writing statistics to file : /tmp/Single_Ingress_Single_Egress_pause_cngstn_100Gbps_single-dut-single-asic_1024B-2024-10-09-02-49.csv
PASSED                                                                                                                                                                                                                                        [100%]
Any platform specific information?
The testcases are specifically meant for Broadcom DNX Multi-ASIC platform DUT.

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

Cherry-pick PR to 202411: #16525

@sdszhang
Copy link
Contributor

@amitpawar12 cherry-pick to 202411 has errors. can you check?

ERROR snappi_tests/pfc/test_pfc_no_congestion_throughput.py
ERROR snappi_tests/pfc/test_pfc_port_congestion.py
ERROR snappi_tests/pfcwd/test_pfcwd_actions.py

mssonicbld pushed a commit that referenced this pull request Jan 16, 2025
Description of PR
This pull-request has changes specifically for the following commit-IDs:
a82b489
180af4d
3da40bc

This PR specifically handles the testcases pertaining to the new PFC-ECN testplan added.

Summary:
Fixes # (issue)
#13655
#13215

Approach
What is the motivation for this PR?
Three test-scripts have been added to specifically test: non-congestion scenarios (line-rate tests), congestion testcases via over-subscription and PFCWD (drop and forward mode).

How did you do it?
Test case has dictionary called test_def which defines various testcases parameters necessary to run the testcase. An example of this, is packet-size (default is IMIX but can be changed to 1024B), test-duration, stats capture, file log at the end of the test.

Similarly, there is test_check which passes test-case uses for verification info. Lossless and lossy priorities are selected from the available list.

Most important change comes in form of port_map definition. Port map is a list with first two parameters defining the egress port count and egress speed. Last two parameters define the ingress port count and ingress speed. Example - [1, 100, 2 , 100] defines single egress port of speed 100Gbps and 2 ingress ports of 100Gbps.
This definition is important because, multi-speed ingress and egress ports needs to be supported. Example - [1, 100, 1, 400] will define single ingress and egress of 400Gbps and 100Gbps respectively.

A new function is provided to capture snappi_ports. This will pick the line-card choice from variable.py and choose the ports as defined in port_map. The port_map is used to filter out the available ports for the required port-speed.

At the end of the test, a CSV is created as raw data for the test-case execution. Summary of the test-case is generated in form of text file with same name. Additional checks are present in multi_dut helper file, depending upon the type of the test. The test passes the verification parameters in test_check in dictionary format.

There is important change in variables.py file. The line_card_choice is sent as dictionary from variables.py, which then is parameterized in the test. Depending upon the type of line_card_choice, the tests are ran for that specific line_card choice and set of ports.

Testcases:
a. tests/snappi_tests/pfc/test_pfc_no_congestion_throughput.py:
-- This testcase has testcases to test line-rate speeds with single ingress and egress. Traffic combination around lossless and lossy priorities have been used. Expectations is that no PFCs will be generated, line-rate will be achieved, no drops will be seen on both DUT and TGEN.
b. tests/snappi_tests/pfc/test_pfc_port_congestion.py:
-- This testcase has testcases to test behavior with 2 ingress ports and 1 egress port on the DUT. Traffic combination around lossless and lossy priorities.
c. tests/snappi_tests/pfcwd/test_pfcwd_actions.py:
-- Testcases cover PFCWD action - DROP and FORWARD mode. DROP and FORWARD mode is also tested for two ingresses and single egress with pause frames on egress.

How did you verify/test it?
Test case was executed on local clone.

Results of the verification:

Test cases executed for 100Gbps interfaces.
Two combinations - single-line-card-multi-asic and multiple-dut
Non-congestion:
19:06:48 test_sys_non_congestion.test_multiple_pr L0095 INFO   | Running test for testbed subtype: single-dut-multi-asic
19:15:21 traffic_generation.run_sys_traffic       L1190 INFO   | Writing statistics to file : /tmp/Single_Ingress_Egress_diff_dist_100Gbps_single-dut-multi-asic_1024B-2024-10-08-19-15.csv
PASSED                                                                                                                                                                                                                                        [ 16%]
snappi_tests/multidut/systest/test_sys_non_congestion.py::test_multiple_prio_diff_dist[multidut_port_info1-port_map0] 
19:15:26 test_sys_non_congestion.test_multiple_pr L0095 INFO   | Running test for testbed subtype: single-dut-single-asic
19:23:37 traffic_generation.run_sys_traffic       L1190 INFO   | Writing statistics to file : /tmp/Single_Ingress_Egress_diff_dist_100Gbps_single-dut-single-asic_1024B-2024-10-08-19-23.csv
PASSED                                                                                                                                                                                                                                        [ 33%]
snappi_tests/multidut/systest/test_sys_non_congestion.py::test_multiple_prio_uni_dist[multidut_port_info0-port_map0] 
19:23:42 test_sys_non_congestion.test_multiple_pr L0235 INFO   | Running test for testbed subtype: single-dut-multi-asic
19:31:57 traffic_generation.run_sys_traffic       L1190 INFO   | Writing statistics to file : /tmp/Single_Ingress_Egress_uni_dist_100Gbps_single-dut-multi-asic_1024B-2024-10-08-19-31.csv
PASSED                                                                                                                                                                                                                                        [ 50%]
snappi_tests/multidut/systest/test_sys_non_congestion.py::test_multiple_prio_uni_dist[multidut_port_info1-port_map0] 
19:32:02 test_sys_non_congestion.test_multiple_pr L0235 INFO   | Running test for testbed subtype: single-dut-single-asic
19:40:12 traffic_generation.run_sys_traffic       L1190 INFO   | Writing statistics to file : /tmp/Single_Ingress_Egress_uni_dist_100Gbps_single-dut-single-asic_1024B-2024-10-08-19-40.csv
PASSED                                                                                                                                                                                                                                        [ 66%]
snappi_tests/multidut/systest/test_sys_non_congestion.py::test_single_lossless_prio[multidut_port_info0-port_map0] 
19:40:18 test_sys_non_congestion.test_single_loss L0375 INFO   | Running test for testbed subtype: single-dut-multi-asic
19:48:26 traffic_generation.run_sys_traffic       L1190 INFO   | Writing statistics to file : /tmp/Single_Ingress_Egress_1Prio_linerate_100Gbps_single-dut-multi-asic_1024B-2024-10-08-19-48.csv
PASSED                                                                                                                                                                                                                                        [ 83%]
snappi_tests/multidut/systest/test_sys_non_congestion.py::test_single_lossless_prio[multidut_port_info1-port_map0] 
19:48:31 test_sys_non_congestion.test_single_loss L0375 INFO   | Running test for testbed subtype: single-dut-single-asic
19:56:38 traffic_generation.run_sys_traffic       L1190 INFO   | Writing statistics to file : /tmp/Single_Ingress_Egress_1Prio_linerate_100Gbps_single-dut-single-asic_1024B-2024-10-08-19-56.csv
PASSED                                                                                                                                                                                                                                        [100%]
 
Over-subscription:

20:13:40 test_sys_over_subscription.test_multiple L0093 INFO   | Running test for testbed subtype: single-dut-multi-asic
20:23:07 traffic_generation.run_sys_traffic       L1190 INFO   | Writing statistics to file : /tmp/Two_Ingress_Single_Egress_diff_dist_100Gbps_single-dut-multi-asic_1024B-2024-10-08-20-23.csv
PASSED                                                                                                                                                                                                                                        [ 12%]
snappi_tests/multidut/systest/test_sys_over_subscription.py::test_multiple_prio_diff_dist[multidut_port_info1-port_map0] 
20:23:16 test_sys_over_subscription.test_multiple L0093 INFO   | Running test for testbed subtype: single-dut-single-asic
20:32:20 traffic_generation.run_sys_traffic       L1190 INFO   | Writing statistics to file : /tmp/Two_Ingress_Single_Egress_diff_dist_100Gbps_single-dut-single-asic_1024B-2024-10-08-20-32.csv
PASSED                                                                                                                                                                                                                                        [ 25%]
snappi_tests/multidut/systest/test_sys_over_subscription.py::test_multiple_prio_uni_dist[multidut_port_info0-port_map0] 
20:32:29 test_sys_over_subscription.test_multiple L0227 INFO   | Running test for testbed subtype: single-dut-multi-asic
20:41:39 traffic_generation.run_sys_traffic       L1190 INFO   | Writing statistics to file : /tmp/Two_Ingress_Single_Egress_uni_dist_full100Gbps_single-dut-multi-asic_1024B-2024-10-08-20-41.csv
PASSED                                                                                                                                                                                                                                        [ 37%]
snappi_tests/multidut/systest/test_sys_over_subscription.py::test_multiple_prio_uni_dist[multidut_port_info1-port_map0] 
20:41:48 test_sys_over_subscription.test_multiple L0227 INFO   | Running test for testbed subtype: single-dut-single-asic
20:50:53 traffic_generation.run_sys_traffic       L1190 INFO   | Writing statistics to file : /tmp/Two_Ingress_Single_Egress_uni_dist_full100Gbps_single-dut-single-asic_1024B-2024-10-08-20-50.csv
PASSED                                                                                                                                                                                                                                        [ 50%]
snappi_tests/multidut/systest/test_sys_over_subscription.py::test_multiple_prio_uni_dist_full[multidut_port_info0-port_map0] 
20:51:02 test_sys_over_subscription.test_multiple L0364 INFO   | Running test for testbed subtype: single-dut-multi-asic
21:00:11 traffic_generation.run_sys_traffic       L1190 INFO   | Writing statistics to file : /tmp/Two_Ingress_Single_Egress_uni_dist_full100Gbps_single-dut-multi-asic_1024B-2024-10-08-21-00.csv
PASSED                                                                                                                                                                                                                                        [ 62%]
snappi_tests/multidut/systest/test_sys_over_subscription.py::test_multiple_prio_uni_dist_full[multidut_port_info1-port_map0] 
21:00:20 test_sys_over_subscription.test_multiple L0364 INFO   | Running test for testbed subtype: single-dut-single-asic
21:09:25 traffic_generation.run_sys_traffic       L1190 INFO   | Writing statistics to file : /tmp/Two_Ingress_Single_Egress_uni_dist_full100Gbps_single-dut-single-asic_1024B-2024-10-08-21-09.csv
PASSED                                                                                                                                                                                                                                        [ 75%]
snappi_tests/multidut/systest/test_sys_over_subscription.py::test_multiple_prio_non_cngtn[multidut_port_info0-port_map0] 
21:09:34 test_sys_over_subscription.test_multiple L0502 INFO   | Running test for testbed subtype: single-dut-multi-asic
21:18:38 traffic_generation.run_sys_traffic       L1190 INFO   | Writing statistics to file : /tmp/Two_Ingress_Single_Egress_non_cngstn_100Gbps_single-dut-multi-asic_1024B-2024-10-08-21-18.csv
PASSED                                                                                                                                                                                                                                        [ 87%]
snappi_tests/multidut/systest/test_sys_over_subscription.py::test_multiple_prio_non_cngtn[multidut_port_info1-port_map0] 
21:18:47 test_sys_over_subscription.test_multiple L0502 INFO   | Running test for testbed subtype: single-dut-single-asic
21:27:45 traffic_generation.run_sys_traffic       L1190 INFO   | Writing statistics to file : /tmp/Two_Ingress_Single_Egress_non_cngstn_100Gbps_single-dut-single-asic_1024B-2024-10-08-21-27.csv
PASSED                                                                                                                                                                                                                                        [100%]
PFCWD:

01:08:43 traffic_generation.run_sys_traffic       L1190 INFO   | Writing statistics to file : /tmp/One_Ingress_Egress_pfcwd_drop_90_10_dist100Gbps_single-dut-multi-asic_1024B-2024-10-09-01-08.csv
PASSED                                                                                                                                                                                                                                        [ 10%]
01:19:33 traffic_generation.run_sys_traffic       L1190 INFO   | Writing statistics to file : /tmp/One_Ingress_Egress_pfcwd_drop_90_10_dist100Gbps_single-dut-single-asic_1024B-2024-10-09-01-19.csv
PASSED                                                                                                                                                                                                                                        [ 20%]
01:30:32 traffic_generation.run_sys_traffic       L1190 INFO   | Writing statistics to file : /tmp/One_Ingress_Egress_pfcwd_frwd_90_10_dist100Gbps_single-dut-multi-asic_1024B-2024-10-09-01-30.csv
PASSED                                                                                                                                                                                                                                        [ 30%]
01:41:25 traffic_generation.run_sys_traffic       L1190 INFO   | Writing statistics to file : /tmp/One_Ingress_Egress_pfcwd_frwd_90_10_dist100Gbps_single-dut-single-asic_1024B-2024-10-09-01-41.csv
PASSED                                                                                                                                                                                                                                        [ 40%]
01:53:08 traffic_generation.run_sys_traffic       L1190 INFO   | Writing statistics to file : /tmp/Two_Ingress_Single_Egress_pfcwd_drop_40_9_dist100Gbps_single-dut-multi-asic_1024B-2024-10-09-01-53.csv
PASSED                                                                                                                                                                                                                                        [ 50%]
02:04:49 traffic_generation.run_sys_traffic       L1190 INFO   | Writing statistics to file : /tmp/Two_Ingress_Single_Egress_pfcwd_drop_40_9_dist100Gbps_single-dut-single-asic_1024B-2024-10-09-02-04.csv
PASSED                                                                                                                                                                                                                                        [ 60%]
02:16:26 traffic_generation.run_sys_traffic       L1190 INFO   | Writing statistics to file : /tmp/Two_Ingress_Single_Egress_pfcwd_frwd_40_9_dist100Gbps_single-dut-multi-asic_1024B-2024-10-09-02-16.csv
PASSED                                                                                                                                                                                                                                        [ 70%]
02:27:53 traffic_generation.run_sys_traffic       L1190 INFO   | Writing statistics to file : /tmp/Two_Ingress_Single_Egress_pfcwd_frwd_40_9_dist100Gbps_single-dut-single-asic_1024B-2024-10-09-02-27.csv
PASSED                                                                                                                                                                                                                                        [ 80%]
02:38:45 traffic_generation.run_sys_traffic       L1190 INFO   | Writing statistics to file : /tmp/Single_Ingress_Single_Egress_pause_cngstn_100Gbps_single-dut-multi-asic_1024B-2024-10-09-02-38.csv
PASSED                                                                                                                                                                                                                                        [ 90%]
02:49:22 traffic_generation.run_sys_traffic       L1190 INFO   | Writing statistics to file : /tmp/Single_Ingress_Single_Egress_pause_cngstn_100Gbps_single-dut-single-asic_1024B-2024-10-09-02-49.csv
PASSED                                                                                                                                                                                                                                        [100%]
Any platform specific information?
The testcases are specifically meant for Broadcom DNX Multi-ASIC platform DUT.

co-authorized by: [email protected]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

8 participants