Skip to content

Commit 4f28bfe

Browse files
authored
[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 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? 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
1 parent 39bd72b commit 4f28bfe

File tree

2 files changed

+557
-12
lines changed

2 files changed

+557
-12
lines changed

tests/common/snappi_tests/snappi_test_params.py

+2
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ def __init__(self):
2323
is_snappi_ingress_port_cap (bool): whether or not the packet capture is on the tgen ingress port, if False,
2424
then pcap is on the tgen egress port
2525
base_flow_config (dict): base flow configuration
26+
base_flow_config_list (list): list for base flow config.
2627
test_tx_frames (list): number of test frames transmitted for priorities to test ex. [2000, 3000]
2728
for priorities 3 and 4
2829
multi_dut_params (MultiDUTParams obj): contains det=120ails of duthost objects,
@@ -49,6 +50,7 @@ def __init__(self):
4950
self.packet_capture_ports = None
5051
self.is_snappi_ingress_port_cap = True
5152
self.base_flow_config = None
53+
self.base_flow_config_list = []
5254
self.test_tx_frames = 0
5355
self.multi_dut_params = MultiDUTParams()
5456
self.test_iterations = 1

0 commit comments

Comments
 (0)