Skip to content

Commit

Permalink
Merge pull request sonic-net#2 from Javier-Tan/cherry/202405/13864
Browse files Browse the repository at this point in the history
[Snappi] Infra changes for new PFC-ECN testcases. (sonic-net#13864)

Description of PR
67989d1312b1778681d6575b12b66aa42fdf05a7

Please review the commit-ID given above.

Original PR13655 was raised to add the new testcases. However, manage the changes efficiently, it was decided to split the original into three PRs for ease in review process.

This PR tracks are the infrastructure related changes required for the execution of the testcases.

Note - PR sonic-net#13848 needs to be merged in first before this PR is merged.

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

Approach
What is the motivation for this PR?
This PR tracks only the infrastructure related changes needed for addition of the new testcases.

How did you do it?
Important changes are listed below:

Change directory - tests/common/snappi_tests/

Additional member variable 'base_flow_config_list' is added as list to class 'SnappiTestParams' in snappi_test_params.py file to accommodate for multiple base-flow-configs.
Existing functions - generate_test_flows, generate_background_flows, generate_pause_flows are modified to check if the base_flow_config_list exists. If it does, then base_flow_config is assigned snappi_extra_params.base_flow_config_list[flow_index]. Else existing code is used.
Existing function - 'verify_egress_queue_frame_count' is modified to check if base_flow_config_list exists. If yes, base_flow_config_list[0] is assigned to dut_port_config, else existing code is used.
The testcases calls 'run_traffic_and_collect_stats' function in traffic_generation file to run and gather IXIA+DUT statistics. Statistics are summarized in test_stats dictionary in return.
A function has been created to access the IXIA rest_py framework. This will in turn can be used to integrate MACSEC related changes in future. Currently, rest_py is used to generate the imix custom profile if the flag is set in the test_def dictionary (defined and passed by the test).
Depending upon the test_duration and test_interval defined in test_def of the test, the test-case will be executed.
At every test_interval, the statistics from IXIA and DUT are pulled in form of dictionary, where date-timestamp is primary key.
Important parameters from IXIA like Tx and Rx throughput, number of packets, latency etc are captured with each interval.

From DUT side, the Rx and Tx packets, loss packets (combination of failures, drops and errors), PFC count, queue counts are captured. Additional functions like - get_pfc_count, get_ingerface_stats etc are defined in the common/snappi_test helper files to assist with the same. The support for the above is added as part of the different pull-request.

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. The run_sys_test also returns a dictionary test_stats with all the important parameters to be used for the verification of the test.
How did you verify/test it?
Test was executed on the local clone.

Any platform specific information?
These testcases are specifically meant for Broadcom-DNX multi-ASIC based platforms.

co-authorized by: jianquanye@microsoft.com
  • Loading branch information
yejianquan authored Jan 16, 2025
2 parents 28789da + 399b7ae commit 3f799d3
Show file tree
Hide file tree
Showing 2 changed files with 557 additions and 12 deletions.
2 changes: 2 additions & 0 deletions tests/common/snappi_tests/snappi_test_params.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ def __init__(self):
is_snappi_ingress_port_cap (bool): whether or not the packet capture is on the tgen ingress port, if False,
then pcap is on the tgen egress port
base_flow_config (dict): base flow configuration
base_flow_config_list (list): list for base flow config.
test_tx_frames (list): number of test frames transmitted for priorities to test ex. [2000, 3000]
for priorities 3 and 4
multi_dut_params (MultiDUTParams obj): contains det=120ails of duthost objects,
Expand All @@ -49,6 +50,7 @@ def __init__(self):
self.packet_capture_ports = None
self.is_snappi_ingress_port_cap = True
self.base_flow_config = None
self.base_flow_config_list = []
self.test_tx_frames = 0
self.multi_dut_params = MultiDUTParams()
self.test_iterations = 1
Expand Down
Loading

0 comments on commit 3f799d3

Please sign in to comment.