From a118c991bfd5368aee517cc26188b1e3fee82d1f Mon Sep 17 00:00:00 2001 From: Valerii Ponomarov Date: Tue, 25 Dec 2018 21:09:09 +0530 Subject: Refactor config options Doing following: - Rename top-level config option group called 'cns' to the 'openshift'. - Rename 'cns.setup.cns_project_name' option to the 'openshift.storage_project_name'. - Rename 'scale' option to the 'openshift.scale'. - Delete ''devices' and 'zone' options from 'gluster_servers' config group. - Delete 'cns.setup.cnd_username' option as unneeded. - Delete 'cns.setup.cnd_password' option as unneeded. - Delete 'oc_login' common function as unneeded after deletion of 'cns.setup.cnd_username' and 'cns.setup.cnd_password' options. - Remove 'Cns' word from base classes. - Keep backwards compatibility for old options to make transition be smooth. Change-Id: I04ddbbad5f64ffeac79a6744480d33a263d63001 --- cns-libs/cnslibs/cns/cns_baseclass.py | 108 ++++++++------------- cns-libs/cnslibs/common/heketi_libs.py | 34 ++----- cns-libs/cnslibs/common/heketi_ops.py | 12 ++- cns-libs/cnslibs/common/openshift_ops.py | 24 ----- tests/cns_tests_sample_config.yml | 99 +++++++++---------- tests/functional/common/arbiter/test_arbiter.py | 9 +- .../gluster_block/test_restart_gluster_block.py | 3 +- .../test_gluster_services_restart.py | 16 +-- .../test_dynamic_provisioning_block_p0_cases.py | 12 +-- .../test_dynamic_provisioning_p0_cases.py | 12 +-- .../common/provisioning/test_pv_resize.py | 4 +- .../provisioning/test_storage_class_cases.py | 10 +- tests/functional/common/test_node_restart.py | 4 +- 13 files changed, 133 insertions(+), 214 deletions(-) diff --git a/cns-libs/cnslibs/cns/cns_baseclass.py b/cns-libs/cnslibs/cns/cns_baseclass.py index 068c25c3..b1b650ab 100644 --- a/cns-libs/cnslibs/cns/cns_baseclass.py +++ b/cns-libs/cnslibs/cns/cns_baseclass.py @@ -1,4 +1,8 @@ -from collections import OrderedDict +import datetime +import unittest + +from glusto.core import Glusto as g + from cnslibs.common import command from cnslibs.common.exceptions import ExecutionError from cnslibs.common.heketi_ops import ( @@ -18,23 +22,16 @@ from cnslibs.common.openshift_ops import ( wait_for_pod_be_ready, wait_for_resource_absence, ) -import datetime -from glusto.core import Glusto as g -import unittest -class CnsBaseClass(unittest.TestCase): - ''' - This class reads the config for variable values that will be used in - CNS tests. - ''' +class BaseClass(unittest.TestCase): + """Base class for test classes.""" + @classmethod def setUpClass(cls): - ''' - Initialize all the variables necessary for testing CNS - ''' - super(CnsBaseClass, cls).setUpClass() - g.log.info("cnsbaseclass") + """Initialize all the variables necessary for test cases.""" + super(BaseClass, cls).setUpClass() + # Initializes OCP config variables cls.ocp_servers_info = g.config['ocp_servers'] cls.ocp_master_node = g.config['ocp_servers']['master'].keys() @@ -43,15 +40,15 @@ class CnsBaseClass(unittest.TestCase): cls.ocp_client_info = g.config['ocp_servers']['client'] cls.ocp_nodes = g.config['ocp_servers']['nodes'].keys() cls.ocp_nodes_info = g.config['ocp_servers']['nodes'] - cls.ocp_all_nodes = cls.ocp_nodes + cls.ocp_master_node - # Initializes CNS config variables - cls.cns_username = g.config['cns']['setup']['cns_username'] - cls.cns_password = g.config['cns']['setup']['cns_password'] - cls.cns_project_name = g.config['cns']['setup']['cns_project_name'] + # Initializes storage project config variables + openshift_config = g.config.get("cns", g.config.get("openshift")) + cls.storage_project_name = openshift_config.get( + 'storage_project_name', + openshift_config.get('setup', {}).get('cns_project_name')) # Initializes heketi config variables - heketi_config = g.config['cns']['heketi_config'] + heketi_config = openshift_config['heketi_config'] cls.heketi_dc_name = heketi_config['heketi_dc_name'] cls.heketi_service_name = heketi_config['heketi_service_name'] cls.heketi_client_node = heketi_config['heketi_client_node'] @@ -61,26 +58,11 @@ class CnsBaseClass(unittest.TestCase): cls.gluster_servers = g.config['gluster_servers'].keys() cls.gluster_servers_info = g.config['gluster_servers'] - cls.topo_info = g.config['cns']['trusted_storage_pool_list'] - - # Constructs topology info dictionary - cls.topology_info = OrderedDict() - for i in range(len(cls.topo_info)): - cluster = 'cluster' + str(i + 1) - cls.topology_info[cluster] = OrderedDict() - for index, node in enumerate(cls.topo_info[i]): - node_name = 'gluster_node' + str(index + 1) - cls.topology_info[cluster][node_name] = { - 'manage': cls.gluster_servers_info[node]['manage'], - 'storage': cls.gluster_servers_info[node]['storage'], - 'zone': cls.gluster_servers_info[node]['zone'], - 'devices': cls.gluster_servers_info[node]['devices'], - } - - cls.cns_storage_class = (g.config['cns']['dynamic_provisioning'] - ['storage_classes']) - cls.sc = cls.cns_storage_class.get( - 'storage_class1', cls.cns_storage_class.get('file_storage_class')) + + cls.storage_classes = openshift_config['dynamic_provisioning'][ + 'storage_classes'] + cls.sc = cls.storage_classes.get( + 'storage_class1', cls.storage_classes.get('file_storage_class')) cmd = "echo -n %s | base64" % cls.heketi_cli_key ret, out, err = g.run(cls.ocp_master_node[0], cmd, "root") if ret != 0: @@ -89,7 +71,7 @@ class CnsBaseClass(unittest.TestCase): cmd, cls.ocp_master_node[0], out, err)) cls.secret_data_key = out.strip() - cmd = 'oc project %s' % cls.cns_project_name + cmd = 'oc project %s' % cls.storage_project_name ret, out, err = g.run(cls.ocp_client[0], cmd, "root") if ret != 0: raise ExecutionError("failed to execute cmd %s on %s out: " @@ -104,18 +86,18 @@ class CnsBaseClass(unittest.TestCase): g.log.info(msg) def setUp(self): - super(CnsBaseClass, self).setUp() + super(BaseClass, self).setUp() msg = "Starting Test : %s : %s" % (self.id(), self.glustotest_run_id) g.log.info(msg) def tearDown(self): - super(CnsBaseClass, self).tearDown() + super(BaseClass, self).tearDown() msg = "Ending Test: %s : %s" % (self.id(), self.glustotest_run_id) g.log.info(msg) @classmethod def tearDownClass(cls): - super(CnsBaseClass, cls).tearDownClass() + super(BaseClass, cls).tearDownClass() msg = "Teardownclass: %s : %s" % (cls.__name__, cls.glustotest_run_id) g.log.info(msg) @@ -258,31 +240,23 @@ class CnsBaseClass(unittest.TestCase): return dc_name, pod_name -class CnsGlusterBlockBaseClass(CnsBaseClass): - ''' - This class is for setting up glusterblock on CNS - ''' +class GlusterBlockBaseClass(BaseClass): + """Base class for gluster-block test cases.""" + @classmethod def setUpClass(cls): - ''' - Glusterblock setup on CNS - ''' - super(CnsGlusterBlockBaseClass, cls).setUpClass() - cls.sc = cls.cns_storage_class.get( - 'storage_class2', - cls.cns_storage_class.get('block_storage_class')) - - -class PodScalabilityBaseClass(CnsBaseClass): - """ - This class is for setting parameters for scalling pods - """ + """Initialize all the variables necessary for test cases.""" + super(GlusterBlockBaseClass, cls).setUpClass() + cls.sc = cls.storage_classes.get( + 'storage_class2', cls.storage_classes.get('block_storage_class')) + + +class PodScalabilityBaseClass(BaseClass): + """Base class for special set of test cases - POD scalability tests.""" + @classmethod def setUpClass(cls): - """ - Initialize all the variables necessary for scalling setup - """ - + """Initialize all the variables necessary for scalling setup.""" super(PodScalabilityBaseClass, cls).setUpClass() - - cls.scale_info = g.config['scale'] + cls.scale_info = g.config.get( + "cns", g.config.get("openshift"))['scale'] diff --git a/cns-libs/cnslibs/common/heketi_libs.py b/cns-libs/cnslibs/common/heketi_libs.py index 7ac5c6a6..745ab229 100644 --- a/cns-libs/cnslibs/common/heketi_libs.py +++ b/cns-libs/cnslibs/common/heketi_libs.py @@ -1,4 +1,3 @@ -from collections import OrderedDict import datetime import unittest @@ -25,14 +24,16 @@ class HeketiBaseClass(unittest.TestCase): super(HeketiBaseClass, cls).setUpClass() - # Initializes heketi config variables - cls.cns_username = g.config['cns']['setup']['cns_username'] - cls.cns_password = g.config['cns']['setup']['cns_password'] - cls.cns_project_name = g.config['cns']['setup']['cns_project_name'] + # Initializes config variables + openshift_config = g.config.get("cns", g.config.get("openshift")) + cls.storage_project_name = openshift_config.get( + 'storage_project_name', + openshift_config.get('setup', {}).get('cns_project_name')) + cls.ocp_master_nodes = g.config['ocp_servers']['master'].keys() cls.ocp_master_node = cls.ocp_master_nodes[0] - heketi_config = g.config['cns']['heketi_config'] + heketi_config = openshift_config['heketi_config'] cls.heketi_dc_name = heketi_config['heketi_dc_name'] cls.heketi_service_name = heketi_config['heketi_service_name'] cls.heketi_client_node = heketi_config['heketi_client_node'] @@ -41,21 +42,6 @@ class HeketiBaseClass(unittest.TestCase): cls.heketi_cli_key = heketi_config['heketi_cli_key'] cls.gluster_servers = g.config['gluster_servers'].keys() cls.gluster_servers_info = g.config['gluster_servers'] - cls.topo_info = g.config['cns']['trusted_storage_pool_list'] - - # Constructs topology info dictionary - cls.topology_info = OrderedDict() - for i in range(len(cls.topo_info)): - cluster = 'cluster' + str(i + 1) - cls.topology_info[cluster] = OrderedDict() - for index, node in enumerate(cls.topo_info[i]): - node_name = 'gluster_node' + str(index + 1) - cls.topology_info[cluster][node_name] = { - 'manage': cls.gluster_servers_info[node]['manage'], - 'storage': cls.gluster_servers_info[node]['storage'], - 'zone': cls.gluster_servers_info[node]['zone'], - 'devices': cls.gluster_servers_info[node]['devices'], - } # Checks if heketi server is alive if not hello_heketi(cls.heketi_client_node, cls.heketi_server_url): @@ -63,12 +49,8 @@ class HeketiBaseClass(unittest.TestCase): % cls.heketi_server_url) # Switch to the storage project - if not openshift_ops.oc_login( - cls.ocp_master_node, cls.cns_username, cls.cns_password): - raise ExecutionError("Failed to do oc login on node %s" - % cls.ocp_master_node) if not openshift_ops.switch_oc_project( - cls.ocp_master_node, cls.cns_project_name): + cls.ocp_master_node, cls.storage_project_name): raise ExecutionError("Failed to switch oc project on node %s" % cls.ocp_master_node) diff --git a/cns-libs/cnslibs/common/heketi_ops.py b/cns-libs/cnslibs/common/heketi_ops.py index 19729485..c13c8582 100644 --- a/cns-libs/cnslibs/common/heketi_ops.py +++ b/cns-libs/cnslibs/common/heketi_ops.py @@ -18,10 +18,12 @@ def _set_heketi_global_flags(heketi_server_url, **kwargs): secret_arg = "--secret %s" % secret if secret else "" user_arg = "--user %s" % user if user else "" if not user_arg: - heketi_cli_user = g.config['cns']['heketi_config']['heketi_cli_user'] + openshift_config = g.config.get("cns", g.config.get("openshift")) + heketi_cli_user = openshift_config['heketi_config']['heketi_cli_user'] if heketi_cli_user: user_arg = "--user %s" % heketi_cli_user - heketi_cli_key = g.config['cns']['heketi_config']['heketi_cli_key'] + heketi_cli_key = openshift_config[ + 'heketi_config']['heketi_cli_key'] if heketi_cli_key is not None: secret_arg = "--secret '%s'" % heketi_cli_key @@ -69,10 +71,12 @@ def heketi_volume_create(heketi_client_node, heketi_server_url, size, """ if not kwargs.get('user'): - heketi_cli_user = g.config['cns']['heketi_config']['heketi_cli_user'] + openshift_config = g.config.get("cns", g.config.get("openshift")) + heketi_cli_user = openshift_config['heketi_config']['heketi_cli_user'] if heketi_cli_user: kwargs['user'] = heketi_cli_user - heketi_cli_key = g.config['cns']['heketi_config']['heketi_cli_key'] + heketi_cli_key = openshift_config[ + 'heketi_config']['heketi_cli_key'] if heketi_cli_key is not None: kwargs['secret'] = heketi_cli_key diff --git a/cns-libs/cnslibs/common/openshift_ops.py b/cns-libs/cnslibs/common/openshift_ops.py index d9511980..172a3d6a 100644 --- a/cns-libs/cnslibs/common/openshift_ops.py +++ b/cns-libs/cnslibs/common/openshift_ops.py @@ -133,30 +133,6 @@ def get_amount_of_gluster_nodes(ocp_node): "Haven't found neither Gluster PODs nor Gluster nodes.") -def oc_login(ocp_node, username, password): - """Login to ocp master node. - - Args: - ocp_node (str): Node in which ocp command will be executed. - username (str): username of ocp master node to login. - password (str): password of ocp master node to login. - - Returns: - bool : True on successful login to ocp master node. - False otherwise - - Example: - oc_login(ocp_node, "test","test") - """ - - cmd = "oc login --username=%s --password=%s" % (username, password) - ret, _, _ = g.run(ocp_node, cmd) - if ret != 0: - g.log.error("Failed to login to ocp master node %s" % ocp_node) - return False - return True - - def switch_oc_project(ocp_node, project_name): """Switch to the given project. diff --git a/tests/cns_tests_sample_config.yml b/tests/cns_tests_sample_config.yml index 07ed23eb..1bfcf8fb 100644 --- a/tests/cns_tests_sample_config.yml +++ b/tests/cns_tests_sample_config.yml @@ -2,20 +2,16 @@ # This section has to be defined. ocp_servers: master: - master_node1: - hostname: master_node1 - master_node2: - hostname: master_node2 + master_node1_ip: + hostname: master_node1_hostname client: - client_node1: - hostname: client_node1 - client_node2: - hostname: client_node2 + client_node1_ip: + hostname: client_node1_hostname nodes: - ocp_node1: - hostname: ocp_node1 - ocp_node2: - hostname: ocp_node2 + ocp_node1_ip: + hostname: ocp_node1_hostname + ocp_node2_ip: + hostname: ocp_node2_hostname # 'gluster_servers' section covers the details of the nodes where gluster # servers are run. In the case of CNS, these are the nodes where gluster @@ -23,60 +19,53 @@ ocp_servers: # servers are configured. # This section has to be defined. gluster_servers: - gluster_server1: - manage: gluster_server1 - storage: gluster_server1 - zone: 1 - devices: [device1, device2] + gluster_server1_ip: + manage: gluster_server1_hostname + storage: gluster_server1_ip + # 'additional_devices' option is used for couple of test cases + # which test Heketi device "add" operation. additional_devices: [device3, device4] - gluster_server2: - manage: gluster_server2 - storage: gluster_server2 - zone : 2 - devices: [device1, device2] + gluster_server2_ip: + manage: gluster_server2_hostname + storage: gluster_server2_ip additional_devices: [device3, device4] -cns: - setup: - cns_project_name: "storage-project" - cns_username: "test-admin" - cns_password: - trusted_storage_pool_list: - - [gluster_server1, gluster_server2] +openshift: + storage_project_name: "" heketi_config: - heketi_dc_name: "fake-name-of-heketi-deployment-config" - heketi_service_name: "fake-name-of-heketi-service" - heketi_client_node: - heketi_server_url: "http://heketi-storage-project.cloudapps.mystorage.com" - heketi_cli_user: "admin" - heketi_cli_key: "admin" + heketi_dc_name: "" + heketi_service_name: "" + heketi_client_node: "" + heketi_server_url: "" + heketi_cli_user: "" + heketi_cli_key: "" dynamic_provisioning: storage_classes: file_storage_class: provisioner: "kubernetes.io/glusterfs" - resturl: - restuser: + resturl: "" + restuser: "" secretnamespace: "" - volumenameprefix: "cns-vol" + volumenameprefix: "autotests-file" block_storage_class: provisioner: "gluster.org/glusterblock" - resturl: - restuser: + resturl: "" + restuser: "" restsecretnamespace: "" hacount: "3" chapauthenabled: "true" - volumenameprefix: "cns-vol" -scale: - - type: jenkins - instances: 1 - namespace: "" - pod_parameters: - ENABLE_OAUTH: false - MEMORY_LIMIT: "Mi" - VOLUME_CAPACITY: "Gi" - STORAGE_CLASS_NAME: "fake-name-of-storage-class" - JENKINS_IMAGE_STREAM_TAG: "jenkins:2" - load_parameters: - JOBS: 30 - ITERATIONS: 30 - EXECUTORS: 5 + volumenameprefix: "autotests-block" + scale: + - type: jenkins + instances: 1 + namespace: "" + pod_parameters: + ENABLE_OAUTH: false + MEMORY_LIMIT: "Mi" + VOLUME_CAPACITY: "Gi" + STORAGE_CLASS_NAME: "fake-name-of-storage-class" + JENKINS_IMAGE_STREAM_TAG: "jenkins:2" + load_parameters: + JOBS: 30 + ITERATIONS: 30 + EXECUTORS: 5 diff --git a/tests/functional/common/arbiter/test_arbiter.py b/tests/functional/common/arbiter/test_arbiter.py index c445103f..4a0853b3 100644 --- a/tests/functional/common/arbiter/test_arbiter.py +++ b/tests/functional/common/arbiter/test_arbiter.py @@ -17,20 +17,15 @@ from cnslibs.common.openshift_ops import ( @ddt.ddt -class TestArbiterVolumeCreateExpandDelete(cns_baseclass.CnsBaseClass): +class TestArbiterVolumeCreateExpandDelete(cns_baseclass.BaseClass): def setUp(self): super(TestArbiterVolumeCreateExpandDelete, self).setUp() - self.node = self.ocp_master_node[0] - self.sc = self.cns_storage_class.get( - 'storage_class1', self.cns_storage_class.get('file_storage_class')) # Mark one of the Heketi nodes as arbiter-supported if none of # existent nodes or devices already enabled to support it. - self.heketi_server_url = self.cns_storage_class.get( - 'storage_class1', - self.cns_storage_class.get('file_storage_class'))['resturl'] + self.heketi_server_url = self.sc.get('resturl') arbiter_tags = ('required', 'supported') arbiter_already_supported = False diff --git a/tests/functional/common/gluster_block/test_restart_gluster_block.py b/tests/functional/common/gluster_block/test_restart_gluster_block.py index aa2b1e62..b2d74d92 100644 --- a/tests/functional/common/gluster_block/test_restart_gluster_block.py +++ b/tests/functional/common/gluster_block/test_restart_gluster_block.py @@ -23,9 +23,8 @@ class TestRestartGlusterBlockPod(HeketiBaseClass): self.addCleanup(heketi_blockvolume_delete, self.heketi_client_node, self.heketi_server_url, vol_info['id']) - dc_name = ("glusterblock-%s-provisioner-dc" - % self.cns_project_name) # restart gluster-block-provisioner-pod + dc_name = "glusterblock-%s-provisioner-dc" % self.storage_project_name pod_name = get_pod_name_from_dc(self.ocp_master_node, dc_name) oc_delete(self.ocp_master_node, 'pod', pod_name) wait_for_resource_absence(self.ocp_master_node, 'pod', pod_name) diff --git a/tests/functional/common/gluster_stability/test_gluster_services_restart.py b/tests/functional/common/gluster_stability/test_gluster_services_restart.py index 82511900..db80b6a4 100644 --- a/tests/functional/common/gluster_stability/test_gluster_services_restart.py +++ b/tests/functional/common/gluster_stability/test_gluster_services_restart.py @@ -34,7 +34,7 @@ from cnslibs.common.gluster_ops import ( restart_brick_process, wait_to_heal_complete ) -from cnslibs.cns.cns_baseclass import CnsBaseClass +from cnslibs.cns.cns_baseclass import BaseClass from cnslibs.common import podcmd HEKETI_BLOCK_VOLUME_REGEX = "^Id:(.*).Cluster:(.*).Name:%s_(.*)$" @@ -45,7 +45,7 @@ SERVICE_TCMU = "tcmu-runner" @ddt.ddt -class GlusterStabilityTestSetup(CnsBaseClass): +class GlusterStabilityTestSetup(BaseClass): """class for gluster stability (restarts different servces) testcases TC No's: CNS-1393, CNS-1394, CNS-1395 """ @@ -62,13 +62,13 @@ class GlusterStabilityTestSetup(CnsBaseClass): # which uses time and date of test case self.prefix = "autotest-%s" % (self.glustotest_run_id.replace("_", "")) - _cns_storage_class = self.cns_storage_class.get( + _storage_class = self.storage_classes.get( 'storage_class2', - self.cns_storage_class.get('block_storage_class')) - self.provisioner = _cns_storage_class["provisioner"] - self.restsecretnamespace = _cns_storage_class["restsecretnamespace"] - self.restuser = _cns_storage_class["restuser"] - self.resturl = _cns_storage_class["resturl"] + self.storage_classes.get('block_storage_class')) + self.provisioner = _storage_class["provisioner"] + self.restsecretnamespace = _storage_class["restsecretnamespace"] + self.restuser = _storage_class["restuser"] + self.resturl = _storage_class["resturl"] # using pvc size count as 1 by default self.pvcsize = 1 diff --git a/tests/functional/common/provisioning/test_dynamic_provisioning_block_p0_cases.py b/tests/functional/common/provisioning/test_dynamic_provisioning_block_p0_cases.py index 5edbdc50..11edf4ba 100644 --- a/tests/functional/common/provisioning/test_dynamic_provisioning_block_p0_cases.py +++ b/tests/functional/common/provisioning/test_dynamic_provisioning_block_p0_cases.py @@ -1,7 +1,7 @@ import time from unittest import skip -from cnslibs.cns.cns_baseclass import CnsGlusterBlockBaseClass +from cnslibs.cns.cns_baseclass import GlusterBlockBaseClass from cnslibs.common.exceptions import ExecutionError from cnslibs.common.openshift_ops import ( get_gluster_pod_names_by_pvc_name, @@ -25,7 +25,7 @@ from cnslibs.common.waiter import Waiter from glusto.core import Glusto as g -class TestDynamicProvisioningBlockP0(CnsGlusterBlockBaseClass): +class TestDynamicProvisioningBlockP0(GlusterBlockBaseClass): ''' Class that contain P0 dynamic provisioning test cases for block volume @@ -84,9 +84,9 @@ class TestDynamicProvisioningBlockP0(CnsGlusterBlockBaseClass): # Remove Heketi pod heketi_down_cmd = "oc scale --replicas=0 dc/%s --namespace %s" % ( - self.heketi_dc_name, self.cns_project_name) + self.heketi_dc_name, self.storage_project_name) heketi_up_cmd = "oc scale --replicas=1 dc/%s --namespace %s" % ( - self.heketi_dc_name, self.cns_project_name) + self.heketi_dc_name, self.storage_project_name) self.addCleanup(self.cmd_run, heketi_up_cmd) heketi_pod_name = get_pod_name_from_dc( self.node, self.heketi_dc_name, timeout=10, wait_step=3) @@ -228,7 +228,7 @@ class TestDynamicProvisioningBlockP0(CnsGlusterBlockBaseClass): scale_dc_pod_amount_and_wait(self.ocp_client[0], self.heketi_dc_name, 0, - self.cns_project_name) + self.storage_project_name) try: # delete pvc for pvc in self.pvc_name_list: @@ -243,7 +243,7 @@ class TestDynamicProvisioningBlockP0(CnsGlusterBlockBaseClass): scale_dc_pod_amount_and_wait(self.ocp_client[0], self.heketi_dc_name, 1, - self.cns_project_name) + self.storage_project_name) # verify PVC's are deleted for pvc in self.pvc_name_list: diff --git a/tests/functional/common/provisioning/test_dynamic_provisioning_p0_cases.py b/tests/functional/common/provisioning/test_dynamic_provisioning_p0_cases.py index ebc33665..07be5e53 100644 --- a/tests/functional/common/provisioning/test_dynamic_provisioning_p0_cases.py +++ b/tests/functional/common/provisioning/test_dynamic_provisioning_p0_cases.py @@ -1,7 +1,7 @@ import time from unittest import skip -from cnslibs.cns.cns_baseclass import CnsBaseClass +from cnslibs.cns.cns_baseclass import BaseClass from cnslibs.common.exceptions import ExecutionError from cnslibs.common.heketi_ops import ( verify_volume_name_prefix) @@ -31,7 +31,7 @@ from cnslibs.common.waiter import Waiter from glusto.core import Glusto as g -class TestDynamicProvisioningP0(CnsBaseClass): +class TestDynamicProvisioningP0(BaseClass): ''' Class that contain P0 dynamic provisioning test cases for glusterfile volume @@ -116,9 +116,9 @@ class TestDynamicProvisioningP0(CnsBaseClass): # Remove Heketi pod heketi_down_cmd = "oc scale --replicas=0 dc/%s --namespace %s" % ( - self.heketi_dc_name, self.cns_project_name) + self.heketi_dc_name, self.storage_project_name) heketi_up_cmd = "oc scale --replicas=1 dc/%s --namespace %s" % ( - self.heketi_dc_name, self.cns_project_name) + self.heketi_dc_name, self.storage_project_name) self.addCleanup(self.cmd_run, heketi_up_cmd) heketi_pod_name = get_pod_name_from_dc( self.node, self.heketi_dc_name, timeout=10, wait_step=3) @@ -281,7 +281,7 @@ class TestDynamicProvisioningP0(CnsBaseClass): scale_dc_pod_amount_and_wait(self.ocp_client[0], self.heketi_dc_name, 0, - self.cns_project_name) + self.storage_project_name) try: # delete pvc for pvc in self.pvc_name_list: @@ -296,7 +296,7 @@ class TestDynamicProvisioningP0(CnsBaseClass): scale_dc_pod_amount_and_wait(self.ocp_client[0], self.heketi_dc_name, 1, - self.cns_project_name) + self.storage_project_name) # verify PVC's are deleted for pvc in self.pvc_name_list: diff --git a/tests/functional/common/provisioning/test_pv_resize.py b/tests/functional/common/provisioning/test_pv_resize.py index 41f5e113..52a5915f 100644 --- a/tests/functional/common/provisioning/test_pv_resize.py +++ b/tests/functional/common/provisioning/test_pv_resize.py @@ -16,13 +16,13 @@ from cnslibs.common.openshift_ops import ( wait_for_pod_be_ready, wait_for_resource_absence) from cnslibs.common.openshift_version import get_openshift_version -from cnslibs.cns.cns_baseclass import CnsBaseClass +from cnslibs.cns.cns_baseclass import BaseClass from cnslibs.common.exceptions import ExecutionError from glusto.core import Glusto as g @ddt.ddt -class TestPvResizeClass(CnsBaseClass): +class TestPvResizeClass(BaseClass): """Test cases for PV resize.""" @classmethod diff --git a/tests/functional/common/provisioning/test_storage_class_cases.py b/tests/functional/common/provisioning/test_storage_class_cases.py index 027bd0f2..8fd001dd 100644 --- a/tests/functional/common/provisioning/test_storage_class_cases.py +++ b/tests/functional/common/provisioning/test_storage_class_cases.py @@ -22,7 +22,7 @@ from cnslibs.common.openshift_ops import ( @ddt.ddt -class TestStorageClassCases(cns_baseclass.CnsBaseClass): +class TestStorageClassCases(cns_baseclass.BaseClass): def create_sc_with_parameter(self, vol_type, success=False, parameter={}): """creates storage class, pvc and validates event @@ -34,9 +34,9 @@ class TestStorageClassCases(cns_baseclass.CnsBaseClass): parameter (dict): dictionary with storage class parameters """ if vol_type == "glusterfile": - sc = self.cns_storage_class.get( + sc = self.storage_classes.get( 'storage_class1', - self.cns_storage_class.get('file_storage_class')) + self.storage_classes.get('file_storage_class')) # Create secret file for usage in storage class self.secret_name = oc_create_secret( @@ -52,9 +52,9 @@ class TestStorageClassCases(cns_baseclass.CnsBaseClass): "volumetype": "replicate:3" } elif vol_type == "glusterblock": - sc = self.cns_storage_class.get( + sc = self.storage_classes.get( 'storage_class2', - self.cns_storage_class.get('block_storage_class')) + self.storage_classes.get('block_storage_class')) # Create secret file for usage in storage class self.secret_name = oc_create_secret( diff --git a/tests/functional/common/test_node_restart.py b/tests/functional/common/test_node_restart.py index 99f3ee67..02272321 100644 --- a/tests/functional/common/test_node_restart.py +++ b/tests/functional/common/test_node_restart.py @@ -2,7 +2,7 @@ import time from unittest import skip -from cnslibs.cns.cns_baseclass import CnsBaseClass +from cnslibs.cns.cns_baseclass import BaseClass from cnslibs.common.openshift_ops import ( check_service_status, get_ocp_gluster_pod_names, @@ -13,7 +13,7 @@ from cnslibs.common.exceptions import ExecutionError from glusto.core import Glusto as g -class TestNodeRestart(CnsBaseClass): +class TestNodeRestart(BaseClass): def setUp(self): super(TestNodeRestart, self).setUp() -- cgit