diff options
Diffstat (limited to 'resources/libraries/python')
-rw-r--r-- | resources/libraries/python/autogen/Regenerator.py | 20 |
1 files changed, 16 insertions, 4 deletions
diff --git a/resources/libraries/python/autogen/Regenerator.py b/resources/libraries/python/autogen/Regenerator.py index 14a9fd0ddb..0554f24d79 100644 --- a/resources/libraries/python/autogen/Regenerator.py +++ b/resources/libraries/python/autogen/Regenerator.py @@ -195,18 +195,30 @@ def add_iperf3_testcases(testcase, file_out, tc_kwargs_list): file_out.write(testcase.generate(**kwargs)) -def add_trex_testcases(testcase, file_out, tc_kwargs_list): +def add_trex_testcases(testcase, suite_id, file_out, tc_kwargs_list): """Add trex testcases to file. :param testcase: Testcase class. + :param suite_id: Suite ID. :param file_out: File to write testcases to. :param tc_kwargs_list: Key-value pairs used to construct testcases. :type testcase: Testcase + :type suite_id: str :type file_out: file :type tc_kwargs_list: dict """ for kwargs in tc_kwargs_list: - file_out.write(testcase.generate(**kwargs)) + # TODO: Is there a better way to disable some combinations? + emit = True + if ( + u"-cps-" in suite_id + or u"-pps-" in suite_id + or u"-tput-" in suite_id + ): + if kwargs[u"frame_size"] not in MIN_FRAME_SIZE_VALUES: + emit = False + if emit: + file_out.write(testcase.generate(**kwargs)) def write_default_files(in_filename, in_prolog, kwargs_list): @@ -549,7 +561,7 @@ def write_trex_files(in_filename, in_prolog, kwargs_list): check_suite_tag(suite_tag, out_prolog) with open(out_filename, u"wt") as file_out: file_out.write(out_prolog) - add_trex_testcases(testcase, file_out, kwargs_list) + add_trex_testcases(testcase, suite_id, file_out, kwargs_list) def write_device_files(in_filename, in_prolog, kwargs_list): @@ -735,7 +747,7 @@ class Regenerator: in_prolog = u"".join( file_in.read().partition(u"*** Test Cases ***")[:-1] ) - if "-tg-" in in_filename: + if "-tg" in in_filename: write_trex_files(in_filename, in_prolog, trex_kwargs_list) continue if in_filename.endswith(u"-ndrpdr.robot"): |