Skip to content
Merged
Show file tree
Hide file tree
Changes from 2 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 @@ -5,6 +5,7 @@
# 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
Expand Down Expand Up @@ -316,7 +317,12 @@ def __gen_data_flow(testbed_config,
flow = testbed_config.flows.flow(name='{} {} -> {}'.format(flow_name_prefix, src_port_id, dst_port_id))[-1]
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 = flow.packet.ethernet().ipv4()
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.coun = 1

eth.src.value = tx_mac
eth.dst.value = rx_mac

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
# 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
Expand Down Expand Up @@ -322,7 +323,12 @@ def __gen_data_flow(testbed_config,
flow = testbed_config.flows.flow(name='{} {} -> {}'.format(flow_name_prefix, src_port_id, dst_port_id))[-1]
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 = flow.packet.ethernet().ipv4()
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

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
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
Expand Down Expand Up @@ -302,7 +303,12 @@ def __gen_data_flow(testbed_config,
src_port_id, dst_port_id, flow_rate_percent))[-1]
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 = flow.packet.ethernet().ipv4()
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

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
# 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
Expand Down Expand Up @@ -280,7 +281,12 @@ def __gen_data_flow(testbed_config,
flow = testbed_config.flows.flow(name='{} {} -> {}'.format(flow_name_prefix, src_port_id, dst_port_id))[-1]
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 = flow.packet.ethernet().ipv4()
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
flow.duration.fixed_seconds.delay.nanoseconds = int(sec_to_nanosec(DATA_FLOW_DELAY_SEC))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
# 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
Expand Down Expand Up @@ -290,7 +291,12 @@ def __gen_data_flow(testbed_config,
dst_port_id, flow_rate_percent))[-1]
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 = flow.packet.ethernet().ipv4()
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
flow.duration.fixed_seconds.delay.nanoseconds = 0
Expand Down
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It would be good to have a random int between let's say (5000,6000) and have (PRIO+1) as multiplier so that each priority stream would have different source-destination port ranges.
The count can be also of higher value, like let's say 100/500 ensuring variety of UDP streams.

Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
# 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
Expand Down Expand Up @@ -301,7 +302,12 @@ def __gen_data_flow(testbed_config,
flow = testbed_config.flows.flow(name='{} {} -> {}'.format(flow_name_prefix, src_port_id, dst_port_id))[-1]
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 = flow.packet.ethernet().ipv4()
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

Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import time
from math import ceil
import logging
import random

from tests.common.helpers.assertions import pytest_assert
from tests.common.fixtures.conn_graph_facts import conn_graph_facts, fanout_graph_facts # noqa: F401
Expand Down Expand Up @@ -304,7 +305,12 @@ def __gen_traffic(testbed_config,
data_flow.tx_rx.port.tx_name = tx_port_name
data_flow.tx_rx.port.rx_name = rx_port_name

eth, ipv4 = data_flow.packet.ethernet().ipv4()
eth, ipv4, udp = data_flow.packet.ethernet().ipv4().udp()
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Seems only packet-chassis will be affected by the backplane issue. Should we use an if..else.. to show it's platform specific behavior?

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
if pfcQueueGroupSize == 8:
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import time
from math import ceil
import logging
import random
from tests.common.helpers.assertions import pytest_assert
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, \
Expand Down Expand Up @@ -180,7 +181,12 @@ def __gen_traffic(testbed_config,
data_flow.tx_rx.port.tx_name = tx_port_name
data_flow.tx_rx.port.rx_name = rx_port_name

eth, ipv4 = data_flow.packet.ethernet().ipv4()
eth, ipv4, udp = data_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
if pfcQueueGroupSize == 8:
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import time
from math import ceil
import logging
import random

from tests.common.helpers.assertions import pytest_assert, pytest_require
from tests.common.fixtures.conn_graph_facts import conn_graph_facts, fanout_graph_facts # noqa: F401
Expand Down Expand Up @@ -409,7 +410,12 @@ 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 = flow.packet.ethernet().ipv4()
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
if pfcQueueGroupSize == 8:
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import time
import logging
import random

from tests.common.helpers.assertions import pytest_assert
from tests.common.snappi_tests.snappi_helpers import get_dut_port_id # noqa: F401
Expand Down Expand Up @@ -144,7 +145,12 @@ def __gen_traffic(testbed_config,
data_flow.tx_rx.port.tx_name = tx_port_name
data_flow.tx_rx.port.rx_name = rx_port_name

eth, ipv4 = data_flow.packet.ethernet().ipv4()
eth, ipv4, udp = data_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
if pfcQueueGroupSize == 8:
Expand Down
7 changes: 6 additions & 1 deletion tests/snappi_tests/test_multidut_snappi.py
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,12 @@ def __gen_all_to_all_traffic(testbed_config,
flow.tx_rx.port.tx_name = tx_port_name
flow.tx_rx.port.rx_name = rx_port_name

eth, ipv4 = flow.packet.ethernet().ipv4()
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
eth.pfc_queue.value = priority
Expand Down