aboutsummaryrefslogtreecommitdiffstats
path: root/functest/opnfv_tests/vnf
diff options
context:
space:
mode:
authorCédric Ollivier <cedric.ollivier@orange.com>2017-04-08 13:38:45 +0200
committerCédric Ollivier <cedric.ollivier@orange.com>2017-04-11 14:23:21 +0200
commit96bacd7d8ffb9c05672c0a1fc6e68d19e4a6793a (patch)
tree7e0fa1d220628aa0ea3f6b0d36702224e2891628 /functest/opnfv_tests/vnf
parentccc675b3095271d59dba3a49c0b116d0ff6c6bfb (diff)
Modify TestCase constructor attributes
Every feature/testcase now allows receiving the data defined in testcases.yaml as args (name is renamed to case_name). From the time being, only project and case names are handled. Next pending patches will add criteria, cmd and repo to this list. It keeps the default values for case names except for features which will be aggregated into Feature. Change-Id: Id742d100b8183d7f10894c24ae6879d1b2b60ac9 Signed-off-by: Cédric Ollivier <cedric.ollivier@orange.com>
Diffstat (limited to 'functest/opnfv_tests/vnf')
-rwxr-xr-xfunctest/opnfv_tests/vnf/aaa/aaa.py6
-rw-r--r--functest/opnfv_tests/vnf/ims/clearwater_ims_base.py7
-rw-r--r--functest/opnfv_tests/vnf/ims/cloudify_ims.py7
-rw-r--r--functest/opnfv_tests/vnf/rnc/parser.py7
-rw-r--r--functest/opnfv_tests/vnf/router/vyos_vrouter.py9
5 files changed, 19 insertions, 17 deletions
diff --git a/functest/opnfv_tests/vnf/aaa/aaa.py b/functest/opnfv_tests/vnf/aaa/aaa.py
index f80e7bcc..6de65bcd 100755
--- a/functest/opnfv_tests/vnf/aaa/aaa.py
+++ b/functest/opnfv_tests/vnf/aaa/aaa.py
@@ -20,8 +20,10 @@ class AaaVnf(vnf_base.VnfOnBoardingBase):
logger = ft_logger.Logger("VNF AAA").getLogger()
- def __init__(self):
- super(AaaVnf, self).__init__(case_name="aaa")
+ def __init__(self, **kwargs):
+ if "case_name" not in kwargs:
+ kwargs["case_name"] = "aaa"
+ super(AaaVnf, self).__init__(**kwargs)
def deploy_orchestrator(self):
self.logger.info("No VNFM needed to deploy a free radius here")
diff --git a/functest/opnfv_tests/vnf/ims/clearwater_ims_base.py b/functest/opnfv_tests/vnf/ims/clearwater_ims_base.py
index 2fc5449c..494633f4 100644
--- a/functest/opnfv_tests/vnf/ims/clearwater_ims_base.py
+++ b/functest/opnfv_tests/vnf/ims/clearwater_ims_base.py
@@ -20,13 +20,12 @@ import functest.utils.functest_utils as ft_utils
class ClearwaterOnBoardingBase(vnf_base.VnfOnBoardingBase):
- def __init__(self, project='functest', case='', repo='', cmd=''):
+ def __init__(self, **kwargs):
self.logger = ft_logger.Logger(__name__).getLogger()
- super(ClearwaterOnBoardingBase, self).__init__(
- project, case, repo, cmd)
+ super(ClearwaterOnBoardingBase, self).__init__(**kwargs)
self.case_dir = os.path.join(CONST.dir_functest_test, 'vnf', 'ims')
self.data_dir = CONST.dir_ims_data
- self.result_dir = os.path.join(CONST.dir_results, case)
+ self.result_dir = os.path.join(CONST.dir_results, self.case_name)
self.test_dir = CONST.dir_repo_vims_test
if not os.path.exists(self.data_dir):
diff --git a/functest/opnfv_tests/vnf/ims/cloudify_ims.py b/functest/opnfv_tests/vnf/ims/cloudify_ims.py
index d739335d..e351e0d9 100644
--- a/functest/opnfv_tests/vnf/ims/cloudify_ims.py
+++ b/functest/opnfv_tests/vnf/ims/cloudify_ims.py
@@ -25,9 +25,10 @@ import functest.utils.openstack_utils as os_utils
class CloudifyIms(clearwater_ims_base.ClearwaterOnBoardingBase):
- def __init__(self, project='functest', case_name='cloudify_ims',
- repo='', cmd=''):
- super(CloudifyIms, self).__init__(project, case_name, repo, cmd)
+ def __init__(self, **kwargs):
+ if "case_name" not in kwargs:
+ kwargs["case_name"] = "cloudify_ims"
+ super(CloudifyIms, self).__init__(**kwargs)
self.logger = ft_logger.Logger(__name__).getLogger()
# Retrieve the configuration
diff --git a/functest/opnfv_tests/vnf/rnc/parser.py b/functest/opnfv_tests/vnf/rnc/parser.py
index fe4def1f..ff726b9e 100644
--- a/functest/opnfv_tests/vnf/rnc/parser.py
+++ b/functest/opnfv_tests/vnf/rnc/parser.py
@@ -19,8 +19,7 @@ import functest.core.feature as base
class Parser(base.Feature):
- def __init__(self, case_name='parser-basics'):
- super(Parser, self).__init__(project='parser',
- case_name=case_name,
- repo='dir_repo_parser')
+ def __init__(self, **kwargs):
+ kwargs["repo"] = 'dir_repo_parser'
+ super(Parser, self).__init__(**kwargs)
self.cmd = 'cd %s/tests && ./functest_run.sh' % self.repo
diff --git a/functest/opnfv_tests/vnf/router/vyos_vrouter.py b/functest/opnfv_tests/vnf/router/vyos_vrouter.py
index e188c3fb..e6d2284d 100644
--- a/functest/opnfv_tests/vnf/router/vyos_vrouter.py
+++ b/functest/opnfv_tests/vnf/router/vyos_vrouter.py
@@ -14,10 +14,11 @@ RESULT_DETAILS_FILE = "test_result.json"
class VrouterVnf(base.Feature):
- def __init__(self):
- super(VrouterVnf, self).__init__(project='functest',
- case='vyos_vrouter',
- repo='dir_repo_vrouter')
+ def __init__(self, **kwargs):
+ kwargs["repo"] = 'dir_repo_vrouter'
+ if "case_name" not in kwargs:
+ kwargs["case_name"] = "vyos_vrouter"
+ super(VrouterVnf, self).__init__(**kwargs)
self.cmd = 'cd %s && ./run.sh' % self.repo
def set_result_details(self):