aboutsummaryrefslogtreecommitdiffstats
path: root/resources/libraries/python
diff options
context:
space:
mode:
authorViliam Luc <vluc@cisco.com>2021-08-26 11:25:39 +0200
committerViliam Luc <vluc@cisco.com>2021-09-14 16:36:17 +0200
commita8e9042828ce76a497941249a7e4d740933a56f9 (patch)
tree7c7165620c388b8e1944ec497f0df315fee5be10 /resources/libraries/python
parenta0364d85d9f9b28917168a0dde9c67ca5af4a6f8 (diff)
back-to-back: add tg n2n suites
Change-Id: I911e121475221fbf5449ed49dc6236caf13742b0 Signed-off-by: Viliam Luc <vluc@cisco.com>
Diffstat (limited to 'resources/libraries/python')
-rw-r--r--resources/libraries/python/autogen/Regenerator.py20
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"):