diff options
author | Valerii Ponomarov <vponomar@redhat.com> | 2018-12-25 21:09:09 +0530 |
---|---|---|
committer | Valerii Ponomarov <vponomar@redhat.com> | 2018-12-25 23:20:48 +0530 |
commit | a118c991bfd5368aee517cc26188b1e3fee82d1f (patch) | |
tree | a4f966c1ce2fa649b6081d9c08b11028ec23a052 /tests | |
parent | 8b6107b62dacf5edc264f4f0206771d8fa07f7bf (diff) |
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
Diffstat (limited to 'tests')
9 files changed, 76 insertions, 93 deletions
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: "<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: "<fake-name-of-heketi-deployment-config>" + heketi_service_name: "<fake-name-of-heketi-service>" + heketi_client_node: "<node-ip-with-heketi-client>" + heketi_server_url: "<fake-heketi-server-url>" + heketi_cli_user: "<fake-heketi-cli-user>" + heketi_cli_key: "<fake-heketi-cli-secret>" dynamic_provisioning: storage_classes: file_storage_class: provisioner: "kubernetes.io/glusterfs" - resturl: - restuser: + resturl: "<fake-url>" + restuser: "<fake-user>" secretnamespace: "<fake-namespace-name>" - volumenameprefix: "cns-vol" + volumenameprefix: "autotests-file" block_storage_class: provisioner: "gluster.org/glusterblock" - resturl: - restuser: + resturl: "<fake-url>" + restuser: "<fake-user>" restsecretnamespace: "<fake-namespace-name>" hacount: "3" chapauthenabled: "true" - volumenameprefix: "cns-vol" -scale: - - type: jenkins - instances: 1 - namespace: "<fake-namespace-name>" - pod_parameters: - ENABLE_OAUTH: false - MEMORY_LIMIT: "<fake-memory-limit-size>Mi" - VOLUME_CAPACITY: "<fake-size-of-gluster-storage>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: "<fake-namespace-name>" + pod_parameters: + ENABLE_OAUTH: false + MEMORY_LIMIT: "<fake-memory-limit-size>Mi" + VOLUME_CAPACITY: "<fake-size-of-gluster-storage>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() |