+ protocol_to_min_framesize = {
+ "ip4": 64,
+ "ip6": 78,
+ "vxlan+ip4": 114 # What is the real minimum for latency stream?
+ }
+
+ def get_iface_and_suite_id(filename):
+ """Get interface and suite ID.
+
+ :param filename: Suite file.
+ :type filename: str
+ :returns: Interface ID, Suite ID.
+ :rtype: tuple
+ """
+ dash_split = filename.split("-", 1)
+ if len(dash_split[0]) <= 4:
+ # It was something like "2n1l", we need one more split.
+ dash_split = dash_split[1].split("-", 1)
+ return dash_split[0], dash_split[1].split(".", 1)[0]
+
+ def add_testcase(testcase, iface, suite_id, file_out, num, **kwargs):
+ """Add testcase to file.
+
+ :param testcase: Testcase class.
+ :param iface: Interface.
+ :param suite_id: Suite ID.
+ :param file_out: File to write testcases to.
+ :param num: Testcase number.
+ :param kwargs: Key-value pairs used to construct testcase.
+ :type testcase: Testcase
+ :type iface: str
+ :type suite_id: str
+ :type file_out: file
+ :type num: int
+ :type kwargs: dict
+ :returns: Next testcase number.
+ :rtype: int
+ """
+ # TODO: Is there a better way to disable some combinations?
+ if kwargs["framesize"] == 9000 and "vic1227" in iface:
+ # Not supported in HW.
+ pass
+ else if kwargs["framesize"] == 9000 and "avf" in suite_id:
+ # Not supported by AVF driver.
+ # https://git.fd.io/vpp/tree/src/plugins/avf/README.md
+ pass
+ else:
+ file_out.write(testcase.generate(num=num, **kwargs))