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

Message ID 20240906173709.17487-2-jspewock@iol.unh.edu (mailing list archive)
State Superseded
Delegated to: Juraj Linkeš
Headers
Series dts: port vf_smoke to new DTS |

Checks

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

Commit Message

Jeremy Spewock Sept. 6, 2024, 5:37 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 b17f0c04b2..6490500610 100644
--- a/dts/framework/test_suite.py
+++ b/dts/framework/test_suite.py
@@ -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(