+ 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?
+ emit = True
+ if kwargs["framesize"] == 9000:
+ if "vic1227" in iface:
+ # Not supported in HW.
+ emit = False
+ if "avf" in suite_id:
+ # Not supported by AVF driver.
+ # https://git.fd.io/vpp/tree/src/plugins/avf/README.md
+ emit = False
+ if "-16vm-" in suite_id or "-16dcr-" in suite_id:
+ if kwargs["phy_cores"] > 3:
+ # CSIT lab only has 28 (physical) core processors,
+ # so these test would fail when attempting to assign cores.
+ emit = False
+ if "soak" in suite_id:
+ # Soak test take too long, do not risk other than tc01.
+ if kwargs["phy_cores"] != 1:
+ emit = False
+ if kwargs["framesize"] not in min_framesize_values:
+ emit = False
+ if emit:
+ file_out.write(testcase.generate(num=num, **kwargs))
+ # We bump tc number in any case, so that future enables/disables
+ # do not affect the numbering of other test cases.