diff options
Diffstat (limited to 'functest/opnfv_tests/openstack')
12 files changed, 48 insertions, 65 deletions
diff --git a/functest/opnfv_tests/openstack/rally/rally.py b/functest/opnfv_tests/openstack/rally/rally.py index 8c6abc15..e7411c51 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): - super(RallyBase, self).__init__() + def __init__(self, case_name=''): + super(RallyBase, self).__init__(case_name) self.mode = '' self.summary = [] self.scenario_dir = '' @@ -536,9 +536,8 @@ class RallyBase(testcase.TestCase): class RallySanity(RallyBase): - def __init__(self): - super(RallySanity, self).__init__() - self.case_name = 'rally_sanity' + def __init__(self, case_name="rally_sanity"): + super(RallySanity, self).__init__(case_name) self.mode = 'sanity' self.test_name = 'all' self.smoke = True @@ -546,9 +545,8 @@ class RallySanity(RallyBase): class RallyFull(RallyBase): - def __init__(self): - super(RallyFull, self).__init__() - self.case_name = 'rally_full' + def __init__(self, case_name="rally_full"): + super(RallyFull, self).__init__(case_name) 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 37aa9e39..441abfee 100755 --- a/functest/opnfv_tests/openstack/refstack_client/refstack_client.py +++ b/functest/opnfv_tests/openstack/refstack_client/refstack_client.py @@ -25,9 +25,8 @@ logger = ft_logger.Logger("refstack_defcore").getLogger() class RefstackClient(testcase.TestCase): - def __init__(self): - super(RefstackClient, self).__init__() - self.case_name = "refstack_defcore" + def __init__(self, case_name="refstack_defcore"): + super(RefstackClient, self).__init__(case_name) self.FUNCTEST_TEST = CONST.dir_functest_test self.CONF_PATH = CONST.refstack_tempest_conf_path self.DEFCORE_LIST = CONST.refstack_defcore_list @@ -192,10 +191,9 @@ class RefstackClient(testcase.TestCase): return res -class RefstackClientParser(testcase.TestCase): +class RefstackClientParser(object): def __init__(self): - super(RefstackClientParser, self).__init__() 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/refstack_client/tempest_conf.py b/functest/opnfv_tests/openstack/refstack_client/tempest_conf.py index 5624ed79..d01f0872 100755 --- a/functest/opnfv_tests/openstack/refstack_client/tempest_conf.py +++ b/functest/opnfv_tests/openstack/refstack_client/tempest_conf.py @@ -5,9 +5,8 @@ # are made available under the terms of the Apache License, Version 2.0 # which accompanies this distribution, and is available at # http://www.apache.org/licenses/LICENSE-2.0 -import sys +import os -from functest.core import testcase from functest.opnfv_tests.openstack.tempest import conf_utils from functest.utils import openstack_utils from functest.utils.constants import CONST @@ -25,6 +24,8 @@ class TempestConf(object): self.DEPLOYMENT_ID = conf_utils.get_verifier_deployment_id() self.DEPLOYMENT_DIR = conf_utils.get_verifier_deployment_dir( self.VERIFIER_ID, self.DEPLOYMENT_ID) + self.confpath = os.path.join(CONST.dir_functest_test, + CONST.refstack_tempest_conf_path) def generate_tempestconf(self): try: @@ -33,21 +34,19 @@ class TempestConf(object): use_custom_images=True, use_custom_flavors=True) conf_utils.configure_tempest_defcore( self.DEPLOYMENT_DIR, img_flavor_dict) - except KeyError as e: - logger.error("defcore prepare env error with: %s", e) + except Exception as e: + logger.error("error with generating refstack client " + "reference tempest conf file: %s", e) def main(self): try: self.generate_tempestconf() - res = testcase.TestCase.EX_OK + logger.info("a reference tempest conf file generated " + "at %s", self.confpath) except Exception as e: logger.error('Error with run: %s', e) - res = testcase.TestCase.EX_RUN_ERROR - return res if __name__ == '__main__': tempestconf = TempestConf() - result = tempestconf.main() - if result != testcase.TestCase.EX_OK: - sys.exit(result) + tempestconf.main() diff --git a/functest/opnfv_tests/openstack/snaps/api_check.py b/functest/opnfv_tests/openstack/snaps/api_check.py index ad77d9be..dea1ca75 100644 --- a/functest/opnfv_tests/openstack/snaps/api_check.py +++ b/functest/opnfv_tests/openstack/snaps/api_check.py @@ -20,11 +20,10 @@ class ApiCheck(SnapsTestRunner): that exercise many of the OpenStack APIs within Keystone, Glance, Neutron, and Nova """ - def __init__(self): - super(ApiCheck, self).__init__() + def __init__(self, case_name="api_check"): + super(ApiCheck, self).__init__(case_name) self.suite = unittest.TestSuite() - self.case_name = "api_check" test_suite_builder.add_openstack_api_tests( self.suite, diff --git a/functest/opnfv_tests/openstack/snaps/connection_check.py b/functest/opnfv_tests/openstack/snaps/connection_check.py index 0637bcfb..57b74d4c 100644 --- a/functest/opnfv_tests/openstack/snaps/connection_check.py +++ b/functest/opnfv_tests/openstack/snaps/connection_check.py @@ -20,11 +20,10 @@ class ConnectionCheck(SnapsTestRunner): that simply obtain the different OpenStack clients and may perform simple queries """ - def __init__(self): - super(ConnectionCheck, self).__init__() + def __init__(self, case_name="connection_check"): + super(ConnectionCheck, self).__init__(case_name) self.suite = unittest.TestSuite() - self.case_name = "connection_check" test_suite_builder.add_openstack_client_tests( self.suite, diff --git a/functest/opnfv_tests/openstack/snaps/health_check.py b/functest/opnfv_tests/openstack/snaps/health_check.py index 8fece746..6b3cfdd0 100644 --- a/functest/opnfv_tests/openstack/snaps/health_check.py +++ b/functest/opnfv_tests/openstack/snaps/health_check.py @@ -21,11 +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): - super(HealthCheck, self).__init__() + def __init__(self, case_name="snaps_health_check"): + super(HealthCheck, self).__init__(case_name) self.suite = unittest.TestSuite() - self.case_name = "snaps_health_check" image_custom_config = None if hasattr(CONST, 'snaps_health_check'): diff --git a/functest/opnfv_tests/openstack/snaps/smoke.py b/functest/opnfv_tests/openstack/snaps/smoke.py index 45fa6de8..63d5c122 100644 --- a/functest/opnfv_tests/openstack/snaps/smoke.py +++ b/functest/opnfv_tests/openstack/snaps/smoke.py @@ -21,11 +21,10 @@ class SnapsSmoke(SnapsTestRunner): that exercise many of the OpenStack APIs within Keystone, Glance, Neutron, and Nova """ - def __init__(self): - super(SnapsSmoke, self).__init__() + def __init__(self, case_name="snaps_smoke"): + super(SnapsSmoke, self).__init__(case_name) self.suite = unittest.TestSuite() - self.case_name = "snaps_smoke" use_fip = CONST.snaps_use_floating_ips # The snaps smoke test uses the same config as the diff --git a/functest/opnfv_tests/openstack/snaps/snaps_test_runner.py b/functest/opnfv_tests/openstack/snaps/snaps_test_runner.py index 9d723905..044a0bb0 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): - super(SnapsTestRunner, self).__init__() + def __init__(self, case_name=''): + super(SnapsTestRunner, self).__init__(case_name) 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 0addbd17..c3184e35 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): - super(TempestCommon, self).__init__() + def __init__(self, case_name=''): + super(TempestCommon, self).__init__(case_name) self.MODE = "" self.OPTION = "" self.VERIFIER_ID = conf_utils.get_verifier_id() @@ -234,35 +234,31 @@ class TempestCommon(testcase.TestCase): class TempestSmokeSerial(TempestCommon): - def __init__(self): - TempestCommon.__init__(self) - self.case_name = "tempest_smoke_serial" + def __init__(self, case_name='tempest_smoke_serial'): + TempestCommon.__init__(self, case_name) self.MODE = "smoke" self.OPTION = "--concurrency 1" class TempestSmokeParallel(TempestCommon): - def __init__(self): - TempestCommon.__init__(self) - self.case_name = "tempest_smoke_parallel" + def __init__(self, case_name='tempest_smoke_parallel'): + TempestCommon.__init__(self, case_name) self.MODE = "smoke" self.OPTION = "" class TempestFullParallel(TempestCommon): - def __init__(self): - TempestCommon.__init__(self) - self.case_name = "tempest_full_parallel" + def __init__(self, case_name="tempest_full_parallel"): + TempestCommon.__init__(self, case_name) self.MODE = "full" class TempestMultisite(TempestCommon): - def __init__(self): - TempestCommon.__init__(self) - self.case_name = "multisite" + def __init__(self, case_name="multisite"): + TempestCommon.__init__(self, case_name) self.MODE = "feature_multisite" self.OPTION = "--concurrency 1" conf_utils.install_verifier_ext(CONST.dir_repo_kingbird) @@ -270,17 +266,15 @@ class TempestMultisite(TempestCommon): class TempestCustom(TempestCommon): - def __init__(self): - TempestCommon.__init__(self) - self.case_name = "tempest_custom" + def __init__(self, case_name="tempest_custom"): + TempestCommon.__init__(self, case_name) self.MODE = "custom" self.OPTION = "--concurrency 1" class TempestDefcore(TempestCommon): - def __init__(self): - TempestCommon.__init__(self) - self.case_name = "tempest_defcore" + def __init__(self, case_name="tempest_defcore"): + TempestCommon.__init__(self, case_name) 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 584ded38..64cb0004 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): - super(VPingBase, self).__init__() + def __init__(self, case_name=''): + super(VPingBase, self).__init__(case_name) 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 fc2f01c6..a68b0ff7 100755 --- a/functest/opnfv_tests/openstack/vping/vping_ssh.py +++ b/functest/opnfv_tests/openstack/vping/vping_ssh.py @@ -24,9 +24,8 @@ import functest.core.testcase as testcase class VPingSSH(vping_base.VPingBase): - def __init__(self): - super(VPingSSH, self).__init__() - self.case_name = 'vping_ssh' + def __init__(self, case_name='vping_ssh'): + super(VPingSSH, self).__init__(case_name) 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 fa91c12a..e9b86998 100755 --- a/functest/opnfv_tests/openstack/vping/vping_userdata.py +++ b/functest/opnfv_tests/openstack/vping/vping_userdata.py @@ -18,9 +18,8 @@ import vping_base class VPingUserdata(vping_base.VPingBase): - def __init__(self): - super(VPingUserdata, self).__init__() - self.case_name = 'vping_userdata' + def __init__(self, case_name='vping_userdata'): + super(VPingUserdata, self).__init__(case_name) self.logger = ft_logger.Logger(self.case_name).getLogger() def boot_vm_preparation(self, config, vmname, test_ip): |