On 23. 9. 2024 20:42, jspew...@iol.unh.edu wrote:
From: Jeremy Spewock <jspew...@iol.unh.edu> Previously in the DTS framework the helper methods in the TestSuite class designated ports as either ingress or egress ports and would wrap the methods of the traffic generator to allow packets to only flow to those designated ingress or egress ports. This is undesirable in some cases, such as when you have virtual functions on top of your port, where the TG ports can send to more than one SUT port. This patch solves this problem by creating optional parameters that allow the user to specify which port to gather the MAC addresses from when sending and receiving packets. Signed-off-by: Jeremy Spewock <jspew...@iol.unh.edu> ---
I'm not a fan of exposing the functionality in this way. The developers needs to fiddle with ports and there are likely better ways to accomplish this.
Ideally, the only information the dev would provide that a test case is a VF test case and everything else would happen under the hood in the TestCase class.
Barring that, we could decorate the whole TestSuite as requiring VFs, which would result in automatically creating and removing the VFs in setup/teardown (test case marking would be similar, but possibly more complicated, especially if we wanted to abide only by test cases selected in a given test run). Then the test cases could pass a simple vf=True parameter to the send/receive methods.