aboutsummaryrefslogtreecommitdiffstats
path: root/testcases/testcase.py
diff options
context:
space:
mode:
authorMartin Klozik <martinx.klozik@intel.com>2017-06-05 15:49:54 +0100
committerMartin Klozik <martinx.klozik@intel.com>2017-06-05 16:03:05 +0100
commit102555d5887bcd21b0b9a9ca40f33736e396ab98 (patch)
treea18a95c82061f5c362519adaac7189031311744e /testcases/testcase.py
parent0975aa2ec9baf2e852be7991f62ba40865997456 (diff)
ci: Fix VPP back2back TCs
There was a generic issue with restoration of original environment after execution of testcase. Thus in case that multiple tests were executed, their settings could be corrupted. This issue was detected after VPP testcases were added into VSPERF DAILY CI job. There were two issues: * setttings.load_from_dict() method was used to restore original configuration values; However this method updates dict content with supplied values. If TC has introduced new dict item, then it was not removed from settings after TC execution and modified settings was applied also for next test(s). * test configuration passed to testcase constructor is used for initialization of TC members, which are later updated; As python does shallow copy on dict members by default, modification of such testcase members led to corruption of configuration of other testcases. Thus deepcopy of testcase configuration was introduced into vsperf constructor to avoid TC configuration corruption. JIRA: VSPERF-511 Change-Id: I45fb49d48743015353652de12db4692333043733 Signed-off-by: Martin Klozik <martinx.klozik@intel.com> Reviewed-by: Al Morton <acmorton@att.com> Reviewed-by: Christian Trautman <ctrautma@redhat.com> Reviewed-by: Sridhar Rao <sridhar.rao@spirent.com> Reviewed-by: Trevor Cooper <trevor.cooper@intel.com>
Diffstat (limited to 'testcases/testcase.py')
-rw-r--r--testcases/testcase.py11
1 files changed, 8 insertions, 3 deletions
diff --git a/testcases/testcase.py b/testcases/testcase.py
index 75ed1a5c..3a86f77c 100644
--- a/testcases/testcase.py
+++ b/testcases/testcase.py
@@ -45,14 +45,18 @@ class TestCase(object):
In this basic form runs RFC2544 throughput test
"""
# pylint: disable=too-many-statements
- def __init__(self, cfg):
+ def __init__(self, test_cfg):
"""Pull out fields from test config
- :param cfg: A dictionary of string-value pairs describing the test
+ :param test_cfg: A dictionary of string-value pairs describing the test
configuration. Both the key and values strings use well-known
values.
:param results_dir: Where the csv formatted results are written.
"""
+ # make a local copy of test configuration to avoid modification of
+ # original content used in vsperf main script
+ cfg = copy.deepcopy(test_cfg)
+
self._testcase_start_time = time.time()
self._hugepages_mounted = False
self._traffic_ctl = None
@@ -336,7 +340,8 @@ class TestCase(object):
self.run_report()
# restore original settings
- S.load_from_dict(self._settings_original)
+ for key in self._settings_original:
+ S.setValue(key, self._settings_original[key])
def _update_settings(self, param, value):
""" Check value of given configuration parameter