aboutsummaryrefslogtreecommitdiffstats
path: root/resources/libraries/python/autogen/Regenerator.py
diff options
context:
space:
mode:
authorVratko Polak <vrpolak@cisco.com>2019-08-23 17:00:29 +0200
committerVratko Polak <vrpolak@cisco.com>2019-08-23 17:00:29 +0200
commitff820e3d53434889aacde2373314c3be8d00f765 (patch)
tree4172584444e7408af0ef47db4288cfdf4bad9ef7 /resources/libraries/python/autogen/Regenerator.py
parentfbbc47359e3f7b59bbd5a84d85c673374933a50a (diff)
Introduce reconfig suites, for dot1q+ip4+vxlan
Ticket: CSIT-1551 + Config copied from other suites. + Layer keywords prepared for additional chains. + Renamed "create" argument to "vlan_per_chain". + TrafficGenerator result extraction improvements. + Also unified TG type and subtype checking. + Throughput estimated as PDR for zero PLR. + Actual Qemu start is skipped. + Parse xstats instead of stats in trex stop scipt. - Because stats are unconditionally cleared on each script connect. + Remember start values to get better ReceiveMeasurementResult at stop. + Expose loss count and time as appropriate test message. + Autogen support. + Multiple chain amounts and core densities. - Only 1 additional chain. + Proper TAGs. Documented. + Clarified min framesize tags are for TG-DUT. + Added a TODO concerning overhead values. + Added 118B tag. + Robot performance keywords improvements. + Added missing return value documentation. + Frame size as required test variable, not an explicit argument. + MLRsearch keyword to store result (not into test message). - TODO: De-duplicate: main keyword to measure, minor to set test message. - But implementation uses the fact default arguments are different. + Keywords for starting and stopping background traffic. - No checks whether start-stop pair is complete. + Multiple minor indentation and logging improvements. - Missing / TODOs: - Support also vlan_per_chain=True? - Support dot1q without vxlan? - Support also deletion? - How to package config steps so -reconf can be generated from -ndrpdr? Change-Id: If0270697f9ffa837c34ef802917220a53f156703 Signed-off-by: Vratko Polak <vrpolak@cisco.com>
Diffstat (limited to 'resources/libraries/python/autogen/Regenerator.py')
-rw-r--r--resources/libraries/python/autogen/Regenerator.py44
1 files changed, 43 insertions, 1 deletions
diff --git a/resources/libraries/python/autogen/Regenerator.py b/resources/libraries/python/autogen/Regenerator.py
index a9f3ef433d..778ced76c9 100644
--- a/resources/libraries/python/autogen/Regenerator.py
+++ b/resources/libraries/python/autogen/Regenerator.py
@@ -207,8 +207,48 @@ def write_default_files(in_filename, in_prolog, kwargs_list):
testcase, iface, suite_id, file_out, kwargs_list)
+def write_reconf_files(in_filename, in_prolog, kwargs_list):
+ """Using given filename and prolog, write all generated reconf suites.
+
+ Use this for suite type reconf, as its local template
+ is incompatible with mrr/ndrpdr/soak local template,
+ while test cases are compatible.
+
+ :param in_filename: Template filename to derive real filenames from.
+ :param in_prolog: Template content to derive real content from.
+ :param kwargs_list: List of kwargs for add_testcase.
+ :type in_filename: str
+ :type in_prolog: str
+ :type kwargs_list: list of dict
+ """
+ _, suite_id = get_iface_and_suite_id(in_filename)
+ testcase = Testcase.default(suite_id)
+ for nic_name in Constants.NIC_NAME_TO_CODE:
+ out_filename = replace_defensively(
+ in_filename, "10ge2p1x710",
+ Constants.NIC_NAME_TO_CODE[nic_name], 1,
+ "File name should contain NIC code once.", in_filename)
+ out_prolog = replace_defensively(
+ in_prolog, "Intel-X710", nic_name, 2,
+ "NIC name should appear twice (tag and variable).",
+ in_filename)
+ if out_prolog.count("HW_") == 2:
+ # TODO CSIT-1481: Crypto HW should be read
+ # from topology file instead.
+ if nic_name in Constants.NIC_NAME_TO_CRYPTO_HW.keys():
+ out_prolog = replace_defensively(
+ out_prolog, "HW_DH895xcc",
+ Constants.NIC_NAME_TO_CRYPTO_HW[nic_name], 1,
+ "HW crypto name should appear.", in_filename)
+ iface, suite_id = get_iface_and_suite_id(out_filename)
+ with open(out_filename, "w") as file_out:
+ file_out.write(out_prolog)
+ add_default_testcases(
+ testcase, iface, suite_id, file_out, kwargs_list)
+
+
def write_tcp_files(in_filename, in_prolog, kwargs_list):
- """Using given filename and prolog, write all generated suites.
+ """Using given filename and prolog, write all generated tcp suites.
:param in_filename: Template filename to derive real filenames from.
:param in_prolog: Template content to derive real content from.
@@ -293,6 +333,8 @@ class Regenerator(object):
file_in.read().partition("*** Test Cases ***")[:-1])
if in_filename.endswith("-ndrpdr.robot"):
write_default_files(in_filename, in_prolog, default_kwargs_list)
+ elif in_filename.endswith("-reconf.robot"):
+ write_reconf_files(in_filename, in_prolog, default_kwargs_list)
elif in_filename[-10:] in ("-cps.robot", "-rps.robot"):
write_tcp_files(in_filename, in_prolog, tcp_kwargs_list)
else: