+
+ @classmethod
+ def default(cls, suite_id):
+ """Factory method for creating "default" testcase objects.
+
+ Testcase name will contain both frame size and core count.
+ Used for most performance tests, except TCP ones.
+
+ :param suite_id: Part of suite name to distinguish from other suites.
+ :type suite_id: str
+ :returns: Instance for generating testcase text of this type.
+ :rtype: Testcase
+ """
+ template_string = f'''
+| ${{tc_num}}-${{frame_str}}-${{cores_str}}c-{suite_id}
+| | [Tags] | ${{frame_str}} | ${{cores_str}}C
+| | frame_size=${{frame_num}} | phy_cores=${{cores_num}}
+'''
+ return cls(template_string)
+
+ @classmethod
+ def tcp(cls, suite_id):
+ """Factory method for creating "tcp" testcase objects.
+
+ Testcase name will contain core count, but not frame size.
+
+ :param suite_id: Part of suite name to distinguish from other suites.
+ :type suite_id: str
+ :returns: Instance for generating testcase text of this type.
+ :rtype: Testcase
+ """
+ # TODO: Choose a better frame size identifier for streamed protocols
+ # (TCP, QUIC, SCTP, ...) where DUT (not TG) decides frame size.
+ if u"tcphttp" in suite_id:
+ template_string = f'''
+| ${{tc_num}}-IMIX-${{cores_str}}c-{suite_id}
+| | [Tags] | ${{cores_str}}C
+| | phy_cores=${{cores_num}}
+'''
+ elif u"iperf3" in suite_id:
+ template_string = f'''
+| ${{tc_num}}-9000B-${{cores_str}}c-{suite_id}
+| | [Tags] | ${{cores_str}}C | ${{clients_str}}CLIENT | ${{streams_str}}STREAM
+| | phy_cores=${{cores_num}} | clients=${{clients_num}}'''
+ template_string += f" | streams=${{streams_num}}\n"
+ else:
+ template_string = f'''
+| ${{tc_num}}-9000B-${{cores_str}}c-{suite_id}
+| | [Tags] | ${{cores_str}}C | ${{clients_str}}CLIENT | ${{streams_str}}STREAM
+| | phy_cores=${{cores_num}} | clients=${{clients_num}}'''
+ template_string += f" | streams=${{streams_num}}" \
+ f" | bytes=${{bytes_str}}\n"
+ return cls(template_string)