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

jspewock at iol.unh.edu jspewock at iol.unh.edu
Thu Sep 26 22:39:26 CEST 2024


From: Jeremy Spewock <jspewock at 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 at iol.unh.edu>
---
 dts/framework/test_suite.py | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

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(
-- 
2.46.0



More information about the dev mailing list