diff --git a/tests/snappi_tests/multidut/pfc/files/m2o_fluctuating_lossless_helper.py b/tests/snappi_tests/multidut/pfc/files/m2o_fluctuating_lossless_helper.py index db06a83dfa9..2e31df6280c 100644 --- a/tests/snappi_tests/multidut/pfc/files/m2o_fluctuating_lossless_helper.py +++ b/tests/snappi_tests/multidut/pfc/files/m2o_fluctuating_lossless_helper.py @@ -341,7 +341,9 @@ def __gen_data_flow(testbed_config, elif 'Test Flow 2 -> 0' in flow.name: eth.pfc_queue.value = pfcQueueValueDict[flow_prio[1]] - src_port = UDP_PORT_START + eth.pfc_queue.value + global UDP_PORT_START + src_port = UDP_PORT_START + UDP_PORT_START += 1 udp.src_port.increment.start = src_port udp.src_port.increment.step = 1 udp.src_port.increment.count = 1 diff --git a/tests/snappi_tests/multidut/pfc/files/m2o_oversubscribe_lossless_helper.py b/tests/snappi_tests/multidut/pfc/files/m2o_oversubscribe_lossless_helper.py index d6015fee924..0a536d39664 100644 --- a/tests/snappi_tests/multidut/pfc/files/m2o_oversubscribe_lossless_helper.py +++ b/tests/snappi_tests/multidut/pfc/files/m2o_oversubscribe_lossless_helper.py @@ -5,7 +5,6 @@ # Compiled at: 2023-02-10 09:15:26 from math import ceil # noqa: F401 import logging # noqa: F401 -import random from tests.common.helpers.assertions import pytest_assert, pytest_require # noqa: F401 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 @@ -20,14 +19,15 @@ PAUSE_FLOW_NAME = 'Pause Storm' TEST_FLOW_NAME = 'Test Flow' -TEST_FLOW_AGGR_RATE_PERCENT = 30 +TEST_FLOW_AGGR_RATE_PERCENT = 35 BG_FLOW_NAME = 'Background Flow' -BG_FLOW_AGGR_RATE_PERCENT = 25 +BG_FLOW_AGGR_RATE_PERCENT = 22.5 DATA_PKT_SIZE = 1024 DATA_FLOW_DURATION_SEC = 10 DATA_FLOW_DELAY_SEC = 5 SNAPPI_POLL_DELAY_SEC = 2 TOLERANCE_THRESHOLD = 0.05 +UDP_PORT_START = 5000 def run_m2o_oversubscribe_lossless_test(api, @@ -297,10 +297,6 @@ def __gen_data_flow(testbed_config, flow.tx_rx.port.tx_name = testbed_config.ports[src_port_id].name flow.tx_rx.port.rx_name = testbed_config.ports[dst_port_id].name eth, ipv4, udp = flow.packet.ethernet().ipv4().udp() - src_port = random.randint(5000, 6000) - udp.src_port.increment.start = src_port - udp.src_port.increment.step = 1 - udp.src_port.increment.count = 1 eth.src.value = tx_mac eth.dst.value = rx_mac @@ -320,6 +316,13 @@ def __gen_data_flow(testbed_config, elif 'Test Flow 2 -> 0' in flow.name: eth.pfc_queue.value = pfcQueueValueDict[flow_prio[1]] + global UDP_PORT_START + src_port = UDP_PORT_START + UDP_PORT_START += 1 + udp.src_port.increment.start = src_port + udp.src_port.increment.step = 1 + udp.src_port.increment.count = 1 + ipv4.src.value = tx_port_config.ip ipv4.dst.value = rx_port_config.ip ipv4.priority.choice = ipv4.priority.DSCP diff --git a/tests/snappi_tests/multidut/pfc/files/m2o_oversubscribe_lossy_helper.py b/tests/snappi_tests/multidut/pfc/files/m2o_oversubscribe_lossy_helper.py index 90919abb367..d12a29a7dab 100644 --- a/tests/snappi_tests/multidut/pfc/files/m2o_oversubscribe_lossy_helper.py +++ b/tests/snappi_tests/multidut/pfc/files/m2o_oversubscribe_lossy_helper.py @@ -5,7 +5,6 @@ # Compiled at: 2023-02-10 09:15:26 from math import ceil # noqa: F401 import logging # noqa: F401 -import random from tests.common.helpers.assertions import pytest_assert, pytest_require # noqa: F401 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 @@ -28,6 +27,7 @@ DATA_FLOW_DELAY_SEC = 5 SNAPPI_POLL_DELAY_SEC = 2 TOLERANCE_THRESHOLD = 0.05 +UDP_PORT_START = 5000 def run_pfc_m2o_oversubscribe_lossy_test(api, @@ -319,10 +319,6 @@ def __gen_data_flow(testbed_config, flow.tx_rx.port.tx_name = testbed_config.ports[src_port_id].name flow.tx_rx.port.rx_name = testbed_config.ports[dst_port_id].name eth, ipv4, udp = flow.packet.ethernet().ipv4().udp() - src_port = random.randint(5000, 6000) - udp.src_port.increment.start = src_port - udp.src_port.increment.step = 1 - udp.src_port.increment.count = 1 eth.src.value = tx_mac eth.dst.value = rx_mac @@ -342,6 +338,13 @@ def __gen_data_flow(testbed_config, elif 'Background Flow 2 -> 0' in flow.name: eth.pfc_queue.value = pfcQueueValueDict[flow_prio[1]] + global UDP_PORT_START + src_port = UDP_PORT_START + UDP_PORT_START += 1 + udp.src_port.increment.start = src_port + udp.src_port.increment.step = 1 + udp.src_port.increment.count = 1 + ipv4.src.value = tx_port_config.ip ipv4.dst.value = rx_port_config.ip ipv4.priority.choice = ipv4.priority.DSCP diff --git a/tests/snappi_tests/multidut/pfcwd/files/pfcwd_multidut_basic_helper.py b/tests/snappi_tests/multidut/pfcwd/files/pfcwd_multidut_basic_helper.py index 55caae13f73..ebb62a3cf1f 100644 --- a/tests/snappi_tests/multidut/pfcwd/files/pfcwd_multidut_basic_helper.py +++ b/tests/snappi_tests/multidut/pfcwd/files/pfcwd_multidut_basic_helper.py @@ -321,7 +321,9 @@ def __gen_traffic(testbed_config, else: eth.pfc_queue.value = pfcQueueValueDict[prio] - src_port = UDP_PORT_START + eth.pfc_queue.value * number_of_streams + global UDP_PORT_START + src_port = UDP_PORT_START + UDP_PORT_START += number_of_streams udp.src_port.increment.start = src_port udp.src_port.increment.step = 1 udp.src_port.increment.count = number_of_streams