aboutsummaryrefslogtreecommitdiffstats
path: root/sfc/tests/functest/run_sfc_tests.py
diff options
context:
space:
mode:
authorPanagiotis Karalis <pkaralis@intracom-telecom.com>2018-02-14 15:28:02 +0200
committerPanagiotis Karalis <pkaralis@intracom-telecom.com>2018-05-15 11:42:44 +0300
commit23c9ae8fa5db3ea02077d97452ea503097cf985e (patch)
tree1e076dcabac20963465c7380eab4ba16d0b50f6a /sfc/tests/functest/run_sfc_tests.py
parent5f8eb6bf01ca3ef240cfcdee297327b21b33f35a (diff)
Clean up Test Case code
Too much of duplicated code has been obeserved in test cases. With this patch a small refactoring is necessery to our test cases code. So they can be more generic and more flexible. To achieve that the addition of new parent class is essential, hence all the rest test case classes will inherit from the aforementioned parent class. Change-Id: I6a50d8330a06321742b3bb03cc999682d4a4e6a1 Signed-off-by: Panagiotis Karalis <pkaralis@intracom-telecom.com>
Diffstat (limited to 'sfc/tests/functest/run_sfc_tests.py')
-rw-r--r--sfc/tests/functest/run_sfc_tests.py12
1 files changed, 10 insertions, 2 deletions
diff --git a/sfc/tests/functest/run_sfc_tests.py b/sfc/tests/functest/run_sfc_tests.py
index dba73b98..015255a6 100644
--- a/sfc/tests/functest/run_sfc_tests.py
+++ b/sfc/tests/functest/run_sfc_tests.py
@@ -149,12 +149,20 @@ class SfcFunctest(testcase.TestCase):
(test_name, test_descr))
logger.info(title)
logger.info("%s\n" % ("=" * len(title)))
- t = importlib.import_module(
+ module = importlib.import_module(
"sfc.tests.functest.{0}".format(test_name),
package=None)
+
+ testcase_config = sfc_config.TestcaseConfig(test_name)
+ supported_installers = test_cfg['supported_installers']
+ vnf_names = test_cfg['vnf_names']
+
+ tc_class = getattr(module, test_cfg['class_name'])
+ tc_instance = tc_class(testcase_config, supported_installers,
+ vnf_names)
start_time = time.time()
try:
- result, creators = t.main()
+ result, creators = tc_instance.run()
except Exception as e:
logger.error("Exception when executing: %s" % test_name)
logger.error(e)