Skip to content

Commit

Permalink
[Snappi] Adding Lossless Response to External pause storm test case (s…
Browse files Browse the repository at this point in the history
…onic-net#8024)

* adding lossless response to external pause storm test case

Co-authored-by: selldinesh <[email protected]>
  • Loading branch information
2 people authored and parmarkj committed Jul 17, 2024
1 parent 6d45f7d commit ab5b53f
Show file tree
Hide file tree
Showing 2 changed files with 43 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,10 @@
PAUSE_FLOW_DELAY_SEC = 5
DATA_FLOW_DELAY_SEC = 0
SNAPPI_POLL_DELAY_SEC = 2
<<<<<<< HEAD
=======
TOLERANCE_THRESHOLD = 0.05
>>>>>>> [Snappi] Adding Lossless Response to External pause storm test case (#8024)
PAUSE_FLOW_RATE = 15
PAUSE_FLOW_NAME = 'PFC Traffic'

Expand Down Expand Up @@ -109,13 +113,23 @@ def run_lossless_response_to_external_pause_storms_test(api,
data_flow_names = [flow.name for flow in flows if PAUSE_FLOW_NAME not in flow.name]

""" Run traffic """
<<<<<<< HEAD
flow_stats, switch_flow_stats, _ = run_traffic(duthost=duthost1,
api=api,
config=testbed_config,
data_flow_names=data_flow_names,
all_flow_names=all_flow_names,
exp_dur_sec=DATA_FLOW_DURATION_SEC + DATA_FLOW_DELAY_SEC,
snappi_extra_params=snappi_extra_params)
=======
flow_stats, switch_flow_stats = run_traffic(duthost=duthost1,
api=api,
config=testbed_config,
data_flow_names=data_flow_names,
all_flow_names=all_flow_names,
exp_dur_sec=DATA_FLOW_DURATION_SEC + DATA_FLOW_DELAY_SEC,
snappi_extra_params=snappi_extra_params)
>>>>>>> [Snappi] Adding Lossless Response to External pause storm test case (#8024)
flag = {
'Test Flow': {
'loss': '0'
Expand All @@ -125,9 +139,18 @@ def run_lossless_response_to_external_pause_storms_test(api,
}
}

<<<<<<< HEAD
verify_m2o_oversubscribtion_results(rows=flow_stats,
test_flow_name=TEST_FLOW_NAME,
bg_flow_name=BG_FLOW_NAME,
=======
verify_m2o_oversubscribtion_results(duthost=duthost2,
rows=flow_stats,
test_flow_name=TEST_FLOW_NAME,
bg_flow_name=BG_FLOW_NAME,
rx_port=rx_port,
rx_frame_count_deviation=TOLERANCE_THRESHOLD,
>>>>>>> [Snappi] Adding Lossless Response to External pause storm test case (#8024)
flag=flag)

# Verify pause flows
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,18 @@
fanout_graph_facts # noqa: F401
from tests.common.snappi_tests.snappi_fixtures import snappi_api_serv_ip, snappi_api_serv_port, \
snappi_api, snappi_dut_base_config, get_tgen_peer_ports, get_multidut_snappi_ports, \
<<<<<<< HEAD
get_multidut_tgen_peer_port_set # noqa: F401
from tests.common.snappi_tests.qos_fixtures import prio_dscp_map, \
lossless_prio_list # noqa: F401
from tests.snappi_tests.variables import config_set, line_card_choice
=======
get_multidut_tgen_peer_port_set, cleanup_config # noqa: F401
from tests.common.snappi_tests.qos_fixtures import prio_dscp_map, \
lossless_prio_list # noqa: F401
from tests.snappi_tests.variables import config_set, line_card_choice
from tests.common.config_reload import config_reload
>>>>>>> [Snappi] Adding Lossless Response to External pause storm test case (#8024)
from tests.snappi_tests.multidut.pfc.files.lossless_response_to_external_pause_storms_helper import (
run_lossless_response_to_external_pause_storms_test,
)
Expand Down Expand Up @@ -60,7 +68,11 @@ def test_lossless_response_to_external_pause_storms_test(snappi_api,
if line_card_choice not in linecard_configuration_set.keys():
assert False, "Invalid line_card_choice value passed in parameter"
if (len(linecard_configuration_set[line_card_choice]['hostname']) == 2):
<<<<<<< HEAD
dut_list = random.sample(list(duthosts), 2)
=======
dut_list = random.sample(duthosts, 2)
>>>>>>> [Snappi] Adding Lossless Response to External pause storm test case (#8024)
duthost1, duthost2 = dut_list
elif (len(linecard_configuration_set[line_card_choice]['hostname']) == 1):
dut_list = [dut for dut in duthosts if
Expand Down Expand Up @@ -99,3 +111,11 @@ def test_lossless_response_to_external_pause_storms_test(snappi_api,
bg_prio_list=bg_prio_list,
prio_dscp_map=prio_dscp_map,
snappi_extra_params=snappi_extra_params)
<<<<<<< HEAD
=======

# Teardown config through a reload
logger.info("Reloading config to teardown")
config_reload(sonic_host=duthost1, config_source='config_db', safe_reload=True)
config_reload(sonic_host=duthost2, config_source='config_db', safe_reload=True)
>>>>>>> [Snappi] Adding Lossless Response to External pause storm test case (#8024)

0 comments on commit ab5b53f

Please sign in to comment.