Skip to content

Commit 376178e

Browse files
authored
[Snappi]: PFC - Mixed Speed testcases (#14122)
Description of PR As part of the new testcases to be added for the PFC-ECN, this PR addresses the mixed-speed ingress and egress testcases. Approach What is the motivation for this PR? This script addresses the mixed speed testcases. The topology has single ingress and egress of 400Gbps and 100Gbps respectively. The congestion is caused due to three factors: Due to oversubscription of egress. Pause frames received on egress link of 100Gbps. Both - over-subscription of egress and pause frames received on egress. Idea is to test behavior of the DUT in these conditions. How did you do it? The port_map defines to choose single ingress of 400Gbps and egress of 100Gbps. Following test functions are used: test_mixed_speed_diff_dist_dist_over: Lossless and lossy traffic are sent at 88 and 12% of the line-rate (400Gbps) respectively, causing normal congestion on DUT due to oversubscription of the egress. Lossless priority 3 and 4 are used, whereas lossy priorities are 0,1 and 2. Expectation is that lossless priorities will cause DUT to send PAUSE frames to IXIA transmitter, will be rate-limited and hence no drops. Lossy priority traffic will see no drops at all. Egress throughput is expected to be around 100Gbps. Lossy ingress and egress throughput does not change. test_mixed_speed_uni_dist_dist_over: Lossless and lossy traffic are sent at 20% of the line-rate (400Gbps) respectively, causing normal congestion on DUT due to oversubscription of the egress. Lossless priority 3 and 4 are used, whereas lossy priorities are 0,1 and 2. Expectation is that lossless priorities will cause DUT to send PAUSE frames to IXIA transmitter, will be rate-limited and hence no drops. Lossy priority traffic will however see partial drop. Egress throughput is expected to be around 100Gbps with lossless and lossy traffic of equal (or close to equal) ratio. test_mixed_speed_pfcwd_enable: Lossless and lossy traffic are sent at 20% of the line-rate (400Gbps) respectively, causing normal congestion on DUT due to oversubscription of the egress. Lossless priority 3 and 4 are used, whereas lossy priorities are 0,1 and 2. Additionally, the IXIA receiver is sending PAUSE frames to DUT for lossless priority traffic. This causes additional congestion on the DUT. Expectation is that DUT sends PFC to the IXIA transmitter for lossless priorities in response to natural congestion on DUT due to oversubscription of egress. Lossless priority is rate-limited by IXIA in response to PFCs from DUT. Lossy priority is partially dropped on DUT. But since the DUT is receiving PFCs on egress, the rate-limited lossless traffic is eventually dropped on egress. The IXIA receiver receives ONLY 60Gbps of lossy traffic. test_mixed_speed_pfcwd_disable: Lossless and lossy traffic are sent at 20% of the line-rate (400Gbps) respectively, causing normal congestion on DUT due to oversubscription of the egress. Lossless priority 3 and 4 are used, whereas lossy priorities are 0,1 and 2. Additionally, the IXIA receiver is sending PAUSE frames to DUT for lossless priority traffic. This causes additional congestion on the DUT. Since PFCWD is disabled in this scenario, DUT forwards both lossless and lossy traffic to the IXIA receiver. DUT is sending PFCs in response to natural congestion as well as PFCs received on the egress. The egress line-rate is 100Gbps with lossy traffic being partially dropped. Lossy and lossless traffic are in equal (or close to equal) ratio. test_mixed_speed_no_congestion: Purpose of the testcase is to see if the DUT does not congestion in case the ingress 400Gbps is receiving 100Gbps of traffic, which it seamlessly moves to the egress without any drops or congestion. For all the above testcases, an additional check for the fabric counters is added. The tests will clear the fabric counters on line-cards and supervisor card (if part of the test). At the end of the test, counters are being checked again for CRC and uncorrectable FEC errors and asserts if the counts are non-zero. The checks are added as part of a different PR process and will need to be merged first. The underlying infra also needs to be added first before the testcases are added. How did you verify/test it? Tested on local platform. 16:05:25 traffic_generation.run_sys_traffic L1190 INFO | Writing statistics to file : /tmp/Single_400Gbps_Ingress_Single_100Gbps_Egress_diff_dist__multiple-dut-mixed-speed_1024B-2024-10-09-16-05.csv PASSED [ 20%] 16:13:48 traffic_generation.run_sys_traffic L1190 INFO | Writing statistics to file : /tmp/Single_400Gbps_Ingress_Single_100Gbps_Egress_uni_dist__multiple-dut-mixed-speed_1024B-2024-10-09-16-13.csv PASSED [ 40%] 16:22:13 traffic_generation.run_sys_traffic L1190 INFO | Writing statistics to file : /tmp/Single_400Gbps_Ingress_Single_100Gbps_Egress_pause_pfcwd_enable__multiple-dut-mixed-speed_1024B-2024-10-09-16-22.csv PASSED [ 60%] 16:30:33 traffic_generation.run_sys_traffic L1190 INFO | Writing statistics to file : /tmp/Single_400Gbps_Ingress_Single_100Gbps_Egress_pause_pfcwd_disable__multiple-dut-mixed-speed_1024B-2024-10-09-16-30.csv PASSED [ 80%] 16:38:56 traffic_generation.run_sys_traffic L1190 INFO | Writing statistics to file : /tmp/Single_400Gbps_Ingress_Single_100Gbps_Egress_no_cong__multiple-dut-mixed-speed_1024B-2024-10-09-16-38.csv PASSED [100%] Any platform specific information? The test is specifically meant for Broadcom-DNX multi-ASIC platforms ONLY. co-authorized by: [email protected]
1 parent dfe93a4 commit 376178e

File tree

5 files changed

+1113
-2
lines changed

5 files changed

+1113
-2
lines changed

tests/common/snappi_tests/common_helpers.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1183,7 +1183,7 @@ def get_interface_stats(duthost, port):
11831183

11841184
def get_queue_count_all_prio(duthost, port):
11851185
"""
1186-
Get the egress queue count in packets and bytes for a given port and priority from SONiC CLI.
1186+
Get the egress queue count in packets and bytes for a given port and all priorities.
11871187
This is the equivalent of the "show queue counters" command.
11881188
Args:
11891189
duthost (Ansible host instance): device under test
Lines changed: 383 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,383 @@
1+
import logging
2+
import time
3+
4+
from tests.common.helpers.assertions import pytest_assert
5+
from tests.common.fixtures.conn_graph_facts import conn_graph_facts,\
6+
fanout_graph_facts # noqa F401
7+
from tests.common.snappi_tests.common_helpers import pfc_class_enable_vector,\
8+
get_lossless_buffer_size, get_pg_dropped_packets,\
9+
stop_pfcwd, disable_packet_aging, sec_to_nanosec,\
10+
get_pfc_frame_count, packet_capture, config_capture_pkt,\
11+
start_pfcwd, enable_packet_aging, \
12+
traffic_flow_mode, calc_pfc_pause_flow_rate # noqa F401
13+
from tests.common.snappi_tests.port import select_ports, select_tx_port # noqa F401
14+
from tests.common.snappi_tests.snappi_helpers import wait_for_arp # noqa F401
15+
from tests.common.snappi_tests.traffic_generation import generate_pause_flows, verify_pause_flow, \
16+
verify_basic_test_flow, verify_background_flow, verify_pause_frame_count_dut, verify_egress_queue_frame_count, \
17+
verify_in_flight_buffer_pkts, verify_unset_cev_pause_frame_count, run_traffic_and_collect_stats, \
18+
multi_base_traffic_config, generate_test_flows, generate_background_flows
19+
from tests.common.snappi_tests.snappi_test_params import SnappiTestParams
20+
from tests.common.snappi_tests.read_pcap import validate_pfc_frame
21+
22+
logger = logging.getLogger(__name__)
23+
24+
dut_port_config = []
25+
PAUSE_FLOW_NAME = 'Pause Storm'
26+
TEST_FLOW_NAME = 'Test Flow'
27+
BG_FLOW_NAME = 'Background Flow'
28+
TOLERANCE_THRESHOLD = 0.1
29+
CONTINUOUS_MODE = -5
30+
ANSIBLE_POLL_DELAY_SEC = 4
31+
global DATA_FLOW_DURATION_SEC
32+
global data_flow_delay_sec
33+
34+
35+
def run_pfc_test(api,
36+
testbed_config,
37+
port_config_list,
38+
conn_data,
39+
fanout_data,
40+
global_pause,
41+
pause_prio_list,
42+
test_prio_list,
43+
bg_prio_list,
44+
prio_dscp_map,
45+
test_traffic_pause,
46+
test_def,
47+
snappi_extra_params=None):
48+
"""
49+
Run a multidut PFC test
50+
Args:
51+
api (obj): snappi session
52+
testbed_config (obj): testbed L1/L2/L3 configuration
53+
port_config_list (list): list of port configuration
54+
conn_data (dict): the dictionary returned by conn_graph_fact.
55+
fanout_data (dict): the dictionary returned by fanout_graph_fact.
56+
duthost (Ansible host instance): device under test
57+
dut_port (str): DUT port to test
58+
global_pause (bool): if pause frame is IEEE 802.3X pause
59+
pause_prio_list (list): priorities to pause for pause frames
60+
test_prio_list (list): priorities of test flows
61+
bg_prio_list (list): priorities of background flows
62+
prio_dscp_map (dict): Priority vs. DSCP map (key = priority).
63+
test_traffic_pause (bool): if test flows are expected to be paused
64+
test_def['enable_pause'] (bool) : if test expects no pause flow traffic.
65+
snappi_extra_params (SnappiSysTestParams obj): additional parameters for Snappi traffic
66+
67+
Returns:
68+
N/A
69+
"""
70+
71+
TEST_FLOW_AGGR_RATE_PERCENT = test_def['TEST_FLOW_AGGR_RATE_PERCENT']
72+
BG_FLOW_AGGR_RATE_PERCENT = test_def['BG_FLOW_AGGR_RATE_PERCENT']
73+
data_flow_pkt_size = test_def['data_flow_pkt_size']
74+
DATA_FLOW_DURATION_SEC = test_def['DATA_FLOW_DURATION_SEC']
75+
data_flow_delay_sec = test_def['data_flow_delay_sec']
76+
SNAPPI_POLL_DELAY_SEC = test_def['SNAPPI_POLL_DELAY_SEC']
77+
PAUSE_FLOW_DUR_BASE_SEC = data_flow_delay_sec + DATA_FLOW_DURATION_SEC
78+
if test_def['imix']:
79+
fname = test_def['test_type'] + '_' + test_def['line_card_choice'] + '_' + 'IMIX'
80+
else:
81+
fname = test_def['test_type'] + '_' + test_def['line_card_choice'] + '_' + str(data_flow_pkt_size) + 'B'
82+
port_map = test_def['port_map']
83+
84+
if snappi_extra_params is None:
85+
snappi_extra_params = SnappiTestParams()
86+
87+
# Traffic flow:
88+
# tx_port (TGEN) --- ingress DUT --- egress DUT --- rx_port (TGEN)
89+
90+
rx_port = snappi_extra_params.multi_dut_params.multi_dut_ports[0]
91+
egress_duthost = rx_port['duthost']
92+
93+
tx_port = snappi_extra_params.multi_dut_params.multi_dut_ports[-1]
94+
ingress_duthost = tx_port['duthost']
95+
dut_list = [egress_duthost, ingress_duthost]
96+
97+
if (test_traffic_pause):
98+
logger.info("PFC receiving DUT is {}".format(egress_duthost.hostname))
99+
100+
pytest_assert(testbed_config is not None, 'Fail to get L2/3 testbed config')
101+
102+
if (test_def['enable_pfcwd']):
103+
start_pfcwd(egress_duthost)
104+
start_pfcwd(ingress_duthost)
105+
else:
106+
stop_pfcwd(egress_duthost)
107+
stop_pfcwd(ingress_duthost)
108+
109+
if (test_def['enable_credit_wd']):
110+
enable_packet_aging(egress_duthost, rx_port['asic_value'])
111+
enable_packet_aging(ingress_duthost, tx_port['asic_value'])
112+
else:
113+
disable_packet_aging(egress_duthost, rx_port['asic_value'])
114+
disable_packet_aging(ingress_duthost, tx_port['asic_value'])
115+
116+
# Port id of Rx port for traffic config
117+
# rx_port_id and tx_port_id belong to IXIA chassis.
118+
rx_port_id = 0
119+
120+
# Rate percent must be an integer
121+
bg_flow_rate_percent = int(BG_FLOW_AGGR_RATE_PERCENT / len(bg_prio_list))
122+
test_flow_rate_percent = int(TEST_FLOW_AGGR_RATE_PERCENT / len(test_prio_list))
123+
# Generate base traffic config
124+
for i in range(port_map[2]):
125+
tx_port_id = i+1
126+
snappi_extra_params.base_flow_config_list.append(multi_base_traffic_config(testbed_config=testbed_config,
127+
port_config_list=port_config_list,
128+
rx_port_id=rx_port_id,
129+
tx_port_id=tx_port_id))
130+
131+
speed_str = testbed_config.layer1[0].speed
132+
speed_gbps = int(speed_str.split('_')[1])
133+
134+
if snappi_extra_params.headroom_test_params is not None:
135+
DATA_FLOW_DURATION_SEC += 10
136+
data_flow_delay_sec += 2
137+
138+
# Set up pfc delay parameter
139+
l1_config = testbed_config.layer1[0]
140+
pfc = l1_config.flow_control.ieee_802_1qbb
141+
pfc.pfc_delay = snappi_extra_params.headroom_test_params[0]
142+
143+
if snappi_extra_params.poll_device_runtime:
144+
# If the switch needs to be polled as traffic is running for stats,
145+
# then the test runtime needs to be increased for the polling delay
146+
DATA_FLOW_DURATION_SEC += ANSIBLE_POLL_DELAY_SEC
147+
data_flow_delay_sec = ANSIBLE_POLL_DELAY_SEC
148+
149+
if snappi_extra_params.packet_capture_type != packet_capture.NO_CAPTURE:
150+
# Setup capture config
151+
if snappi_extra_params.is_snappi_ingress_port_cap:
152+
# packet capture is required on the ingress snappi port
153+
snappi_extra_params.packet_capture_ports = [snappi_extra_params.base_flow_config_list["rx_port_name"]]
154+
else:
155+
# packet capture will be on the egress snappi port
156+
snappi_extra_params.packet_capture_ports = [snappi_extra_params.base_flow_config_list["tx_port_name"]]
157+
158+
snappi_extra_params.packet_capture_file = snappi_extra_params.packet_capture_type.value
159+
160+
config_capture_pkt(testbed_config=testbed_config,
161+
port_names=snappi_extra_params.packet_capture_ports,
162+
capture_type=snappi_extra_params.packet_capture_type,
163+
capture_name=snappi_extra_params.packet_capture_file)
164+
logger.info("Packet capture file: {}.pcapng".format(snappi_extra_params.packet_capture_file))
165+
166+
# Set default traffic flow configs if not set
167+
if snappi_extra_params.traffic_flow_config.data_flow_config is None:
168+
snappi_extra_params.traffic_flow_config.data_flow_config = {
169+
"flow_name": TEST_FLOW_NAME,
170+
"flow_dur_sec": DATA_FLOW_DURATION_SEC,
171+
"flow_rate_percent": test_flow_rate_percent,
172+
"flow_rate_pps": None,
173+
"flow_rate_bps": None,
174+
"flow_pkt_count": None,
175+
"flow_pkt_size": data_flow_pkt_size,
176+
"flow_delay_sec": data_flow_delay_sec,
177+
"flow_traffic_type": traffic_flow_mode.FIXED_DURATION
178+
}
179+
180+
if snappi_extra_params.traffic_flow_config.background_flow_config is None and \
181+
snappi_extra_params.gen_background_traffic:
182+
snappi_extra_params.traffic_flow_config.background_flow_config = {
183+
"flow_name": BG_FLOW_NAME,
184+
"flow_dur_sec": DATA_FLOW_DURATION_SEC,
185+
"flow_rate_percent": bg_flow_rate_percent,
186+
"flow_rate_pps": None,
187+
"flow_rate_bps": None,
188+
"flow_pkt_size": data_flow_pkt_size,
189+
"flow_pkt_count": None,
190+
"flow_delay_sec": data_flow_delay_sec,
191+
"flow_traffic_type": traffic_flow_mode.FIXED_DURATION
192+
}
193+
194+
if (test_traffic_pause):
195+
if snappi_extra_params.traffic_flow_config.pause_flow_config is None:
196+
snappi_extra_params.traffic_flow_config.pause_flow_config = {
197+
"flow_name": PAUSE_FLOW_NAME,
198+
"flow_dur_sec": None,
199+
"flow_rate_percent": None,
200+
"flow_rate_pps": calc_pfc_pause_flow_rate(speed_gbps),
201+
"flow_rate_bps": None,
202+
"flow_pkt_size": 64,
203+
"flow_pkt_count": None,
204+
"flow_delay_sec": 0,
205+
"flow_traffic_type": traffic_flow_mode.CONTINUOUS
206+
}
207+
208+
if snappi_extra_params.packet_capture_type == packet_capture.PFC_CAPTURE:
209+
# PFC pause frame capture is requested
210+
valid_pfc_frame_test = True
211+
else:
212+
# PFC pause frame capture is not requested
213+
valid_pfc_frame_test = False
214+
215+
if (test_traffic_pause):
216+
if valid_pfc_frame_test:
217+
snappi_extra_params.traffic_flow_config.pause_flow_config["flow_dur_sec"] = DATA_FLOW_DURATION_SEC + \
218+
data_flow_delay_sec + SNAPPI_POLL_DELAY_SEC + PAUSE_FLOW_DUR_BASE_SEC
219+
snappi_extra_params.traffic_flow_config.pause_flow_config["flow_traffic_type"] = \
220+
traffic_flow_mode.FIXED_DURATION
221+
222+
# Generate test flow config based on number of ingress ports
223+
# Every ingress port will be used as index. Example - test flow stream 0 - for first ingress.
224+
for m in range(port_map[2]):
225+
generate_test_flows(testbed_config=testbed_config,
226+
test_flow_prio_list=test_prio_list,
227+
prio_dscp_map=prio_dscp_map,
228+
snappi_extra_params=snappi_extra_params,
229+
flow_index=m)
230+
231+
if (test_def['background_traffic']):
232+
for m in range(port_map[2]):
233+
if snappi_extra_params.gen_background_traffic:
234+
# Generate background flow config
235+
generate_background_flows(testbed_config=testbed_config,
236+
bg_flow_prio_list=bg_prio_list,
237+
prio_dscp_map=prio_dscp_map,
238+
snappi_extra_params=snappi_extra_params,
239+
flow_index=m)
240+
241+
# Generate pause storm config
242+
if (test_traffic_pause):
243+
for m in range(port_map[0]):
244+
generate_pause_flows(testbed_config=testbed_config,
245+
pause_prio_list=pause_prio_list,
246+
global_pause=global_pause,
247+
snappi_extra_params=snappi_extra_params,
248+
flow_index=m)
249+
250+
flows = testbed_config.flows
251+
252+
all_flow_names = [flow.name for flow in flows]
253+
data_flow_names = [flow.name for flow in flows if PAUSE_FLOW_NAME not in flow.name]
254+
255+
# Clear PFC, queue and interface counters before traffic run
256+
for dut in dut_list:
257+
dut.command("pfcstat -c \n")
258+
time.sleep(1)
259+
dut.command("sonic-clear queuecounters \n")
260+
time.sleep(1)
261+
dut.command("sonic-clear counters \n")
262+
time.sleep(1)
263+
264+
exp_dur_sec = DATA_FLOW_DURATION_SEC + data_flow_delay_sec
265+
266+
""" Run traffic """
267+
tgen_flow_stats, switch_flow_stats, test_stats = \
268+
run_traffic_and_collect_stats(rx_duthost=ingress_duthost,
269+
tx_duthost=egress_duthost,
270+
api=api,
271+
config=testbed_config,
272+
data_flow_names=data_flow_names,
273+
all_flow_names=all_flow_names,
274+
exp_dur_sec=exp_dur_sec,
275+
port_map=test_def['port_map'],
276+
fname=fname,
277+
stats_interval=test_def['stats_interval'],
278+
imix=test_def['imix'],
279+
snappi_extra_params=snappi_extra_params)
280+
281+
test_check = test_def['test_check']
282+
if (not test_check['loss_expected']):
283+
# Check for loss packets on IXIA and DUT.
284+
pytest_assert(test_stats['tgen_loss_pkts'] == 0, 'Loss seen on TGEN')
285+
pytest_assert(test_stats['dut_loss_pkts'] == 0, 'Loss seen on DUT')
286+
287+
# Check for Tx and Rx packets on IXIA for lossless and lossy streams.
288+
pytest_assert(test_stats['tgen_lossless_rx_pkts'] == test_stats['tgen_lossless_tx_pkts'],
289+
'Losses observed in lossless traffic streams')
290+
pytest_assert(test_stats['tgen_lossy_rx_pkts'] == test_stats['tgen_lossy_tx_pkts'],
291+
'Losses observed in lossy traffic streams')
292+
293+
# Check for Rx packets between IXIA and DUT for lossy and lossless streams.
294+
pytest_assert(test_stats['tgen_lossless_rx_pkts'] == test_stats['dut_lossless_pkts'],
295+
'Losses observed in lossless traffic streams on DUT Tx and IXIA Rx')
296+
pytest_assert(test_stats['tgen_lossy_rx_pkts'] == test_stats['dut_lossy_pkts'],
297+
'Losses observed in lossy traffic streams on DUT Tx and IXIA Rx')
298+
else:
299+
# Check for lossless and lossy stream percentage drop for a given tolerance limit.
300+
lossless_drop = round((1 - float(test_stats['tgen_lossless_rx_pkts']) / test_stats['tgen_lossless_tx_pkts']), 2)
301+
lossy_drop = round((1 - float(test_stats['tgen_lossy_rx_pkts']) / test_stats['tgen_lossy_tx_pkts']), 2)
302+
logger.info('Lossless Drop %:{}, Lossy Drop %:{}'.format(lossless_drop*100, lossy_drop*100))
303+
if test_def['enable_pfcwd']:
304+
pytest_assert((lossless_drop*100) <= test_check['lossless'], 'Lossless packet drop outside tolerance limit')
305+
pytest_assert((lossy_drop*100) <= test_check['lossy'], 'Lossy packet drop outside tolerance limit')
306+
307+
# Checking if the actual line rate on egress is within tolerable limit of egress line speed.
308+
pytest_assert(((1 - test_stats['tgen_rx_rate'] / float(port_map[0]*port_map[1]))*100) <= test_check['speed_tol'],
309+
'Egress speed beyond tolerance range')
310+
311+
# Checking for PFC counts on DUT
312+
if (not test_check['pfc']):
313+
pytest_assert(test_stats['lossless_tx_pfc'] == 0, 'Error:PFC transmitted by DUT for lossless priorities')
314+
pytest_assert(test_stats['lossy_rx_tx_pfc'] == 0, 'Error:PFC transmitted by DUT for lossy priorities')
315+
else:
316+
if (test_traffic_pause):
317+
pytest_assert(test_stats['lossless_rx_pfc'] > 0, 'Error:No Rx PFCs to DUT from IXIA')
318+
if ((test_stats['lossless_rx_pfc'] != 0) and (not test_def['enable_pfcwd'])):
319+
pytest_assert(test_stats['lossless_tx_pfc'] > 0, 'Error:No Tx PFCs from DUT after receiving PFCs')
320+
pytest_assert(test_stats['lossless_tx_pfc'] > 0, 'Error: PFC not be transmitted from DUT on congestion')
321+
pytest_assert(test_stats['lossy_rx_tx_pfc'] == 0, 'Error:Incorrect Rx/Tx PFCs on DUT for lossy priorities')
322+
323+
# Reset pfc delay parameter
324+
pfc = testbed_config.layer1[0].flow_control.ieee_802_1qbb
325+
pfc.pfc_delay = 0
326+
327+
# Verify PFC pause frames
328+
if (test_traffic_pause):
329+
if valid_pfc_frame_test:
330+
is_valid_pfc_frame = validate_pfc_frame(snappi_extra_params.packet_capture_file + ".pcapng")
331+
pytest_assert(is_valid_pfc_frame, "PFC frames invalid")
332+
return
333+
334+
# Verify pause flows
335+
if (test_traffic_pause):
336+
for metric in tgen_flow_stats:
337+
if PAUSE_FLOW_NAME in metric.name:
338+
pause_flow_name = metric.name
339+
verify_pause_flow(flow_metrics=tgen_flow_stats,
340+
pause_flow_name=pause_flow_name)
341+
342+
# Check for the flows ONLY if normal packet size (non-imix) is used.
343+
if (test_def['background_traffic'] and test_def['verify_flows'] and not test_def['imix']):
344+
if snappi_extra_params.gen_background_traffic:
345+
# Verify background flows
346+
verify_background_flow(flow_metrics=tgen_flow_stats,
347+
speed_gbps=speed_gbps,
348+
tolerance=TOLERANCE_THRESHOLD,
349+
snappi_extra_params=snappi_extra_params)
350+
351+
# Verify basic test flows metrics from ixia
352+
if (test_def['verify_flows'] and not test_def['imix']):
353+
verify_basic_test_flow(flow_metrics=tgen_flow_stats,
354+
speed_gbps=speed_gbps,
355+
tolerance=TOLERANCE_THRESHOLD,
356+
test_flow_pause=test_traffic_pause,
357+
snappi_extra_params=snappi_extra_params)
358+
359+
if (test_traffic_pause and test_def['verify_flows']):
360+
verify_pause_frame_count_dut(rx_dut=ingress_duthost,
361+
tx_dut=egress_duthost,
362+
test_traffic_pause=test_traffic_pause,
363+
global_pause=global_pause,
364+
snappi_extra_params=snappi_extra_params)
365+
366+
# Verify in flight TX lossless packets do not leave the DUT when traffic is expected
367+
# to be paused, or leave the DUT when the traffic is not expected to be paused
368+
# Only true if pfcwd is disabled, else packets will dropped.
369+
verify_egress_queue_frame_count(duthost=egress_duthost,
370+
switch_flow_stats=switch_flow_stats,
371+
test_traffic_pause=test_traffic_pause,
372+
snappi_extra_params=snappi_extra_params)
373+
374+
if (test_traffic_pause and test_def['verify_flows']):
375+
# Verify in flight TX packets count relative to switch buffer size
376+
verify_in_flight_buffer_pkts(duthost=ingress_duthost,
377+
asic_value=rx_port['asic_value'],
378+
flow_metrics=tgen_flow_stats,
379+
snappi_extra_params=snappi_extra_params)
380+
381+
# Verify zero pause frames are counted when the PFC class enable vector is not set
382+
verify_unset_cev_pause_frame_count(duthost=egress_duthost,
383+
snappi_extra_params=snappi_extra_params)

0 commit comments

Comments
 (0)