aboutsummaryrefslogtreecommitdiffstats
path: root/testcases/testcase.py
diff options
context:
space:
mode:
authorMartin Klozik <martinx.klozik@intel.com>2017-03-16 15:11:32 +0000
committerGerrit Code Review <gerrit@opnfv.org>2017-03-16 15:11:32 +0000
commit8fb2907c4e169ac54acce7a869aeca435b85532e (patch)
tree29e436b19de8a9dfcde381845a4b73f8cb2660df /testcases/testcase.py
parent0e5346ac983841c2b082ca7d3934922dc70624f3 (diff)
parentd1145851ad5cb9b5abe963ee97491aa694d389dc (diff)
Merge "vpp: Initial support of VPP vSwitch"
Diffstat (limited to 'testcases/testcase.py')
-rw-r--r--testcases/testcase.py29
1 files changed, 7 insertions, 22 deletions
diff --git a/testcases/testcase.py b/testcases/testcase.py
index d74f34ad..4fbf9c04 100644
--- a/testcases/testcase.py
+++ b/testcases/testcase.py
@@ -257,9 +257,6 @@ class TestCase(object):
# umount hugepages if mounted
self._umount_hugepages()
- # restore original settings
- S.load_from_dict(self._settings_original)
-
# cleanup any namespaces created
if os.path.isdir('/tmp/namespaces'):
namespace_list = os.listdir('/tmp/namespaces')
@@ -333,6 +330,9 @@ class TestCase(object):
# report test results
self.run_report()
+ # restore original settings
+ S.load_from_dict(self._settings_original)
+
def _update_settings(self, param, value):
""" Check value of given configuration parameter
In case that new value is different, then testcase
@@ -460,26 +460,11 @@ class TestCase(object):
# get hugepage amounts for each socket on dpdk
sock0_mem, sock1_mem = 0, 0
+
if S.getValue('VSWITCH').lower().count('dpdk'):
- # the import below needs to remain here and not put into the module
- # imports because of an exception due to settings not yet loaded
- from vswitches import ovs_dpdk_vhost
- if ovs_dpdk_vhost.OvsDpdkVhost.old_dpdk_config():
- match = re.search(
- r'-socket-mem\s+(\d+),(\d+)',
- ''.join(S.getValue('VSWITCHD_DPDK_ARGS')))
- if match:
- sock0_mem, sock1_mem = (int(match.group(1)) * 1024 / hugepage_size,
- int(match.group(2)) * 1024 / hugepage_size)
- else:
- logging.info(
- 'Could not parse socket memory config in dpdk params.')
- else:
- sock0_mem, sock1_mem = (
- S.getValue(
- 'VSWITCHD_DPDK_CONFIG')['dpdk-socket-mem'].split(','))
- sock0_mem, sock1_mem = (int(sock0_mem) * 1024 / hugepage_size,
- int(sock1_mem) * 1024 / hugepage_size)
+ sock_mem = S.getValue('DPDK_SOCKET_MEM')
+ sock0_mem, sock1_mem = (int(sock_mem[0]) * 1024 / hugepage_size,
+ int(sock_mem[1]) * 1024 / hugepage_size)
# If hugepages needed, verify the amounts are free
if any([hugepages_needed, sock0_mem, sock1_mem]):