X-Git-Url: https://gerrit.fd.io/r/gitweb?a=blobdiff_plain;f=resources%2Flibraries%2Fpython%2Fautogen%2FRegenerator.py;h=8bfe054e5ef28cd4429288c78d7d6c6babaaf342;hb=67c955313333b3e478d31e04bdaabcdfddbe2cbe;hp=7a576764a259a56046fe2f67a6ed651c1a9dfcec;hpb=be430a282810185c939c1fbbf3042036b814f38a;p=csit.git diff --git a/resources/libraries/python/autogen/Regenerator.py b/resources/libraries/python/autogen/Regenerator.py index 7a576764a2..8bfe054e5e 100644 --- a/resources/libraries/python/autogen/Regenerator.py +++ b/resources/libraries/python/autogen/Regenerator.py @@ -75,16 +75,18 @@ class Regenerator(object): dash_split = dash_split[1].split("-", 1) return dash_split[0], dash_split[1].split(".", 1)[0] - def add_testcase(testcase, iface, file_out, num, **kwargs): + 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 @@ -92,25 +94,40 @@ class Regenerator(object): :rtype: int """ # TODO: Is there a better way to disable some combinations? - if kwargs["framesize"] != 9000 or "vic1227" not in iface: + if kwargs["framesize"] == 9000 and "vic1227" in iface: + # Not supported in HW. + pass + elif 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 + elif ("soak" in suite_id and + (kwargs["phy_cores"] != 1 + or kwargs["framesize"] in (1518, 9000, "IMIX_v4_1"))): + # Soak test take too long, do not risk other than tc01. + pass + else: file_out.write(testcase.generate(num=num, **kwargs)) return num + 1 - def add_testcases(testcase, iface, file_out, tc_kwargs_list): + def add_testcases(testcase, iface, suite_id, file_out, tc_kwargs_list): """Add testcases to file. :param testcase: Testcase class. :param iface: Interface. + :param suite_id: Suite ID. :param file_out: File to write testcases to. - :param tc_kwargs_list: Key-value pairs used to construct testcase. + :param tc_kwargs_list: Key-value pairs used to construct testcases. :type testcase: Testcase :type iface: str + :type suite_id: str :type file_out: file :type tc_kwargs_list: dict """ num = 1 for tc_kwargs in tc_kwargs_list: - num = add_testcase(testcase, iface, file_out, num, **tc_kwargs) + num = add_testcase(testcase, iface, suite_id, file_out, num, + **tc_kwargs) print "Regenerator starts at {cwd}".format(cwd=getcwd()) min_framesize = protocol_to_min_framesize[protocol] @@ -137,6 +154,6 @@ class Regenerator(object): testcase = self.testcase_class(suite_id) with open(filename, "w") as file_out: file_out.write(text_prolog) - add_testcases(testcase, iface, file_out, kwargs_list) + add_testcases(testcase, iface, suite_id, file_out, kwargs_list) print "Regenerator ends." print # To make autogen check output more readable.