Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
from tests.common.fixtures.conn_graph_facts import conn_graph_facts, fanout_graph_facts # noqa: F401
from tests.common.snappi_tests.snappi_helpers import get_dut_port_id # noqa: F401
from tests.common.snappi_tests.common_helpers import pfc_class_enable_vector, stop_pfcwd, \
disable_packet_aging, sec_to_nanosec # noqa: F401
disable_packet_aging, sec_to_nanosec, get_interface_stats # noqa: F401
from tests.common.snappi_tests.port import select_ports # noqa: F401
from tests.common.snappi_tests.snappi_test_params import SnappiTestParams
from tests.common.snappi_tests.traffic_generation import run_traffic, verify_pause_flow, \
Expand All @@ -23,8 +23,8 @@
BG_FLOW_NAME = 'Background Flow'
BG_FLOW_AGGR_RATE_PERCENT = 25
DATA_PKT_SIZE = 1024
DATA_FLOW_DURATION_SEC = 20
PAUSE_FLOW_DURATION_SEC = 10
DATA_FLOW_DURATION_SEC = 10
PAUSE_FLOW_DURATION_SEC = 5
PAUSE_FLOW_DELAY_SEC = 5
DATA_FLOW_DELAY_SEC = 0
SNAPPI_POLL_DELAY_SEC = 2
Expand Down Expand Up @@ -78,6 +78,7 @@ def run_lossless_response_to_external_pause_storms_test(api,

tx_port = [snappi_extra_params.multi_dut_params.multi_dut_ports[1],
snappi_extra_params.multi_dut_params.multi_dut_ports[2]]
ingress_duthost = tx_port[0]['duthost']
tx_port_id_list = [tx_port[0]["port_id"], tx_port[1]["port_id"]]
# add ingress DUT into the set
dut_asics_to_be_configured.add((tx_port[0]['duthost'], tx_port[0]['asic_value']))
Expand Down Expand Up @@ -128,6 +129,21 @@ def run_lossless_response_to_external_pause_storms_test(api,
exp_dur_sec=DATA_FLOW_DURATION_SEC + DATA_FLOW_DELAY_SEC,
snappi_extra_params=snappi_extra_params)

tx_port1 = tx_port[0]['peer_port']
tx_port2 = tx_port[1]['peer_port']
# Fetch relevant statistics
pkt_drop1 = get_interface_stats(ingress_duthost, tx_port1)[ingress_duthost.hostname][tx_port1]['rx_fail']
pkt_drop2 = get_interface_stats(ingress_duthost, tx_port2)[ingress_duthost.hostname][tx_port2]['rx_fail']
rx_pkts_1 = get_interface_stats(ingress_duthost, tx_port1)[ingress_duthost.hostname][tx_port1]['rx_pkts']
rx_pkts_2 = get_interface_stats(ingress_duthost, tx_port2)[ingress_duthost.hostname][tx_port2]['rx_pkts']
# Calculate the total packet drop
pkt_drop = pkt_drop1 + pkt_drop2
# Calculate the total received packets
total_rx_pkts = rx_pkts_1 + rx_pkts_2
# Calculate the drop percentage
drop_percentage = 100 * pkt_drop / total_rx_pkts
pytest_assert(ceil(drop_percentage) == 0, 'FAIL: There should be no packet drops in ingress dut counters')

verify_external_pause_storm_result(flow_stats,
tx_port,
rx_port)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,8 @@
from tests.common.fixtures.conn_graph_facts import conn_graph_facts, fanout_graph_facts # noqa: F401
from tests.common.snappi_tests.snappi_helpers import get_dut_port_id # noqa: F401
from tests.common.snappi_tests.common_helpers import pfc_class_enable_vector, stop_pfcwd, disable_packet_aging, \
get_pfcwd_poll_interval, get_pfcwd_detect_time, get_pfcwd_restore_time, sec_to_nanosec # noqa: F401
get_pfcwd_poll_interval, get_pfcwd_detect_time, get_pfcwd_restore_time, sec_to_nanosec, \
get_interface_stats # noqa: F401
from tests.common.snappi_tests.port import select_ports # noqa: F401
from tests.common.snappi_tests.snappi_test_params import SnappiTestParams
from tests.common.snappi_tests.traffic_generation import run_traffic, verify_pause_flow, \
Expand All @@ -27,11 +28,11 @@
BG_FLOW_AGGR_RATE_PERCENT = 25
PAUSE_FLOW_RATE = 15
DATA_PKT_SIZE = 1024
DATA_FLOW_DURATION_SEC = 20
DATA_FLOW_DURATION_SEC = 10
DATA_FLOW_DELAY_SEC = 0
SNAPPI_POLL_DELAY_SEC = 2
TOLERANCE_THRESHOLD = 0.05
PAUSE_FLOW_DURATION_SEC = 10
PAUSE_FLOW_DURATION_SEC = 5
PAUSE_FLOW_DELAY_SEC = 5


Expand Down Expand Up @@ -83,6 +84,7 @@ def run_lossless_response_to_throttling_pause_storms_test(api,

tx_port = [snappi_extra_params.multi_dut_params.multi_dut_ports[1],
snappi_extra_params.multi_dut_params.multi_dut_ports[2]]
ingress_duthost = tx_port[0]['duthost']
tx_port_id_list = [tx_port[0]["port_id"], tx_port[1]["port_id"]]
# add ingress DUT into the set
dut_asics_to_be_configured.add((tx_port[0]['duthost'], tx_port[0]['asic_value']))
Expand Down Expand Up @@ -134,6 +136,22 @@ def run_lossless_response_to_throttling_pause_storms_test(api,
exp_dur_sec=DATA_FLOW_DURATION_SEC + DATA_FLOW_DELAY_SEC,
snappi_extra_params=snappi_extra_params)

tx_port1 = tx_port[0]['peer_port']
tx_port2 = tx_port[1]['peer_port']
# Fetch relevant statistics
pkt_drop1 = get_interface_stats(ingress_duthost, tx_port1)[ingress_duthost.hostname][tx_port1]['rx_fail']
pkt_drop2 = get_interface_stats(ingress_duthost, tx_port2)[ingress_duthost.hostname][tx_port2]['rx_fail']
rx_pkts_1 = get_interface_stats(ingress_duthost, tx_port1)[ingress_duthost.hostname][tx_port1]['rx_pkts']
rx_pkts_2 = get_interface_stats(ingress_duthost, tx_port2)[ingress_duthost.hostname][tx_port2]['rx_pkts']
# Calculate the total packet drop
pkt_drop = pkt_drop1 + pkt_drop2
# Calculate the total received packets
total_rx_pkts = rx_pkts_1 + rx_pkts_2
# Calculate the drop percentage
drop_percentage = 100 * pkt_drop / total_rx_pkts
pytest_assert(ceil(drop_percentage) == 0, 'FAIL: There should be no packet drops in ingress dut counters')

""" Verify Results """
verify_throttling_pause_storm_result(flow_stats,
tx_port,
rx_port)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,13 @@
from tests.common.fixtures.conn_graph_facts import conn_graph_facts, fanout_graph_facts # noqa: F401
from tests.common.snappi_tests.snappi_helpers import get_dut_port_id # noqa: F401
from tests.common.snappi_tests.common_helpers import pfc_class_enable_vector, stop_pfcwd, \
disable_packet_aging, sec_to_nanosec # noqa: F401
disable_packet_aging, sec_to_nanosec, get_interface_stats # noqa: F401
from tests.common.snappi_tests.port import select_ports # noqa: F401
from tests.common.snappi_tests.snappi_test_params import SnappiTestParams
from tests.common.snappi_tests.traffic_generation import run_traffic, \
setup_base_traffic_config # noqa: F401
from tests.snappi_tests.variables import pfcQueueGroupSize, pfcQueueValueDict
from math import ceil
logger = logging.getLogger(__name__)

PAUSE_FLOW_NAME = 'Pause Storm'
Expand All @@ -18,8 +19,8 @@
BG_FLOW_NAME = 'Background Flow'
BG_FLOW_AGGR_RATE_PERCENT = [20, 20]
DATA_PKT_SIZE = 1024
DATA_FLOW_DURATION_SEC = 20
DATA_FLOW_DELAY_SEC = 10
DATA_FLOW_DURATION_SEC = 10
DATA_FLOW_DELAY_SEC = 5
SNAPPI_POLL_DELAY_SEC = 2


Expand Down Expand Up @@ -70,6 +71,7 @@ def run_m2o_fluctuating_lossless_test(api,

tx_port = [snappi_extra_params.multi_dut_params.multi_dut_ports[1],
snappi_extra_params.multi_dut_params.multi_dut_ports[2]]
ingress_duthost = tx_port[0]['duthost']
tx_port_id_list = [tx_port[0]["port_id"], tx_port[1]["port_id"]]
# add ingress DUT into the set
dut_asics_to_be_configured.add((tx_port[0]['duthost'], tx_port[0]['asic_value']))
Expand Down Expand Up @@ -116,6 +118,22 @@ def run_m2o_fluctuating_lossless_test(api,
exp_dur_sec=DATA_FLOW_DURATION_SEC + DATA_FLOW_DELAY_SEC,
snappi_extra_params=snappi_extra_params)

tx_port1 = tx_port[0]['peer_port']
tx_port2 = tx_port[1]['peer_port']
# Fetch relevant statistics
pkt_drop1 = get_interface_stats(ingress_duthost, tx_port1)[ingress_duthost.hostname][tx_port1]['rx_fail']
pkt_drop2 = get_interface_stats(ingress_duthost, tx_port2)[ingress_duthost.hostname][tx_port2]['rx_fail']
rx_pkts_1 = get_interface_stats(ingress_duthost, tx_port1)[ingress_duthost.hostname][tx_port1]['rx_pkts']
rx_pkts_2 = get_interface_stats(ingress_duthost, tx_port2)[ingress_duthost.hostname][tx_port2]['rx_pkts']
# Calculate the total packet drop
pkt_drop = pkt_drop1 + pkt_drop2
# Calculate the total received packets
total_rx_pkts = rx_pkts_1 + rx_pkts_2
# Calculate the drop percentage
drop_percentage = 100 * pkt_drop / total_rx_pkts
pytest_assert(ceil(drop_percentage) == 8, 'FAIL: Drop packets must be around 8 percent')

""" Verify Results """
verify_m2o_fluctuating_lossless_result(flow_stats,
tx_port,
rx_port)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
from tests.common.fixtures.conn_graph_facts import conn_graph_facts, fanout_graph_facts # noqa: F401
from tests.common.snappi_tests.snappi_helpers import get_dut_port_id # noqa: F401
from tests.common.snappi_tests.common_helpers import pfc_class_enable_vector, \
stop_pfcwd, disable_packet_aging, sec_to_nanosec # noqa: F401
stop_pfcwd, disable_packet_aging, sec_to_nanosec, get_interface_stats # noqa: F401
from tests.common.snappi_tests.port import select_ports # noqa: F401
from tests.common.snappi_tests.snappi_test_params import SnappiTestParams
from tests.common.snappi_tests.traffic_generation import setup_base_traffic_config, \
Expand All @@ -24,8 +24,8 @@
BG_FLOW_NAME = 'Background Flow'
BG_FLOW_AGGR_RATE_PERCENT = 25
DATA_PKT_SIZE = 1024
DATA_FLOW_DURATION_SEC = 20
DATA_FLOW_DELAY_SEC = 10
DATA_FLOW_DURATION_SEC = 10
DATA_FLOW_DELAY_SEC = 5
SNAPPI_POLL_DELAY_SEC = 2
TOLERANCE_THRESHOLD = 0.05

Expand Down Expand Up @@ -73,6 +73,7 @@ def run_m2o_oversubscribe_lossless_test(api,

tx_port = [snappi_extra_params.multi_dut_params.multi_dut_ports[1],
snappi_extra_params.multi_dut_params.multi_dut_ports[2]]
ingress_duthost = tx_port[0]['duthost']
tx_port_id_list = [tx_port[0]["port_id"], tx_port[1]["port_id"]]
# add ingress DUT into the set
dut_asics_to_be_configured.add((tx_port[0]['duthost'], tx_port[0]['asic_value']))
Expand Down Expand Up @@ -121,6 +122,22 @@ def run_m2o_oversubscribe_lossless_test(api,
exp_dur_sec=DATA_FLOW_DURATION_SEC + DATA_FLOW_DELAY_SEC,
snappi_extra_params=snappi_extra_params)

tx_port1 = tx_port[0]['peer_port']
tx_port2 = tx_port[1]['peer_port']
# Fetch relevant statistics
pkt_drop1 = get_interface_stats(ingress_duthost, tx_port1)[ingress_duthost.hostname][tx_port1]['rx_fail']
pkt_drop2 = get_interface_stats(ingress_duthost, tx_port2)[ingress_duthost.hostname][tx_port2]['rx_fail']
rx_pkts_1 = get_interface_stats(ingress_duthost, tx_port1)[ingress_duthost.hostname][tx_port1]['rx_pkts']
rx_pkts_2 = get_interface_stats(ingress_duthost, tx_port2)[ingress_duthost.hostname][tx_port2]['rx_pkts']
# Calculate the total packet drop
pkt_drop = pkt_drop1 + pkt_drop2
# Calculate the total received packets
total_rx_pkts = rx_pkts_1 + rx_pkts_2
# Calculate the drop percentage
drop_percentage = 100 * pkt_drop / total_rx_pkts
pytest_assert(ceil(drop_percentage) == 0, 'FAIL: There should be no packet drops in ingress dut counters')

""" Verify Results """
verify_m2o_oversubscribe_lossless_result(flow_stats,
tx_port,
rx_port)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
from tests.common.fixtures.conn_graph_facts import conn_graph_facts, fanout_graph_facts # noqa: F401
from tests.common.snappi_tests.snappi_helpers import get_dut_port_id # noqa: F401
from tests.common.snappi_tests.common_helpers import pfc_class_enable_vector, \
stop_pfcwd, disable_packet_aging, sec_to_nanosec # noqa: F401
stop_pfcwd, disable_packet_aging, sec_to_nanosec, get_interface_stats # noqa: F401
from tests.common.snappi_tests.port import select_ports # noqa: F401
from tests.common.snappi_tests.snappi_test_params import SnappiTestParams
from tests.common.snappi_tests.traffic_generation import run_traffic, \
Expand All @@ -25,8 +25,8 @@
BG_FLOW_NAME = 'Background Flow'
BG_FLOW_AGGR_RATE_PERCENT = [20, 40]
DATA_PKT_SIZE = 1024
DATA_FLOW_DURATION_SEC = 20
DATA_FLOW_DELAY_SEC = 10
DATA_FLOW_DURATION_SEC = 10
DATA_FLOW_DELAY_SEC = 5
SNAPPI_POLL_DELAY_SEC = 2
TOLERANCE_THRESHOLD = 0.05

Expand Down Expand Up @@ -78,6 +78,7 @@ def run_pfc_m2o_oversubscribe_lossless_lossy_test(api,

tx_port = [snappi_extra_params.multi_dut_params.multi_dut_ports[1],
snappi_extra_params.multi_dut_params.multi_dut_ports[2]]
ingress_duthost = tx_port[0]['duthost']
tx_port_id_list = [tx_port[0]["port_id"], tx_port[1]["port_id"]]
# add ingress DUT into the set
dut_asics_to_be_configured.add((tx_port[0]['duthost'], tx_port[0]['asic_value']))
Expand Down Expand Up @@ -124,6 +125,22 @@ def run_pfc_m2o_oversubscribe_lossless_lossy_test(api,
exp_dur_sec=DATA_FLOW_DURATION_SEC + DATA_FLOW_DELAY_SEC,
snappi_extra_params=snappi_extra_params)

tx_port1 = tx_port[0]['peer_port']
tx_port2 = tx_port[1]['peer_port']
# Fetch relevant statistics
pkt_drop1 = get_interface_stats(ingress_duthost, tx_port1)[ingress_duthost.hostname][tx_port1]['rx_fail']
pkt_drop2 = get_interface_stats(ingress_duthost, tx_port2)[ingress_duthost.hostname][tx_port2]['rx_fail']
rx_pkts_1 = get_interface_stats(ingress_duthost, tx_port1)[ingress_duthost.hostname][tx_port1]['rx_pkts']
rx_pkts_2 = get_interface_stats(ingress_duthost, tx_port2)[ingress_duthost.hostname][tx_port2]['rx_pkts']
# Calculate the total packet drop
pkt_drop = pkt_drop1 + pkt_drop2
# Calculate the total received packets
total_rx_pkts = rx_pkts_1 + rx_pkts_2
# Calculate the drop percentage
drop_percentage = 100 * pkt_drop / total_rx_pkts
pytest_assert(ceil(drop_percentage) == 5, 'FAIL: Drop packets must be around 5 percent')

""" Verify Results """
verify_m2o_oversubscribe_lossless_lossy_result(flow_stats,
tx_port,
rx_port)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
from tests.common.fixtures.conn_graph_facts import conn_graph_facts, fanout_graph_facts # noqa: F401
from tests.common.snappi_tests.snappi_helpers import get_dut_port_id # noqa: F401
from tests.common.snappi_tests.common_helpers import pfc_class_enable_vector, \
stop_pfcwd, disable_packet_aging # noqa: F401
stop_pfcwd, disable_packet_aging, get_interface_stats # noqa: F401
from tests.common.snappi_tests.port import select_ports # noqa: F401
from tests.common.snappi_tests.snappi_test_params import SnappiTestParams
from tests.common.snappi_tests.traffic_generation import setup_base_traffic_config, \
Expand All @@ -24,8 +24,8 @@
BG_FLOW_NAME = 'Background Flow'
BG_FLOW_AGGR_RATE_PERCENT = 25
DATA_PKT_SIZE = 1024
DATA_FLOW_DURATION_SEC = 5
DATA_FLOW_DELAY_SEC = 2
DATA_FLOW_DURATION_SEC = 10
DATA_FLOW_DELAY_SEC = 5
SNAPPI_POLL_DELAY_SEC = 2
TOLERANCE_THRESHOLD = 0.05

Expand Down Expand Up @@ -77,6 +77,7 @@ def run_pfc_m2o_oversubscribe_lossy_test(api,

tx_port = [snappi_extra_params.multi_dut_params.multi_dut_ports[1],
snappi_extra_params.multi_dut_params.multi_dut_ports[2]]
ingress_duthost = tx_port[0]['duthost']
tx_port_id_list = [tx_port[0]["port_id"], tx_port[1]["port_id"]]
# add ingress DUT into the set
dut_asics_to_be_configured.add((tx_port[0]['duthost'], tx_port[0]['asic_value']))
Expand Down Expand Up @@ -126,6 +127,20 @@ def run_pfc_m2o_oversubscribe_lossy_test(api,
exp_dur_sec=DATA_FLOW_DURATION_SEC + DATA_FLOW_DELAY_SEC,
snappi_extra_params=snappi_extra_params)

tx_port1 = tx_port[0]['peer_port']
tx_port2 = tx_port[1]['peer_port']
pkt_drop1 = get_interface_stats(ingress_duthost, tx_port1)[ingress_duthost.hostname][tx_port1]['rx_fail']
pkt_drop2 = get_interface_stats(ingress_duthost, tx_port2)[ingress_duthost.hostname][tx_port2]['rx_fail']
rx_pkts_1 = get_interface_stats(ingress_duthost, tx_port1)[ingress_duthost.hostname][tx_port1]['rx_pkts']
rx_pkts_2 = get_interface_stats(ingress_duthost, tx_port2)[ingress_duthost.hostname][tx_port2]['rx_pkts']
# Calculate the total packet drop
pkt_drop = pkt_drop1 + pkt_drop2
# Calculate the total received packets
total_rx_pkts = rx_pkts_1 + rx_pkts_2
# Calculate the drop percentage
drop_percentage = 100 * pkt_drop / total_rx_pkts
pytest_assert(ceil(drop_percentage) == 10, 'FAIL: Drop packets must be around 10 percent')

""" Verify Results """
verify_m2o_oversubscribe_lossy_result(flow_stats,
tx_port,
Expand Down