Skip to content

Commit

Permalink
ECN IXIA test for verifying equal marking due to traffic causing cong…
Browse files Browse the repository at this point in the history
…estion (#15849)

Description of PR
Summary:
Fixes # (issue)

Approach
What is the motivation for this PR?
Make the test case multi Topo capable.
Add ecn marking ratio check for flow percent where both

lossless TC are >= 50 to have equal marking

How did you do it?
Ixia testcase enhancement

How did you verify/test it?
On Ixia connected DUT

co-authorized by: jianquanye@microsoft.com
  • Loading branch information
sreejithsreekumaran authored and mssonicbld committed Dec 9, 2024
1 parent d7181ef commit 8be236e
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 5 deletions.
8 changes: 7 additions & 1 deletion tests/snappi_tests/multidut/ecn/files/multidut_helper.py
Original file line number Diff line number Diff line change
Expand Up @@ -142,11 +142,17 @@ def verify_ecn_counters_for_flow_percent(ecn_counters, test_flow_percent):
'Must not have ecn marked packets on flow 4, percent {}'.
format(test_flow_percent))

if test_flow_percent[0] == 50 and test_flow_percent[1] == 50:
if test_flow_percent[0] >= 50 and test_flow_percent[1] >= 50:
pytest_assert(
flow3_ecn > 0 and flow4_ecn > 0,
'Must have ecn marked packets on flows 3, 4, percent {}'.
format(test_flow_percent))
flow_ecn_ratio = round(float(flow3_ecn/flow4_ecn), 2)
pytest_assert(
round(abs(flow_ecn_ratio - 1), 3) <= 0.05,
"The packet flow ecn ratio {} deviation more than tolerance for \
flow percent {} flow 3 ecn -> {} flow 4 ecn -> {}".
format(flow_ecn_ratio, test_flow_percent, flow3_ecn, flow4_ecn))


def run_ecn_test(api,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,18 +2,19 @@
import logging
from tabulate import tabulate # noqa F401
from tests.common.helpers.assertions import pytest_assert # noqa: F401
from tests.common.fixtures.conn_graph_facts import conn_graph_facts, fanout_graph_facts_multidut # noqa: F401
from tests.common.fixtures.conn_graph_facts import conn_graph_facts, fanout_graph_facts, \
fanout_graph_facts_multidut # 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_snappi_ports, get_snappi_ports_for_rdma, cleanup_config, \
is_snappi_multidut, get_snappi_ports_multi_dut # noqa: F401
is_snappi_multidut, get_snappi_ports_multi_dut, get_snappi_ports_single_dut # noqa: F401
from tests.common.snappi_tests.qos_fixtures import prio_dscp_map, \
lossless_prio_list, disable_pfcwd # noqa F401
from tests.snappi_tests.files.helper import multidut_port_info, setup_ports_and_dut # noqa: F401
from tests.snappi_tests.multidut.ecn.files.multidut_helper import run_ecn_marking_test, run_ecn_marking_port_toggle_test
from tests.common.snappi_tests.snappi_test_params import SnappiTestParams
from tests.common.cisco_data import is_cisco_device
logger = logging.getLogger(__name__)
pytestmark = [pytest.mark.topology('multidut-tgen')]
pytestmark = [pytest.mark.topology('multidut-tgen', 'tgen')]


def validate_snappi_ports(snappi_ports):
Expand Down Expand Up @@ -110,7 +111,7 @@ def test_ecn_marking_port_toggle(
cleanup_config(duthosts, snappi_ports)


test_flow_percent_list = [[90, 15], [53, 49], [15, 90], [49, 49], [50, 50]]
test_flow_percent_list = [[90, 15], [53, 49], [15, 90], [49, 49], [50, 50], [60, 60], [60, 90], [90, 60]]


@pytest.mark.parametrize("test_flow_percent", test_flow_percent_list)
Expand Down

0 comments on commit 8be236e

Please sign in to comment.