[v2,1/3] dts: allow specifying ingress port in send_packets

Message ID 20240926203928.19881-2-jspewock@iol.unh.edu (mailing list archive)
State New
Delegated to: Paul Szczepanek
Headers
Series dts: port vf_smoke to new DTS |

Checks

Context Check Description
ci/loongarch-compilation warning apply patch failure
ci/checkpatch success coding style OK
ci/iol-testing warning apply patch failure

Commit Message

Jeremy Spewock Sept. 26, 2024, 8:39 p.m. UTC
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(-)
  

Patch

diff --git a/dts/framework/test_suite.py b/dts/framework/test_suite.py
index ac927d15ef..5253083896 100644
--- a/dts/framework/test_suite.py
+++ b/dts/framework/test_suite.py
@@ -251,13 +251,18 @@  def send_packets_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(