summaryrefslogtreecommitdiffstats
path: root/testcases/testcase.py
diff options
context:
space:
mode:
authorMartin Klozik <martinx.klozik@intel.com>2016-09-22 15:03:52 +0100
committerMartin Klozik <martinx.klozik@intel.com>2016-10-03 14:47:46 +0100
commite2e6c855327ec2d0a21c4cf172c92d82948ed5d4 (patch)
tree43c7655f17bbedf3449019c194062a870641705a /testcases/testcase.py
parent5b7cf3e52902ca12d2c61aaa34761454ee0e5bf9 (diff)
bugfix: Correct VM handling by integration tests
Patch with multi VM support has changed the way how data are copied into the shared folder. Also new support of GUEST_ options expansion requires proper initialization with exact number of VMs involved in the test. Code of class specific to integration tests was updated to initialize both GUEST_ options and VM shared dir correctly. Original values of all GUEST_ options are restored after the testcase execution. So other TCs can use original values for configuration expansion to required number of VMs. JIRA: VSPERF-361 Change-Id: Ic1149fbc73f73a66982bb64173b2217e55597200 Signed-off-by: Martin Klozik <martinx.klozik@intel.com> Reviewed-by: Maryam Tahhan <maryam.tahhan@intel.com> Reviewed-by: Al Morton <acmorton@att.com> Reviewed-by: Christian Trautman <ctrautma@redhat.com> Reviewed-by: Bill Michalowski <bmichalo@redhat.com> Reviewed-by: Antonio Fischetti <antonio.fischetti@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 ccd65785..7f22c18f 100644
--- a/testcases/testcase.py
+++ b/testcases/testcase.py
@@ -61,6 +61,11 @@ class TestCase(object):
self._settings_paths_modified = False
self._testcast_run_time = None
+ # store all GUEST_ specific settings to keep original values before their expansion
+ for key in S.__dict__:
+ if key.startswith('GUEST_'):
+ self._settings_original[key] = S.getValue(key)
+
self._update_settings('VSWITCH', cfg.get('vSwitch', S.getValue('VSWITCH')))
self._update_settings('VNF', cfg.get('VNF', S.getValue('VNF')))
self._update_settings('TRAFFICGEN', cfg.get('Trafficgen', S.getValue('TRAFFICGEN')))
@@ -190,7 +195,7 @@ class TestCase(object):
# perform guest related handling
if self._vnf_ctl.get_vnfs_number():
# copy sources of l2 forwarding tools into VM shared dir if needed
- self._copy_fwd_tools_for_all_guests()
+ self._copy_fwd_tools_for_all_guests(self._vnf_ctl.get_vnfs_number())
# in case of multi VM in parallel, set the number of streams to the number of VMs
if self.deployment.startswith('pvpv'):
@@ -356,11 +361,11 @@ class TestCase(object):
item[ResultsConstants.TUNNEL_TYPE] = self._tunnel_type
return results
- def _copy_fwd_tools_for_all_guests(self):
+ def _copy_fwd_tools_for_all_guests(self, vm_count):
"""Copy dpdk and l2fwd code to GUEST_SHARE_DIR[s] based on selected deployment.
"""
# consider only VNFs involved in the test
- for guest_dir in set(S.getValue('GUEST_SHARE_DIR')[:self._vnf_ctl.get_vnfs_number()]):
+ for guest_dir in set(S.getValue('GUEST_SHARE_DIR')[:vm_count]):
self._copy_fwd_tools_for_guest(guest_dir)
def _copy_fwd_tools_for_guest(self, guest_dir):