At the moment there is only one facility that allows to prepare a packet
as it is expected to be received on the traffic generator end. Extend
this to allow to prepare multiple packets at the same time.

Signed-off-by: Luca Vizzarro <luca.vizza...@arm.com>
Reviewed-by: Paul Szczepanek <paul.szczepa...@arm.com>
---
 dts/framework/test_suite.py | 17 ++++++++++++++++-
 1 file changed, 16 insertions(+), 1 deletion(-)

diff --git a/dts/framework/test_suite.py b/dts/framework/test_suite.py
index 5b3e7c205e..7a75334cfa 100644
--- a/dts/framework/test_suite.py
+++ b/dts/framework/test_suite.py
@@ -310,16 +310,31 @@ def send_packets(
         packets = self._adjust_addresses(packets)
         self.tg_node.send_packets(packets, self._tg_port_egress)
 
+    def get_expected_packets(self, packets: list[Packet]) -> list[Packet]:
+        """Inject the proper L2/L3 addresses into `packets`.
+
+        Inject the L2/L3 addresses expected at the receiving end of the 
traffic generator.
+
+        Args:
+            packets: The packets to modify.
+
+        Returns:
+            `packets` with injected L2/L3 addresses.
+        """
+        return self._adjust_addresses(packets, expected=True)
+
     def get_expected_packet(self, packet: Packet) -> Packet:
         """Inject the proper L2/L3 addresses into `packet`.
 
+        Inject the L2/L3 addresses expected at the receiving end of the 
traffic generator.
+
         Args:
             packet: The packet to modify.
 
         Returns:
             `packet` with injected L2/L3 addresses.
         """
-        return self._adjust_addresses([packet], expected=True)[0]
+        return self.get_expected_packets([packet])[0]
 
     def _adjust_addresses(self, packets: list[Packet], expected: bool = False) 
-> list[Packet]:
         """L2 and L3 address additions in both directions.
-- 
2.43.0

Reply via email to