[v1,1/3] dts: allow specifying ingress port in send_packets
Checks
Commit Message
From: Jeremy Spewock <jspewock@iol.unh.edu>
In order to use VFs in the framework, methods for sending packets had to
be modified so that they support choosing which ports to use when
sending and receiving. This patch creates the same support for the
send_packets method so that it can be used with VFs.
Signed-off-by: Jeremy Spewock <jspewock@iol.unh.edu>
---
dts/framework/test_suite.py | 7 ++++++-
1 file changed, 6 insertions(+), 1 deletion(-)
@@ -221,13 +221,18 @@ def send_packet_and_capture(
def send_packets(
self,
packets: list[Packet],
+ sut_ingress: Port | None = None,
) -> None:
"""Send packets using the traffic generator and do not capture received traffic.
Args:
packets: Packets to send.
+ sut_ingress: Optional port to use as the SUT ingress port. Defaults to
+ `self._sut_port_ingress`.
"""
- packets = self._adjust_addresses(packets)
+ if sut_ingress is None:
+ sut_ingress = self._sut_port_ingress
+ packets = self._adjust_addresses(packets, sut_ingress, self._sut_port_egress)
self.tg_node.send_packets(packets, self._tg_port_egress)
def get_expected_packet(