Skip to content

Commit

Permalink
Fixed the failure of test_valid_pfc_frame_with_snappi.py in Cisco DUT (
Browse files Browse the repository at this point in the history
…sonic-net#15002)

* Fixed the testcase as Cisco DUT generates XON frames.
This causes the PFC capture sampling to not detect a XOFF frame being capture.
Further the buffer size for capture could be small or big depending on the IXIA model capabaility
Hence using continous XOFF injection to avoid overwriting the buffer with XON frames post a XON-XOFF-XON transition

* Made !is_cisco do regular else cisco specific
  • Loading branch information
sreejithsreekumaran authored and yutongzhang-microsoft committed Nov 21, 2024
1 parent 7684cb9 commit 0b3ccde
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions tests/snappi_tests/pfc/files/helper.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,8 @@
verify_in_flight_buffer_pkts, verify_unset_cev_pause_frame_count, verify_tx_frame_count_dut, \
verify_rx_frame_count_dut
from tests.common.snappi_tests.snappi_test_params import SnappiTestParams
from tests.common.snappi_tests.read_pcap import validate_pfc_frame
from tests.common.cisco_data import is_cisco_device
from tests.common.snappi_tests.read_pcap import validate_pfc_frame, validate_pfc_frame_cisco


logger = logging.getLogger(__name__)
Expand Down Expand Up @@ -191,7 +192,7 @@ def run_pfc_test(api,
# PFC pause frame capture is not requested
valid_pfc_frame_test = False

if valid_pfc_frame_test:
if valid_pfc_frame_test and not is_cisco_device(duthost):
snappi_extra_params.traffic_flow_config.pause_flow_config["flow_dur_sec"] = DATA_FLOW_DURATION_SEC + \
data_flow_delay_sec + SNAPPI_POLL_DELAY_SEC + PAUSE_FLOW_DUR_BASE_SEC
snappi_extra_params.traffic_flow_config.pause_flow_config["flow_traffic_type"] = \
Expand Down Expand Up @@ -245,7 +246,11 @@ def run_pfc_test(api,

# Verify PFC pause frames
if valid_pfc_frame_test:
is_valid_pfc_frame, error_msg = validate_pfc_frame(snappi_extra_params.packet_capture_file + ".pcapng")
if not is_cisco_device(duthost):
is_valid_pfc_frame, error_msg = validate_pfc_frame(snappi_extra_params.packet_capture_file + ".pcapng")
else:
is_valid_pfc_frame, error_msg = validate_pfc_frame_cisco(
snappi_extra_params.packet_capture_file + ".pcapng")
pytest_assert(is_valid_pfc_frame, error_msg)
return

Expand Down

0 comments on commit 0b3ccde

Please sign in to comment.