diff options
author | Cédric Ollivier <cedric.ollivier@orange.com> | 2017-04-08 13:38:45 +0200 |
---|---|---|
committer | Cédric Ollivier <cedric.ollivier@orange.com> | 2017-04-11 14:23:21 +0200 |
commit | 96bacd7d8ffb9c05672c0a1fc6e68d19e4a6793a (patch) | |
tree | 7e0fa1d220628aa0ea3f6b0d36702224e2891628 /functest | |
parent | ccc675b3095271d59dba3a49c0b116d0ff6c6bfb (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')
49 files changed, 285 insertions, 183 deletions
diff --git a/functest/ci/run_tests.py b/functest/ci/run_tests.py index 5793c04a..0ca73f36 100755 --- a/functest/ci/run_tests.py +++ b/functest/ci/run_tests.py @@ -144,7 +144,8 @@ def run_test(test, tier_name, testcases=None): try: module = importlib.import_module(run_dict['module']) cls = getattr(module, run_dict['class']) - test_case = cls(case_name=test_name) + test_dict = ft_utils.get_dict_by_test(test_name) + test_case = cls(**test_dict) try: kwargs = run_dict['args'] diff --git a/functest/ci/testcases.yaml b/functest/ci/testcases.yaml index 93096043..f717cdd5 100755 --- a/functest/ci/testcases.yaml +++ b/functest/ci/testcases.yaml @@ -8,7 +8,8 @@ tiers: operations in the VIM. testcases: - - name: connection_check + case_name: connection_check + project_name: functest criteria: 'status == "PASS"' blocking: true clean_flag: false @@ -27,7 +28,8 @@ tiers: class: 'ConnectionCheck' - - name: api_check + case_name: api_check + project_name: functest criteria: 'status == "PASS"' blocking: true clean_flag: false @@ -45,7 +47,8 @@ tiers: module: 'functest.opnfv_tests.openstack.snaps.api_check' class: 'ApiCheck' - - name: snaps_health_check + case_name: snaps_health_check + project_name: functest criteria: 'status == "PASS"' blocking: true clean_flag: false @@ -68,7 +71,8 @@ tiers: Set of basic Functional tests to validate the OPNFV scenarios. testcases: - - name: vping_ssh + case_name: vping_ssh + project_name: functest criteria: 'status == "PASS"' blocking: true clean_flag: true @@ -84,7 +88,8 @@ tiers: class: 'VPingSSH' - - name: vping_userdata + case_name: vping_userdata + project_name: functest criteria: 'status == "PASS"' blocking: true clean_flag: true @@ -99,7 +104,8 @@ tiers: class: 'VPingUserdata' - - name: tempest_smoke_serial + case_name: tempest_smoke_serial + project_name: functest criteria: 'success_rate == 100%' blocking: false clean_flag: true @@ -116,7 +122,8 @@ tiers: class: 'TempestSmokeSerial' - - name: rally_sanity + case_name: rally_sanity + project_name: functest criteria: 'success_rate == 100%' blocking: false clean_flag: false @@ -131,7 +138,8 @@ tiers: class: 'RallySanity' - - name: refstack_defcore + case_name: refstack_defcore + project_name: functest criteria: 'success_rate == 100%' blocking: false clean_flag: true @@ -146,7 +154,8 @@ tiers: class: 'RefstackClient' - - name: odl + case_name: odl + project_name: functest criteria: 'success_rate == 100%' blocking: true clean_flag: false @@ -166,7 +175,8 @@ tiers: - /home/opnfv/repos/odl_test/csit/suites/openstack/neutron - - name: odl_netvirt + case_name: odl_netvirt + project_name: functest criteria: 'success_rate == 100%' blocking: false clean_flag: false @@ -188,7 +198,8 @@ tiers: - /home/opnfv/repos/odl_test/csit/suites/openstack/connectivity - - name: fds + case_name: fds + project_name: functest criteria: 'success_rate == 100%' blocking: false clean_flag: false @@ -207,7 +218,8 @@ tiers: - /home/opnfv/repos/fds/testing/robot - - name: onos + case_name: onos + project_name: functest criteria: 'status == "PASS"' blocking: true clean_flag: true @@ -223,7 +235,8 @@ tiers: class: 'Onos' - - name: snaps_smoke + case_name: snaps_smoke + project_name: functest criteria: 'status == "PASS"' blocking: false clean_flag: false @@ -252,7 +265,8 @@ tiers: integrated in functest testcases: - - name: promise + case_name: promise + project_name: promise criteria: 'success_rate == 100%' blocking: false clean_flag: true @@ -266,7 +280,8 @@ tiers: class: 'Promise' - - name: doctor-notification + case_name: doctor-notification + project_name: doctor criteria: 'status == "PASS"' blocking: false clean_flag: true @@ -280,7 +295,8 @@ tiers: class: 'Doctor' - - name: bgpvpn + case_name: bgpvpn + project_name: sdnvpn criteria: 'status == "PASS"' blocking: false clean_flag: true @@ -294,7 +310,8 @@ tiers: class: 'SdnVpnTests' - - name: security_scan + case_name: security_scan + project_name: securityscanning criteria: 'status == "PASS"' blocking: false clean_flag: true @@ -308,7 +325,8 @@ tiers: class: 'SecurityScan' - - name: multisite + case_name: multisite + project_name: multisite criteria: 'success_rate == 100%' blocking: false clean_flag: false @@ -321,7 +339,8 @@ tiers: module: 'functest.opnfv_tests.openstack.tempest.tempest' class: 'TempestMultisite' - - name: functest-odl-sfc + case_name: functest-odl-sfc + project_name: sfc criteria: 'status == "PASS"' blocking: false clean_flag: true @@ -334,7 +353,8 @@ tiers: module: 'functest.opnfv_tests.features.odl_sfc' class: 'OpenDaylightSFC' - - name: onos_sfc + case_name: onos_sfc + project_name: functest criteria: 'status == "PASS"' blocking: true clean_flag: true @@ -347,7 +367,8 @@ tiers: module: 'functest.opnfv_tests.sdn.onos.onos' class: 'OnosSfc' - - name: parser-basics + case_name: parser-basics + project_name: parser criteria: 'ret == 0' blocking: false clean_flag: true @@ -360,7 +381,8 @@ tiers: module: 'functest.opnfv_tests.vnf.rnc.parser' class: 'Parser' - - name: domino-multinode + case_name: domino-multinode + project_name: domino criteria: 'status == "PASS"' blocking: false clean_flag: true @@ -373,7 +395,8 @@ tiers: module: 'functest.opnfv_tests.features.domino' class: 'Domino' - - name: gluon_vping + case_name: gluon_vping + project_name: netready criteria: 'status == "PASS"' blocking: false clean_flag: true @@ -386,7 +409,8 @@ tiers: module: 'functest.opnfv_tests.features.netready' class: 'GluonVping' - - name: barometercollectd + case_name: barometercollectd + project_name: barometer criteria: 'status == "PASS"' blocking: false clean_flag: true @@ -409,7 +433,8 @@ tiers: Extensive testing of OpenStack API. testcases: - - name: tempest_full_parallel + case_name: tempest_full_parallel + project_name: functest criteria: 'success_rate >= 80%' blocking: false clean_flag: true @@ -424,7 +449,8 @@ tiers: module: 'functest.opnfv_tests.openstack.tempest.tempest' class: 'TempestFullParallel' - - name: tempest_custom + case_name: tempest_custom + project_name: functest criteria: 'success_rate == 100%' blocking: false clean_flag: true @@ -441,7 +467,8 @@ tiers: module: 'functest.opnfv_tests.openstack.tempest.tempest' class: 'TempestCustom' - - name: rally_full + case_name: rally_full + project_name: functest criteria: 'success_rate >= 90%' blocking: false clean_flag: false @@ -463,7 +490,8 @@ tiers: Collection of VNF test cases. testcases: - - name: cloudify_ims + case_name: cloudify_ims + project_name: functest criteria: 'status == "PASS"' blocking: false clean_flag: true @@ -477,7 +505,8 @@ tiers: module: 'functest.opnfv_tests.vnf.ims.cloudify_ims' class: 'CloudifyIms' # - -# name: aaa +# case_name: aaa +# project_name: functest # criteria: 'ret == 0' # blocking: false # clean_flag: true @@ -490,7 +519,8 @@ tiers: # module: 'functest.opnfv_tests.vnf.aaa.aaa' # class: 'AaaVnf' - - name: orchestra_ims + case_name: orchestra_ims + project_name: functest criteria: 'ret == 0' blocking: false clean_flag: true @@ -504,7 +534,8 @@ tiers: class: 'ImsVnf' - - name: opera_ims + case_name: opera-vims + project_name: opera criteria: 'status == "PASS"' blocking: false clean_flag: true @@ -518,7 +549,8 @@ tiers: class: 'OperaIms' - - name: vyos_vrouter + case_name: vyos_vrouter + project_name: functest criteria: 'status == "PASS"' blocking: false clean_flag: true diff --git a/functest/ci/tier_builder.py b/functest/ci/tier_builder.py index f4c6f70f..44b27258 100644 --- a/functest/ci/tier_builder.py +++ b/functest/ci/tier_builder.py @@ -46,7 +46,7 @@ class TierBuilder(object): scenario = dic_testcase['dependencies']['scenario'] dep = th.Dependency(installer, scenario) - testcase = th.TestCase(name=dic_testcase['name'], + testcase = th.TestCase(name=dic_testcase['case_name'], dependency=dep, criteria=dic_testcase['criteria'], blocking=dic_testcase['blocking'], diff --git a/functest/core/feature.py b/functest/core/feature.py index 5149f80f..9f20a426 100644 --- a/functest/core/feature.py +++ b/functest/core/feature.py @@ -8,13 +8,13 @@ from functest.utils.constants import CONST class Feature(base.TestCase): - def __init__(self, project='functest', case_name='', repo='', cmd=''): - super(Feature, self).__init__(case_name=case_name) - self.project_name = project - self.cmd = cmd + def __init__(self, **kwargs): + super(Feature, self).__init__(**kwargs) + self.cmd = kwargs.get('cmd', '') + repo = kwargs.get('repo', '') self.repo = CONST.__getattribute__(repo) self.result_file = self.get_result_file() - self.logger = ft_logger.Logger(project).getLogger() + self.logger = ft_logger.Logger(self.project_name).getLogger() def run(self, **kwargs): self.prepare() diff --git a/functest/core/pytest_suite_runner.py b/functest/core/pytest_suite_runner.py index 9cfaea7a..775f0a66 100644 --- a/functest/core/pytest_suite_runner.py +++ b/functest/core/pytest_suite_runner.py @@ -15,8 +15,8 @@ class PyTestSuiteRunner(base.TestCase): This superclass is designed to execute pre-configured unittest.TestSuite() objects """ - def __init__(self, case_name=''): - super(PyTestSuiteRunner, self).__init__(case_name) + def __init__(self, **kwargs): + super(PyTestSuiteRunner, self).__init__(**kwargs) self.suite = None def run(self, **kwargs): diff --git a/functest/core/testcase.py b/functest/core/testcase.py index 8c5fd647..3b43aefb 100644 --- a/functest/core/testcase.py +++ b/functest/core/testcase.py @@ -27,10 +27,10 @@ class TestCase(object): logger = ft_logger.Logger(__name__).getLogger() - def __init__(self, case_name=""): + def __init__(self, **kwargs): self.details = {} - self.project_name = "functest" - self.case_name = case_name + self.project_name = kwargs.get('project_name', 'functest') + self.case_name = kwargs.get('case_name', '') self.criteria = "" self.start_time = "" self.stop_time = "" diff --git a/functest/core/vnf_base.py b/functest/core/vnf_base.py index 3d3a441f..3c71ec77 100644 --- a/functest/core/vnf_base.py +++ b/functest/core/vnf_base.py @@ -21,11 +21,10 @@ class VnfOnBoardingBase(base.TestCase): logger = ft_logger.Logger(__name__).getLogger() - def __init__(self, project='functest', case_name='', repo='', cmd=''): - super(VnfOnBoardingBase, self).__init__(case_name=case_name) - self.repo = repo - self.project_name = project - self.cmd = cmd + def __init__(self, **kwargs): + super(VnfOnBoardingBase, self).__init__(**kwargs) + self.repo = kwargs.get('repo', '') + self.cmd = kwargs.get('cmd', '') self.details = {} self.result_dir = CONST.dir_results self.details['orchestrator'] = {} diff --git a/functest/opnfv_tests/features/barometer.py b/functest/opnfv_tests/features/barometer.py index 6207f581..cd3062cc 100644 --- a/functest/opnfv_tests/features/barometer.py +++ b/functest/opnfv_tests/features/barometer.py @@ -16,10 +16,9 @@ class BarometerCollectd(base.Feature): Class for executing barometercollectd testcase. ''' - def __init__(self, case_name='barometercollectd'): - super(BarometerCollectd, self).__init__(project='barometer', - case_name=case_name, - repo='dir_repo_barometer') + def __init__(self, **kwargs): + kwargs["repo"] = 'dir_repo_barometer' + super(BarometerCollectd, self).__init__(**kwargs) def execute(self): return collectd.main(self.logger) diff --git a/functest/opnfv_tests/features/copper.py b/functest/opnfv_tests/features/copper.py index 5b88a499..e5c3f8bd 100644 --- a/functest/opnfv_tests/features/copper.py +++ b/functest/opnfv_tests/features/copper.py @@ -18,8 +18,7 @@ import functest.core.feature as base class Copper(base.Feature): - def __init__(self, case_name='copper-notification'): - super(Copper, self).__init__(project='copper', - case_name=case_name, - repo='dir_repo_copper') + def __init__(self, **kwargs): + kwargs["repo"] = 'dir_repo_copper' + super(Copper, self).__init__(**kwargs) self.cmd = 'cd %s/tests && bash run.sh && cd -' % self.repo diff --git a/functest/opnfv_tests/features/doctor.py b/functest/opnfv_tests/features/doctor.py index fd181a04..3a2cc7df 100644 --- a/functest/opnfv_tests/features/doctor.py +++ b/functest/opnfv_tests/features/doctor.py @@ -17,8 +17,7 @@ import functest.core.feature as base class Doctor(base.Feature): - def __init__(self, case_name='doctor-notification'): - super(Doctor, self).__init__(project='doctor', - case_name=case_name, - repo='dir_repo_doctor') + def __init__(self, **kwargs): + kwargs["repo"] = 'dir_repo_doctor' + super(Doctor, self).__init__(**kwargs) self.cmd = 'cd %s/tests && ./run.sh' % self.repo diff --git a/functest/opnfv_tests/features/domino.py b/functest/opnfv_tests/features/domino.py index 1c620235..629c8d54 100644 --- a/functest/opnfv_tests/features/domino.py +++ b/functest/opnfv_tests/features/domino.py @@ -18,8 +18,7 @@ import functest.core.feature as base class Domino(base.Feature): - def __init__(self, case_name='domino-multinode'): - super(Domino, self).__init__(project='domino', - case_name=case_name, - repo='dir_repo_domino') + def __init__(self, **kwargs): + kwargs["repo"] = 'dir_repo_domino' + super(Domino, self).__init__(**kwargs) self.cmd = 'cd %s && ./tests/run_multinode.sh' % self.repo diff --git a/functest/opnfv_tests/features/netready.py b/functest/opnfv_tests/features/netready.py index ada322c1..f7bab08b 100644 --- a/functest/opnfv_tests/features/netready.py +++ b/functest/opnfv_tests/features/netready.py @@ -13,10 +13,9 @@ import functest.core.feature as base class GluonVping(base.Feature): - def __init__(self, case_name='gluon_vping'): - super(GluonVping, self).__init__(project='netready', - case_name=case_name, - repo='dir_repo_netready') + def __init__(self, **kwargs): + kwargs["repo"] = 'dir_repo_netready' + super(GluonVping, self).__init__(**kwargs) dir_netready_functest = '{}/test/functest'.format(self.repo) self.cmd = ('cd %s && python ./gluon-test-suite.py' % dir_netready_functest) diff --git a/functest/opnfv_tests/features/odl_sfc.py b/functest/opnfv_tests/features/odl_sfc.py index f96683e3..d4f4eb67 100644 --- a/functest/opnfv_tests/features/odl_sfc.py +++ b/functest/opnfv_tests/features/odl_sfc.py @@ -12,9 +12,8 @@ import functest.core.feature as base class OpenDaylightSFC(base.Feature): - def __init__(self, case_name='functest-odl-sfc'): - super(OpenDaylightSFC, self).__init__(project='sfc', - case_name=case_name, - repo='dir_repo_sfc') + def __init__(self, **kwargs): + kwargs["repo"] = 'dir_repo_sfc' + super(OpenDaylightSFC, self).__init__(**kwargs) dir_sfc_functest = '{}/sfc/tests/functest'.format(self.repo) self.cmd = 'cd %s && python ./run_tests.py' % dir_sfc_functest diff --git a/functest/opnfv_tests/features/promise.py b/functest/opnfv_tests/features/promise.py index e3dc7fdf..49eb8a08 100644 --- a/functest/opnfv_tests/features/promise.py +++ b/functest/opnfv_tests/features/promise.py @@ -16,9 +16,8 @@ import functest.core.feature as base class Promise(base.Feature): - def __init__(self, case_name='promise'): - super(Promise, self).__init__(project='promise', - case_name=case_name, - repo='dir_repo_promise') + def __init__(self, **kwargs): + kwargs["repo"] = 'dir_repo_promise' + super(Promise, self).__init__(**kwargs) dir_promise_functest = '{}/promise/test/functest'.format(self.repo) self.cmd = 'cd %s && python ./run_tests.py' % dir_promise_functest diff --git a/functest/opnfv_tests/features/sdnvpn.py b/functest/opnfv_tests/features/sdnvpn.py index 5e9254a0..6a1071ff 100644 --- a/functest/opnfv_tests/features/sdnvpn.py +++ b/functest/opnfv_tests/features/sdnvpn.py @@ -12,9 +12,8 @@ import functest.core.feature as base class SdnVpnTests(base.Feature): - def __init__(self, case_name='bgpvpn'): - super(SdnVpnTests, self).__init__(project='sdnvpn', - case_name=case_name, - repo='dir_repo_sdnvpn') + def __init__(self, **kwargs): + kwargs["repo"] = 'dir_repo_sdnvpn' + super(SdnVpnTests, self).__init__(**kwargs) dir_sfc_functest = '{}/sdnvpn/test/functest'.format(self.repo) self.cmd = 'cd %s && python ./run_tests.py' % dir_sfc_functest diff --git a/functest/opnfv_tests/features/security_scan.py b/functest/opnfv_tests/features/security_scan.py index e7256380..2ed9a823 100644 --- a/functest/opnfv_tests/features/security_scan.py +++ b/functest/opnfv_tests/features/security_scan.py @@ -13,10 +13,9 @@ from functest.utils.constants import CONST class SecurityScan(base.Feature): - def __init__(self, case_name='security_scan'): - super(SecurityScan, self).__init__(project='securityscanning', - case_name=case_name, - repo='dir_repo_securityscan') + def __init__(self, **kwargs): + kwargs["repo"] = 'dir_repo_securityscan' + super(SecurityScan, self).__init__(**kwargs) self.cmd = ('. {0}/stackrc && ' 'cd {1} && ' 'python security_scan.py --config config.ini && ' diff --git a/functest/opnfv_tests/mano/orchestra.py b/functest/opnfv_tests/mano/orchestra.py index a9cf0ae6..dea26efc 100644 --- a/functest/opnfv_tests/mano/orchestra.py +++ b/functest/opnfv_tests/mano/orchestra.py @@ -16,9 +16,12 @@ import functest.core.feature as base class Orchestra(base.Feature): - def __init__(self): - super(Orchestra, self).__init__(project='orchestra', - case='orchestra', - repo='dir_repo_orchestra') + def __init__(self, **kwargs): + if "project_name" not in kwargs: + kwargs["project_name"] = "orchestra" + if "case_name" not in kwargs: + kwargs["case_name"] = "orchestra" + kwargs['repo'] = 'dir_repo_orchestra' + super(Orchestra, self).__init__(**kwargs) # TODO # self.cmd = "%s/tests/run.sh %s/tests" % (self.repo, self.repo) diff --git a/functest/opnfv_tests/openstack/rally/rally.py b/functest/opnfv_tests/openstack/rally/rally.py index e7411c51..ad8745c7 100644 --- a/functest/opnfv_tests/openstack/rally/rally.py +++ b/functest/opnfv_tests/openstack/rally/rally.py @@ -56,8 +56,8 @@ class RallyBase(testcase.TestCase): RALLY_PRIVATE_SUBNET_CIDR = CONST.rally_subnet_cidr RALLY_ROUTER_NAME = CONST.rally_router_name - def __init__(self, case_name=''): - super(RallyBase, self).__init__(case_name) + def __init__(self, **kwargs): + super(RallyBase, self).__init__(**kwargs) self.mode = '' self.summary = [] self.scenario_dir = '' @@ -536,8 +536,10 @@ class RallyBase(testcase.TestCase): class RallySanity(RallyBase): - def __init__(self, case_name="rally_sanity"): - super(RallySanity, self).__init__(case_name) + def __init__(self, **kwargs): + if "case_name" not in kwargs: + kwargs["case_name"] = "rally_sanity" + super(RallySanity, self).__init__(**kwargs) self.mode = 'sanity' self.test_name = 'all' self.smoke = True @@ -545,8 +547,10 @@ class RallySanity(RallyBase): class RallyFull(RallyBase): - def __init__(self, case_name="rally_full"): - super(RallyFull, self).__init__(case_name) + def __init__(self, **kwargs): + if "case_name" not in kwargs: + kwargs["case_name"] = "rally_full" + super(RallyFull, self).__init__(**kwargs) self.mode = 'full' self.test_name = 'all' self.smoke = False diff --git a/functest/opnfv_tests/openstack/refstack_client/refstack_client.py b/functest/opnfv_tests/openstack/refstack_client/refstack_client.py index 441abfee..c708a223 100755 --- a/functest/opnfv_tests/openstack/refstack_client/refstack_client.py +++ b/functest/opnfv_tests/openstack/refstack_client/refstack_client.py @@ -25,8 +25,10 @@ logger = ft_logger.Logger("refstack_defcore").getLogger() class RefstackClient(testcase.TestCase): - def __init__(self, case_name="refstack_defcore"): - super(RefstackClient, self).__init__(case_name) + def __init__(self, **kwargs): + if "case_name" not in kwargs: + kwargs["case_name"] = "refstack_defcore" + super(RefstackClient, self).__init__(**kwargs) self.FUNCTEST_TEST = CONST.dir_functest_test self.CONF_PATH = CONST.refstack_tempest_conf_path self.DEFCORE_LIST = CONST.refstack_defcore_list diff --git a/functest/opnfv_tests/openstack/snaps/api_check.py b/functest/opnfv_tests/openstack/snaps/api_check.py index dea1ca75..bceb7c1d 100644 --- a/functest/opnfv_tests/openstack/snaps/api_check.py +++ b/functest/opnfv_tests/openstack/snaps/api_check.py @@ -20,8 +20,10 @@ class ApiCheck(SnapsTestRunner): that exercise many of the OpenStack APIs within Keystone, Glance, Neutron, and Nova """ - def __init__(self, case_name="api_check"): - super(ApiCheck, self).__init__(case_name) + def __init__(self, **kwargs): + if "case_name" not in kwargs: + kwargs["case_name"] = "api_check" + super(ApiCheck, self).__init__(**kwargs) self.suite = unittest.TestSuite() diff --git a/functest/opnfv_tests/openstack/snaps/connection_check.py b/functest/opnfv_tests/openstack/snaps/connection_check.py index 57b74d4c..0607beb3 100644 --- a/functest/opnfv_tests/openstack/snaps/connection_check.py +++ b/functest/opnfv_tests/openstack/snaps/connection_check.py @@ -20,8 +20,10 @@ class ConnectionCheck(SnapsTestRunner): that simply obtain the different OpenStack clients and may perform simple queries """ - def __init__(self, case_name="connection_check"): - super(ConnectionCheck, self).__init__(case_name) + def __init__(self, **kwargs): + if "case_name" not in kwargs: + kwargs["case_name"] = "connection_check" + super(ConnectionCheck, self).__init__(**kwargs) self.suite = unittest.TestSuite() diff --git a/functest/opnfv_tests/openstack/snaps/health_check.py b/functest/opnfv_tests/openstack/snaps/health_check.py index 6b3cfdd0..245f5052 100644 --- a/functest/opnfv_tests/openstack/snaps/health_check.py +++ b/functest/opnfv_tests/openstack/snaps/health_check.py @@ -21,8 +21,10 @@ class HealthCheck(SnapsTestRunner): creates a VM with a single port with an IPv4 address that is assigned by DHCP. This test then validates the expected IP with the actual """ - def __init__(self, case_name="snaps_health_check"): - super(HealthCheck, self).__init__(case_name) + def __init__(self, **kwargs): + if "case_name" not in kwargs: + kwargs["case_name"] = "snaps_health_check" + super(HealthCheck, self).__init__(**kwargs) self.suite = unittest.TestSuite() diff --git a/functest/opnfv_tests/openstack/snaps/smoke.py b/functest/opnfv_tests/openstack/snaps/smoke.py index 63d5c122..ceead6bb 100644 --- a/functest/opnfv_tests/openstack/snaps/smoke.py +++ b/functest/opnfv_tests/openstack/snaps/smoke.py @@ -21,8 +21,10 @@ class SnapsSmoke(SnapsTestRunner): that exercise many of the OpenStack APIs within Keystone, Glance, Neutron, and Nova """ - def __init__(self, case_name="snaps_smoke"): - super(SnapsSmoke, self).__init__(case_name) + def __init__(self, **kwargs): + if "case_name" not in kwargs: + kwargs["case_name"] = "snaps_smoke" + super(SnapsSmoke, self).__init__(**kwargs) self.suite = unittest.TestSuite() use_fip = CONST.snaps_use_floating_ips diff --git a/functest/opnfv_tests/openstack/snaps/snaps_test_runner.py b/functest/opnfv_tests/openstack/snaps/snaps_test_runner.py index 044a0bb0..2068852e 100644 --- a/functest/opnfv_tests/openstack/snaps/snaps_test_runner.py +++ b/functest/opnfv_tests/openstack/snaps/snaps_test_runner.py @@ -19,8 +19,8 @@ class SnapsTestRunner(PyTestSuiteRunner): creates a VM with a single port with an IPv4 address that is assigned by DHCP. This test then validates the expected IP with the actual """ - def __init__(self, case_name=''): - super(SnapsTestRunner, self).__init__(case_name) + def __init__(self, **kwargs): + super(SnapsTestRunner, self).__init__(**kwargs) self.ext_net_name = snaps_utils.get_ext_net_name() self.logger = ft_logger.Logger(self.project_name).getLogger() diff --git a/functest/opnfv_tests/openstack/tempest/tempest.py b/functest/opnfv_tests/openstack/tempest/tempest.py index c3184e35..8b175c25 100644 --- a/functest/opnfv_tests/openstack/tempest/tempest.py +++ b/functest/opnfv_tests/openstack/tempest/tempest.py @@ -28,8 +28,8 @@ logger = ft_logger.Logger("Tempest").getLogger() class TempestCommon(testcase.TestCase): - def __init__(self, case_name=''): - super(TempestCommon, self).__init__(case_name) + def __init__(self, **kwargs): + super(TempestCommon, self).__init__(**kwargs) self.MODE = "" self.OPTION = "" self.VERIFIER_ID = conf_utils.get_verifier_id() @@ -234,31 +234,39 @@ class TempestCommon(testcase.TestCase): class TempestSmokeSerial(TempestCommon): - def __init__(self, case_name='tempest_smoke_serial'): - TempestCommon.__init__(self, case_name) + def __init__(self, **kwargs): + if "case_name" not in kwargs: + kwargs["case_name"] = 'tempest_smoke_serial' + TempestCommon.__init__(self, **kwargs) self.MODE = "smoke" self.OPTION = "--concurrency 1" class TempestSmokeParallel(TempestCommon): - def __init__(self, case_name='tempest_smoke_parallel'): - TempestCommon.__init__(self, case_name) + def __init__(self, **kwargs): + if "case_name" not in kwargs: + kwargs["case_name"] = 'tempest_smoke_parallel' + TempestCommon.__init__(self, **kwargs) self.MODE = "smoke" self.OPTION = "" class TempestFullParallel(TempestCommon): - def __init__(self, case_name="tempest_full_parallel"): - TempestCommon.__init__(self, case_name) + def __init__(self, **kwargs): + if "case_name" not in kwargs: + kwargs["case_name"] = 'tempest_full_parallel' + TempestCommon.__init__(self, **kwargs) self.MODE = "full" class TempestMultisite(TempestCommon): - def __init__(self, case_name="multisite"): - TempestCommon.__init__(self, case_name) + def __init__(self, **kwargs): + if "case_name" not in kwargs: + kwargs["case_name"] = 'multisite' + TempestCommon.__init__(self, **kwargs) self.MODE = "feature_multisite" self.OPTION = "--concurrency 1" conf_utils.install_verifier_ext(CONST.dir_repo_kingbird) @@ -266,15 +274,19 @@ class TempestMultisite(TempestCommon): class TempestCustom(TempestCommon): - def __init__(self, case_name="tempest_custom"): - TempestCommon.__init__(self, case_name) + def __init__(self, **kwargs): + if "case_name" not in kwargs: + kwargs["case_name"] = 'tempest_custom' + TempestCommon.__init__(self, **kwargs) self.MODE = "custom" self.OPTION = "--concurrency 1" class TempestDefcore(TempestCommon): - def __init__(self, case_name="tempest_defcore"): - TempestCommon.__init__(self, case_name) + def __init__(self, **kwargs): + if "case_name" not in kwargs: + kwargs["case_name"] = 'tempest_defcore' + TempestCommon.__init__(self, **kwargs) self.MODE = "defcore" self.OPTION = "--concurrency 1" diff --git a/functest/opnfv_tests/openstack/vping/vping_base.py b/functest/opnfv_tests/openstack/vping/vping_base.py index 64cb0004..8f7cc1d2 100644 --- a/functest/opnfv_tests/openstack/vping/vping_base.py +++ b/functest/opnfv_tests/openstack/vping/vping_base.py @@ -18,8 +18,8 @@ from functest.utils.constants import CONST class VPingBase(testcase.TestCase): - def __init__(self, case_name=''): - super(VPingBase, self).__init__(case_name) + def __init__(self, **kwargs): + super(VPingBase, self).__init__(**kwargs) self.logger = None self.functest_repo = CONST.dir_repo_functest self.repo = CONST.dir_vping diff --git a/functest/opnfv_tests/openstack/vping/vping_ssh.py b/functest/opnfv_tests/openstack/vping/vping_ssh.py index a68b0ff7..c26c4e0c 100755 --- a/functest/opnfv_tests/openstack/vping/vping_ssh.py +++ b/functest/opnfv_tests/openstack/vping/vping_ssh.py @@ -24,8 +24,10 @@ import functest.core.testcase as testcase class VPingSSH(vping_base.VPingBase): - def __init__(self, case_name='vping_ssh'): - super(VPingSSH, self).__init__(case_name) + def __init__(self, **kwargs): + if "case_name" not in kwargs: + kwargs["case_name"] = "vping_ssh" + super(VPingSSH, self).__init__(**kwargs) self.logger = ft_logger.Logger(self.case_name).getLogger() def do_vping(self, vm, test_ip): diff --git a/functest/opnfv_tests/openstack/vping/vping_userdata.py b/functest/opnfv_tests/openstack/vping/vping_userdata.py index e9b86998..1b00ca23 100755 --- a/functest/opnfv_tests/openstack/vping/vping_userdata.py +++ b/functest/opnfv_tests/openstack/vping/vping_userdata.py @@ -18,8 +18,10 @@ import vping_base class VPingUserdata(vping_base.VPingBase): - def __init__(self, case_name='vping_userdata'): - super(VPingUserdata, self).__init__(case_name) + def __init__(self, **kwargs): + if "case_name" not in kwargs: + kwargs["case_name"] = "vping_userdata" + super(VPingUserdata, self).__init__(**kwargs) self.logger = ft_logger.Logger(self.case_name).getLogger() def boot_vm_preparation(self, config, vmname, test_ip): diff --git a/functest/opnfv_tests/sdn/onos/onos.py b/functest/opnfv_tests/sdn/onos/onos.py index fe37669a..fe496c1f 100644 --- a/functest/opnfv_tests/sdn/onos/onos.py +++ b/functest/opnfv_tests/sdn/onos/onos.py @@ -49,8 +49,10 @@ class OnosBase(testcase.TestCase): class Onos(OnosBase): - def __init__(self, case_name='onos'): - super(Onos, self).__init__(case_name) + def __init__(self, **kwargs): + if "case_name" not in kwargs: + kwargs["case_name"] = "onos" + super(Onos, self).__init__(**kwargs) self.log_path = os.path.join(self.onos_repo_path, 'TestON/logs') def set_onos_ip(self): 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): diff --git a/functest/tests/unit/ci/test_tier_builder.py b/functest/tests/unit/ci/test_tier_builder.py index 48c94a57..438fa7c2 100644 --- a/functest/tests/unit/ci/test_tier_builder.py +++ b/functest/tests/unit/ci/test_tier_builder.py @@ -22,7 +22,7 @@ class TierBuilderTesting(unittest.TestCase): 'scenario': 'test_scenario'} self.testcase = {'dependencies': self.dependency, - 'name': 'test_name', + 'case_name': 'test_name', 'criteria': 'test_criteria', 'blocking': 'test_blocking', 'clean_flag': 'test_clean_flag', diff --git a/functest/tests/unit/core/test_testcase.py b/functest/tests/unit/core/test_testcase.py index 5ff41cd6..4f3b25cc 100644 --- a/functest/tests/unit/core/test_testcase.py +++ b/functest/tests/unit/core/test_testcase.py @@ -27,10 +27,11 @@ class TestCaseTesting(unittest.TestCase): logging.disable(logging.CRITICAL) _case_name = "base" + _project_name = "functest" def setUp(self): - self.test = testcase.TestCase(case_name=self._case_name) - self.test.project = "functest" + self.test = testcase.TestCase(case_name=self._case_name, + project_name=self._project_name) self.test.start_time = "1" self.test.stop_time = "2" self.test.criteria = "PASS" @@ -74,7 +75,7 @@ class TestCaseTesting(unittest.TestCase): self.assertEqual(self.test.push_to_db(), testcase.TestCase.EX_OK) mock_function.assert_called_once_with( - self.test.project, self._case_name, self.test.start_time, + self._project_name, self._case_name, self.test.start_time, self.test.stop_time, self.test.criteria, self.test.details) @mock.patch('functest.utils.functest_utils.push_results_to_db', @@ -83,7 +84,7 @@ class TestCaseTesting(unittest.TestCase): self.assertEqual(self.test.push_to_db(), testcase.TestCase.EX_PUSH_TO_DB_ERROR) mock_function.assert_called_once_with( - self.test.project, self._case_name, self.test.start_time, + self._project_name, self._case_name, self.test.start_time, self.test.stop_time, self.test.criteria, self.test.details) @mock.patch('functest.utils.functest_utils.push_results_to_db', @@ -92,7 +93,7 @@ class TestCaseTesting(unittest.TestCase): self.assertEqual(self.test.push_to_db(), testcase.TestCase.EX_OK) mock_function.assert_called_once_with( - self.test.project, self._case_name, self.test.start_time, + self._project_name, self._case_name, self.test.start_time, self.test.stop_time, self.test.criteria, self.test.details) def test_check_criteria_missing(self): diff --git a/functest/tests/unit/features/test_barometer.py b/functest/tests/unit/features/test_barometer.py index 62f2e0d6..8afb56df 100644 --- a/functest/tests/unit/features/test_barometer.py +++ b/functest/tests/unit/features/test_barometer.py @@ -26,13 +26,16 @@ class BarometerTesting(unittest.TestCase): logging.disable(logging.CRITICAL) + _case_name = "barometercollectd" + _project_name = "barometer" + def setUp(self): self.barometer = barometer.BarometerCollectd( - case_name="barometercollectd") + case_name=self._case_name, project_name=self._project_name) def test_init(self): - self.assertEqual(self.barometer.project_name, "barometer") - self.assertEqual(self.barometer.case_name, "barometercollectd") + self.assertEqual(self.barometer.project_name, self._project_name) + self.assertEqual(self.barometer.case_name, self._case_name) self.assertEqual( self.barometer.repo, constants.CONST.__getattribute__('dir_repo_barometer')) diff --git a/functest/tests/unit/features/test_copper.py b/functest/tests/unit/features/test_copper.py index b6d187f7..e4ddc149 100644 --- a/functest/tests/unit/features/test_copper.py +++ b/functest/tests/unit/features/test_copper.py @@ -20,12 +20,16 @@ class CopperTesting(unittest.TestCase): logging.disable(logging.CRITICAL) + _case_name = "copper-notification" + _project_name = "copper" + def setUp(self): - self.copper = copper.Copper(case_name="copper-notification") + self.copper = copper.Copper(case_name=self._case_name, + project_name=self._project_name) def test_init(self): - self.assertEqual(self.copper.project_name, "copper") - self.assertEqual(self.copper.case_name, "copper-notification") + self.assertEqual(self.copper.project_name, self._project_name) + self.assertEqual(self.copper.case_name, self._case_name) self.assertEqual( self.copper.repo, constants.CONST.__getattribute__("dir_repo_copper")) diff --git a/functest/tests/unit/features/test_doctor.py b/functest/tests/unit/features/test_doctor.py index 36bac44f..a8512883 100644 --- a/functest/tests/unit/features/test_doctor.py +++ b/functest/tests/unit/features/test_doctor.py @@ -20,12 +20,16 @@ class DoctorTesting(unittest.TestCase): logging.disable(logging.CRITICAL) + _case_name = "doctor-notification" + _project_name = "doctor" + def setUp(self): - self.doctor = doctor.Doctor(case_name="doctor-notification") + self.doctor = doctor.Doctor(case_name=self._case_name, + project_name=self._project_name) def test_init(self): - self.assertEqual(self.doctor.project_name, "doctor") - self.assertEqual(self.doctor.case_name, "doctor-notification") + self.assertEqual(self.doctor.project_name, self._project_name) + self.assertEqual(self.doctor.case_name, self._case_name) self.assertEqual( self.doctor.repo, constants.CONST.__getattribute__("dir_repo_doctor")) diff --git a/functest/tests/unit/features/test_domino.py b/functest/tests/unit/features/test_domino.py index c0bfd14b..27353a4d 100644 --- a/functest/tests/unit/features/test_domino.py +++ b/functest/tests/unit/features/test_domino.py @@ -20,12 +20,16 @@ class DominoTesting(unittest.TestCase): logging.disable(logging.CRITICAL) + _case_name = "domino-multinode" + _project_name = "domino" + def setUp(self): - self.domino = domino.Domino(case_name="domino-multinode") + self.domino = domino.Domino(case_name=self._case_name, + project_name=self._project_name) def test_init(self): - self.assertEqual(self.domino.project_name, "domino") - self.assertEqual(self.domino.case_name, "domino-multinode") + self.assertEqual(self.domino.project_name, self._project_name) + self.assertEqual(self.domino.case_name, self._case_name) self.assertEqual( self.domino.repo, constants.CONST.__getattribute__("dir_repo_domino")) diff --git a/functest/tests/unit/features/test_netready.py b/functest/tests/unit/features/test_netready.py index 47be4203..1a88e78a 100644 --- a/functest/tests/unit/features/test_netready.py +++ b/functest/tests/unit/features/test_netready.py @@ -20,12 +20,16 @@ class NetreadyTesting(unittest.TestCase): logging.disable(logging.CRITICAL) + _case_name = "gluon_vping" + _project_name = "netready" + def setUp(self): - self.netready = netready.GluonVping(case_name="gluon_vping") + self.netready = netready.GluonVping(case_name=self._case_name, + project_name=self._project_name) def test_init(self): - self.assertEqual(self.netready.project_name, "netready") - self.assertEqual(self.netready.case_name, "gluon_vping") + self.assertEqual(self.netready.project_name, self._project_name) + self.assertEqual(self.netready.case_name, self._case_name) self.assertEqual( self.netready.repo, constants.CONST.__getattribute__("dir_repo_netready")) diff --git a/functest/tests/unit/features/test_odl_sfc.py b/functest/tests/unit/features/test_odl_sfc.py index dcdcdff6..439d5965 100644 --- a/functest/tests/unit/features/test_odl_sfc.py +++ b/functest/tests/unit/features/test_odl_sfc.py @@ -20,8 +20,13 @@ class OpenDaylightSFCTesting(unittest.TestCase): logging.disable(logging.CRITICAL) + _case_name = "functest-odl-sfc" + _project_name = "sfc" + def setUp(self): - self.odl_sfc = odl_sfc.OpenDaylightSFC(case_name="functest-odl-sfc") + self.odl_sfc = odl_sfc.OpenDaylightSFC( + case_name="functest-odl-sfc", + project_name=self._project_name) def test_init(self): self.assertEqual(self.odl_sfc.project_name, "sfc") diff --git a/functest/tests/unit/features/test_promise.py b/functest/tests/unit/features/test_promise.py index 29b4d4ec..2af9c670 100644 --- a/functest/tests/unit/features/test_promise.py +++ b/functest/tests/unit/features/test_promise.py @@ -20,12 +20,16 @@ class PromiseTesting(unittest.TestCase): logging.disable(logging.CRITICAL) + _case_name = "promise" + _project_name = "promise" + def setUp(self): - self.promise = promise.Promise(case_name="promise") + self.promise = promise.Promise(case_name=self._case_name, + project_name=self._project_name) def test_init(self): - self.assertEqual(self.promise.project_name, "promise") - self.assertEqual(self.promise.case_name, "promise") + self.assertEqual(self.promise.project_name, self._project_name) + self.assertEqual(self.promise.case_name, self._case_name) self.assertEqual( self.promise.repo, constants.CONST.__getattribute__("dir_repo_promise")) diff --git a/functest/tests/unit/features/test_sdnvpn.py b/functest/tests/unit/features/test_sdnvpn.py index 8fa43fc4..dd67d8b4 100644 --- a/functest/tests/unit/features/test_sdnvpn.py +++ b/functest/tests/unit/features/test_sdnvpn.py @@ -20,12 +20,16 @@ class SdnVpnTesting(unittest.TestCase): logging.disable(logging.CRITICAL) + _case_name = "bgpvpn" + _project_name = "sdnvpn" + def setUp(self): - self.sdnvpn = sdnvpn.SdnVpnTests(case_name="bgpvpn") + self.sdnvpn = sdnvpn.SdnVpnTests(case_name=self._case_name, + project_name=self._project_name) def test_init(self): - self.assertEqual(self.sdnvpn.project_name, "sdnvpn") - self.assertEqual(self.sdnvpn.case_name, "bgpvpn") + self.assertEqual(self.sdnvpn.project_name, self._project_name) + self.assertEqual(self.sdnvpn.case_name, self._case_name) self.assertEqual( self.sdnvpn.repo, constants.CONST.__getattribute__("dir_repo_sdnvpn")) diff --git a/functest/tests/unit/features/test_security_scan.py b/functest/tests/unit/features/test_security_scan.py index f0e40159..081bf1f6 100644 --- a/functest/tests/unit/features/test_security_scan.py +++ b/functest/tests/unit/features/test_security_scan.py @@ -20,12 +20,16 @@ class SecurityScanTesting(unittest.TestCase): logging.disable(logging.CRITICAL) + _case_name = "security_scan" + _project_name = "security_scan" + def setUp(self): - self.sscan = security_scan.SecurityScan(case_name="security_scan") + self.sscan = security_scan.SecurityScan( + case_name=self._case_name, project_name=self._project_name) def test_init(self): - self.assertEqual(self.sscan.project_name, "securityscanning") - self.assertEqual(self.sscan.case_name, "security_scan") + self.assertEqual(self.sscan.project_name, self._project_name) + self.assertEqual(self.sscan.case_name, self._case_name) self.assertEqual( self.sscan.repo, constants.CONST.__getattribute__("dir_repo_securityscan")) diff --git a/functest/tests/unit/odl/test_odl.py b/functest/tests/unit/odl/test_odl.py index e08deb27..55e100dd 100644 --- a/functest/tests/unit/odl/test_odl.py +++ b/functest/tests/unit/odl/test_odl.py @@ -90,7 +90,7 @@ class ODLTesting(unittest.TestCase): os.environ["OS_USERNAME"] = self._os_username os.environ["OS_PASSWORD"] = self._os_password os.environ["OS_TENANT_NAME"] = self._os_tenantname - self.test = odl.ODLTests() + self.test = odl.ODLTests(case_name='odl', project_name='functest') self.defaultargs = {'odlusername': self._odl_username, 'odlpassword': self._odl_password, 'neutronip': self._keystone_ip, diff --git a/functest/tests/unit/utils/test_functest_utils.py b/functest/tests/unit/utils/test_functest_utils.py index eb241e5d..22cadf0f 100644 --- a/functest/tests/unit/utils/test_functest_utils.py +++ b/functest/tests/unit/utils/test_functest_utils.py @@ -54,7 +54,8 @@ class FunctestUtilsTesting(unittest.TestCase): self.cmd = 'test_cmd' self.output_file = 'test_output_file' self.testname = 'testname' - self.testcase_dict = {'name': 'testname', 'criteria': self.criteria} + self.testcase_dict = {'case_name': 'testname', + 'criteria': self.criteria} self.parameter = 'general.openstack.image_name' self.config_yaml = 'test_config_yaml-' self.db_url_env = 'http://foo/testdb' diff --git a/functest/tests/unit/vnf/rnc/test_parser.py b/functest/tests/unit/vnf/rnc/test_parser.py index 59f618ae..3a181fe8 100644 --- a/functest/tests/unit/vnf/rnc/test_parser.py +++ b/functest/tests/unit/vnf/rnc/test_parser.py @@ -20,12 +20,16 @@ class ParserTesting(unittest.TestCase): logging.disable(logging.CRITICAL) + _case_name = "parser-basics" + _project_name = "parser" + def setUp(self): - self.parser = parser.Parser(case_name="parser-basics") + self.parser = parser.Parser( + case_name=self._case_name, project_name=self._project_name) def test_init(self): - self.assertEqual(self.parser.project_name, "parser") - self.assertEqual(self.parser.case_name, "parser-basics") + self.assertEqual(self.parser.project_name, self._project_name) + self.assertEqual(self.parser.case_name, self._case_name) self.assertEqual( self.parser.repo, constants.CONST.__getattribute__("dir_repo_parser")) diff --git a/functest/utils/functest_utils.py b/functest/utils/functest_utils.py index 7cc5029d..ef9d3da9 100644 --- a/functest/utils/functest_utils.py +++ b/functest/utils/functest_utils.py @@ -337,7 +337,7 @@ def get_dict_by_test(testname): for dic_tier in testcases_yaml.get("tiers"): for dic_testcase in dic_tier['testcases']: - if dic_testcase['name'] == testname: + if dic_testcase['case_name'] == testname: return dic_testcase logger.error('Project %s is not defined in testcases.yaml' % testname) |