<div dir="ltr"><div dir="ltr">On Wed, Aug 21, 2024 at 10:53 AM Juraj Linkeš <juraj.linkes@pantheon.tech> wrote:<br></div><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">Some test cases or suites may be testing a NIC feature that is not<br>
supported on all NICs, so add support for marking test cases or suites<br>
as requiring NIC capabilities.<br>
<br>
The marking is done with a decorator, which populates the internal<br>
required_capabilities attribute of TestProtocol. The NIC capability<br>
itself is a wrapper around the NicCapability defined in testpmd_shell.<br>
The reason is twofold:<br>
1. Enums cannot be extended and the class implements the methods of its<br>
abstract base superclass,<br>
2. The class also stores an optional decorator function which is used<br>
before/after capability retrieval. This is needed because some<br>
capabilities may be advertised differently under different<br>
configuration.<br>
<br>
The decorator API is designed to be simple to use. The arguments passed<br>
to it are all from the testpmd shell. Everything else (even the actual<br>
capability object creation) is done internally.<br>
<br>
Signed-off-by: Juraj Linkeš <juraj.linkes@pantheon.tech><br></blockquote><div><br></div><div>Reviewed-by: Dean Marx <<a href="mailto:dmarx@iol.unh.edu">dmarx@iol.unh.edu</a>> <br></div></div></div>