summaryrefslogtreecommitdiffstats
path: root/testcases
diff options
context:
space:
mode:
Diffstat (limited to 'testcases')
-rw-r--r--testcases/testcase.py13
1 files changed, 13 insertions, 0 deletions
diff --git a/testcases/testcase.py b/testcases/testcase.py
index 991c2890..5d4a6ea9 100644
--- a/testcases/testcase.py
+++ b/testcases/testcase.py
@@ -36,6 +36,7 @@ from tools import functions
from tools import namespace
from tools import veth
from tools.teststepstools import TestStepsTools
+from tools.llc_management import rmd
CHECK_PREFIX = 'validate_'
@@ -185,6 +186,10 @@ class TestCase(object):
if step[0].startswith('vnf'):
self._step_vnf_list[step[0]] = None
+ # if llc allocation is required, initialize it.
+ if S.getValue('LLC_ALLOCATION'):
+ self._rmd = rmd.CacheAllocator()
+
def run_initialize(self):
""" Prepare test execution environment
"""
@@ -257,6 +262,10 @@ class TestCase(object):
self._step_status = {'status' : True, 'details' : ''}
+ # Perform LLC-allocations
+ if S.getValue('LLC_ALLOCATION'):
+ self._rmd.setup_llc_allocation()
+
self._logger.debug("Setup:")
def run_finalize(self):
@@ -265,6 +274,10 @@ class TestCase(object):
# Stop all VNFs started by TestSteps in case that something went wrong
self.step_stop_vnfs()
+ # Cleanup any LLC-allocations
+ if S.getValue('LLC_ALLOCATION'):
+ self._rmd.cleanup_llc_allocation()
+
# Stop all processes executed by testcase
tasks.terminate_all_tasks(self._logger)