summaryrefslogtreecommitdiffstats
path: root/cns-libs
Commit message (Collapse)AuthorAgeFilesLines
* Fix error messages in wait_for_pod_be_ready and enable_pvc_resize funcsValerii Ponomarov2019-03-122-3/+4
| | | | | | | "wait_for_pod_be_ready" and "enable_pvc_resize" hide errors details when errors appear. So, fix it by printing full error info. Change-Id: I250ff723c0453fd487f8c1810cdd2c1d7d2ec16f
* Add TCs creating block-PVCs and app pods changing node scheduling policynigoyal2019-03-062-3/+149
| | | | | | | Add 2 test cases, where one verifies creation of an app pod on the Gluster node and another on the separate node Change-Id: I99dfc5db7fa74d0f69115cfed470f72e66b1a256
* Fix error message in 'cmd_run_on_gluster_pod_or_node' functionValerii Ponomarov2019-02-281-7/+10
| | | | | | | In case of error on CRS node we get incorrect error message. Instead of command error we get another kind of an error. Change-Id: Ibfd21d518c220951a981f23daa5d32b1963061f2
* Merged HeketiBaseClass to BaseClassvamahaja2019-02-224-373/+255
| | | | | | | | | | | Renamed cns_baseclass.py to baseclass.py with updated BaseClass. Merged HeketiBaseClass to BaseClass with appropriate changes. Updated delete_volumes and delete_block_volumes methods used in test case method with heketi_delete_volume and heketi_blockvolume- delete. Change-Id: I8f623f1692cd863dc8ff041f7e8525ee0dc84f7b Signed-off-by: vamahaja <vamahaja@redhat.com>
* Add server package support to the heketi_version.py moduleValerii Ponomarov2019-02-211-13/+103
| | | | | | | | | | | | | Before, 'heketi_version.py' module didn't consider version of the 'heketi server' package on the Heketi POD. But it is more valueable than depend on the client only. So, make all the requested version comparisons be applied to the server's version. Interaction with the module's logic stays the same, just one behavioral thing changes: now, if client version is older than server's one, we raise exception. Change-Id: I317102556d4a5f51607c3b9da93da0d4a3b74f7f
* Add CRS support to the 'restart gluster services' test casesValerii Ponomarov2019-02-082-198/+159
| | | | Change-Id: I40b7ea79d1f7dbc82db825f6ced4447a157361e6
* Add possibility to skip test cases and cleanups after failureValerii Ponomarov2019-02-053-4/+69
| | | | | | | | | | | | | In some cases, it is useful to stop test execution after first failure. Not only stop it, but also skip all the scheduled cleanups. It will allow us to keep a cluster in the best state for a root cause debugging. Just define 'common.stop_on_first_failure' option to True value in the config file. It will make the test runner stop after first failure skipping all the scheduled cleanups and pending test cases. Change-Id: I963eb038a11a8e2088a84f7ba4838870ea3e657a
* Add Heketi version checksnigoyal2019-02-041-0/+21
| | | | | | | | | Add Heketi version checks to the test cases and Heketi libraries. In case of incompatible Heketi version in a setup, test cases will be skipped and direct usage of Heketi libraries will cause them to raise the NotImplementedError exceptions. Change-Id: I462e76f615165140f2a8c7e796c1c582b8f4dc91
* adding library and test case for examine glusternigoyal2019-02-011-0/+38
| | | | | | | | This library is helpfull for diagnosing output of gluster and heketi and it compare both the outputs and the test case verify this feature is working properly. Change-Id: Ice607003f32db2bce2f540a7651024b66b071634
* Add 'heketi_version.py' moduleValerii Ponomarov2019-01-301-0/+156
| | | | | | To be able to perform safe Heketi client package version comparisons. Change-Id: I64f0a55f988fc1446b133556c395f0640d65ada1
* Add time limit for curl commandsValerii Ponomarov2019-01-251-2/+2
| | | | | | | | In case of network problems, "curl" command may stuck in a retry-loop. So, add explicit time-limit as 10 seconds to avoid endless waiting of the functions which use it. Change-Id: Ia2d94358e8f978cb73360535167c703da2636874
* Merge "Fix 'verify_arbiter_brick_able_to_contain_expected_amount_of_files' tc"Valerii Ponomarov2019-01-101-8/+40
|\
| * Fix 'verify_arbiter_brick_able_to_contain_expected_amount_of_files' tcValerii Ponomarov2019-01-081-8/+40
| | | | | | | | | | | | | | | | | | This test case talks to the Gluster PODs directly. It is not compatible with Standalone Gluster clusters. So, fix this test by reusing special common function, which allows us to abstract from Gluster cluster deployment type. Change-Id: Ib131984ac0a4623d1d847f9961be26da573d8513
* | Merge "Removed jenkins scaling code"Valerii Ponomarov2019-01-1012-792/+0
|\ \ | |/ |/|
| * Removed jenkins scaling codevamahaja2019-01-0912-792/+0
| | | | | | | | | | | | | | | | | | | | | | | | Removing this code as it is in additional library file, requires to pass config through config file and requires to upload the scripts. Also it contains hardcoded credentials. Will add new function in openshift_ops.py library similar to "oc_create_app_dc_with_io" with new updated template. Change-Id: I7cfce3fe23b222d40bff1c829afa97f2ffcb621d Signed-off-by: vamahaja <vamahaja@redhat.com>
* | Fix setting of gluster volume options in "heketi_volume_create" funcSri Vignesh2019-01-081-3/+3
|/ | | | | | | | "heketi-cli" requires quotes for "--gluster-volume-options" arg. Without it command will fail. So, add missing quotes to make it work. Change-Id: I17fddfe653dceaa3c6b56f2a473ca7798de02698 Signed-off-by: Sri Vignesh <sselvan@redhat.com>
* Add events info for 'verify_pvc_status_is_bound' common funcValerii Ponomarov2018-12-261-5/+9
| | | | | | | | | | | For the moment, we write events of failed PVC only to glusto logs. And only info of one type of events - 'ProvisioningFailed'. But in case of CI, it is not really suitable. We need to have info in the exception message. So, add all the pvc-related events to the message of raised exception when PVC fails to reach the "Bound" state. Change-Id: I60e3b9a86acdf251d282059cd2e494c70ae07c70
* Refactor config optionsValerii Ponomarov2018-12-254-121/+57
| | | | | | | | | | | | | | | | | | | 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
* Add abstraction between deployment types and gluster commandsValerii Ponomarov2018-12-254-118/+30
| | | | | | | | | | | | | | | | | | | | | | | | Now, it is possible to run glustolibs commands on both deployment types: containerized and standalone. It is possible using 'auto_get_gluster_endpoint' as target for lib function in addition to the '@podcmd.GlustoPod()' decorator. Example: """ from glustolibs.gluster.volume_ops import get_volume_list from cnslibs.common import heketi_libs from cnslibs.common import podcmd class TestExample(heketi_libs.HeketiBaseClass): @podcmd.GlustoPod() def test_get_vol_list_either_on_node_or_on_pod(self): volumes = get_volume_list('auto_get_gluster_endpoint') """ Also, delete all the current usages of 'deployment_type' config option, and delete the option as unneeded anymore. Change-Id: I281f287c432a5a9efefda588be436ee285188697
* Cleanup heketi config optionsValerii Ponomarov2018-12-192-13/+0
| | | | | | | Removing several unused options and replacing couple of them with built-in values. Change-Id: I458f0eae6a68ddcb2711d454c81cdcee8142673a
* Merge "Add 'openshift_version.py' module"Valerii Ponomarov2018-12-193-35/+179
|\
| * Add 'openshift_version.py' moduleValerii Ponomarov2018-12-173-35/+179
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | With growth of amount of test cases and supported OpenShift versions we need to perform more and more version comparisons. So, this module is designed to ease such operations. Usage example: from cnslibs.common import openshift_version version = openshift_version.get_openshift_version() if '3.9' < version <= '3.11': # Do stuff for OpenShift 3.11 or 3.10 elif version <= '3.9': # Do stuff for OpenShift 3.9 or lower else: # Do stuff for higher versions than 3.11 Also, reuse it in all the existing places with version comparisons. Change-Id: Ibc27eff20ed0dff80deca73d5d156e23bda57439
* | [CNS-451]: Test to verify volumes post node rebootSaravanakumar Arumugam2018-12-192-4/+8
|/ | | | | | Change-Id: I2fc6f2ee9dd0c38519ab560e9d1c1a9672940843 Signed-off-by: Saravanakumar Arumugam <sarumuga@redhat.com> Signed-off-by: vamahaja <vamahaja@redhat.com>
* Merge "Make 'test_storage_class_cases' module support standalone Gluster"Valerii Ponomarov2018-12-171-3/+25
|\
| * Make 'test_storage_class_cases' module support standalone GlusterValerii Ponomarov2018-12-101-3/+25
| | | | | | | | | | | | | | | | | | | | By doing following updates: - Add and reuse lib function which calculates amount of Gluster PODs or Gluster nodes. - Make 'get_gluster_blockvol_info_by_pvc_name' lib func support standalonge Gluster clusters in addition to the 'containerized' ones. Change-Id: I6a12bb4c30b1e6f8698a614abefc248149773302
* | Rework 'heketi_ops' moduleValerii Ponomarov2018-12-162-1558/+635
| | | | | | | | | | | | | | | | | | | | | | | | Doing following: - Remove dead code with usage of Heketi python lib. Because it is not used and not tested. - Remove unused functions in general. - Make existing functions raise exceptions with CLI error message instead of returning 'False' boolean value hiding info about original errors. Change-Id: I1f0def567dd77425397ff2c8ba13f9c0640af5bc
* | Cleanup unused library functionsValerii Ponomarov2018-12-153-568/+9
| | | | | | | | Change-Id: I8b62298b45f9e6af45dde60aae6c80c79d312dad
* | Cleanup base classesValerii Ponomarov2018-12-151-223/+2
| | | | | | | | | | | | Remove unused/dead code from base classes. Change-Id: Ib355e0282541c60297c1b240f7ff8df3f06d9d69
* | Delete unused files and dirsValerii Ponomarov2018-12-106-310/+0
|/ | | | | | | | This project has lots of empty files and dirs in addition to not usef files. So, remove all of it to improve navigation through the project. Change-Id: Ib8df2165640e0c59fcee9bb6909ec8c74cb9623f
* [CNS-1314][CNS-1285] Restart gluster block volumes and validatevamahaja2018-12-103-47/+342
| | | | | Change-Id: Ib7e3125e5120a91fe431816b33be4d4e6f15078e Signed-off-by: vamahaja <vamahaja@redhat.com>
* Add cmd-runner function which is gluster deployment type agnosticValerii Ponomarov2018-12-071-7/+30
| | | | | | | | | | | | | | For the moment, most of the test cases and lib functions in 'openshift_ops' python module support only containerized Gluster clusters. So, to be able to support standalone Gluster clusters in addition to the containerized ones, add special function which allows us to run shell commands on both types of Gluster clusters autodetecting the type. As an example, update one of the existing lib functions making all the existing 'arbiter' test cases work in both cases. Change-Id: Iad69d7dc692c87eb70ed5caf780cb688f274bf02
* Move functions with creation of SC, PVC and POD objects to common placeValerii Ponomarov2018-12-051-1/+151
| | | | | | | Removing duplication of code. Also, reuse it in places where it is already duplicated. Change-Id: I2f88b4921cb7bec01d17e1ddeaeda16e0d198493
* [CNS-928] Create PVC using default Storage ClassValerii Ponomarov2018-11-291-7/+8
| | | | | | | We should be able to create PVC not specifying Storage Class, but having 'default' one. So, add test to cover such feature. Change-Id: Id1d6f14879bbc4af4955af4984ce91c2484fb55f
* Cleanup and improve configurationValerii Ponomarov2018-11-271-8/+0
| | | | | | | | | | | | | | | | | Our config file has dead options as well as unintuitive option names. So, do following improvements: - Delete unused config options from config file example. - Delete setting of dead config options to the base class. - Rename 'storage_class1' and 'storage_class2' config option groups to the 'file_storage_class' and 'block_storage_class' respectively to make it more understandable. - Remove 'secrets' config option group as redundant. Secret names get calculated from custom prefix and randomly generated string. Namespace is used the same as for storage classes. And its 'type' was always storage class's provisioner value. Change-Id: Ifa6d0ab430e8d69591f49bc7bf4c258151662550
* Fix pep8 W605 rule violationValerii Ponomarov2018-11-192-56/+18
| | | | | | | | | | Now, string objects, which contain backslash symbol, should be prefixed with 'r' letter which transforms it to 'raw string literal'. Info: https://docs.python.org/3/whatsnew/3.6.html#deprecated-python-behavior Change-Id: I8d5c1c1c022cae9d163dea2e0613c9ca24ddad08
* Merge "Make 'wait_for_resource_absence' provide more details when fails"Valerii Ponomarov2018-11-191-4/+23
|\
| * Make 'wait_for_resource_absence' provide more details when failsValerii Ponomarov2018-11-191-4/+23
| | | | | | | | | | | | | | | | | | | | In case we get error when resource is not deleted in time, we do not have valueable info for debugging in its output. So, add safe approach for getting more data such as resource info and list of it's events. Also, increase default timeout from 2 to 5 minutes and reduce wait step from 10 to 5 seconds. Change-Id: I99b9946fd0ff13f4b307b28125667ceca98d32c3
* | Make waiter function be py2/3 compatibleValerii Ponomarov2018-11-191-0/+3
|/ | | | | | | | The special py2's method for iterators called 'next' was renamed to '__next__' in py3. So, add second attr, which is required by py3. Change-Id: Ie3a1d354614f8bab5c2b8d19363d6936fc56e0b2
* Remove skip of CNS-584 tcnigoyal2018-11-141-1/+12
| | | | | | | | | | | | Stop skipping CNS-584 tc with reference to the BZ-1644696 bug. Instead, add possibility to avoid this "blocker" bug, which is not the point of test. The reason is that in kube 3.11 we have "synchronous" delete operation by default. But we did have it as "async" in all the previous kube versions. So, add possibility to distinguish kube versions adding additional "--wait=false" option in kube 1.11+ versions. Change-Id: Ie92abcf4b67f7237092d62b7e8aa180d9877853c
* Merge "Add test cases for gluster-block"Valerii Ponomarov2018-11-061-1/+20
|\
| * Add test cases for gluster-blockAshmitha Ambastha2018-11-071-1/+20
| | | | | | | | | | Change-Id: I5ce399b39201dfb09d4ad459a039d938596a71e4 Signed-off-by: Ashmitha <asambast@redhat.com>
* | test cases for heketi metricsnigoyal2018-11-063-1/+57
| | | | | | | | | | | | | | | | | | | | CNS-1243 - Heketi_metrics_generate CNS-1244 - Heketi_metrics_validating_VolumeCount_on_creation CNS-1245 - Heketi_metrics_validating_VolumeCount_on_deletion CNS-1262 - Heketi-metrics_validating_heketi_pod failure Change-Id: Idb863d1ceaf555dfc2a9cff863b97cda65a816f6 Signed-off-by: nigoyal <nigoyal@redhat.com>
* | [CNS-584] [CNS-1390] test cases for glusterfsnigoyal2018-11-062-4/+9
| | | | | | | | | | | | | | | | | | | | | | CNS-584 Verify PVC deletion while pod is running This test case is verifying the glusterfs pvc deletion while pod is running and expectation is that pvc should not delete CNS-1390 - Retain policy - glusterfs - delete pvc This test case is verifying the retain policy of pvc and expectation is that when we delete pvc pv should not get deleted. Change-Id: Idefa36afdd8bc80835631863370273b4c86bccfc
* | [CNS-1393-1395] Restart gluster services then validate volumesvamahaja2018-11-053-3/+208
| | | | | | | | | | Change-Id: I58f8628c352556ac30c31777707b52cc2aea48ac Signed-off-by: vamahaja <vamahaja@redhat.com>
* | [CNS-574] Attach PVC to multiple app PODsValerii Ponomarov2018-11-021-69/+56
|/ | | | | | | Make sure we are able to attach file-volumes to several application PODs at once. Change-Id: If53e75d6de51f05e47e3f936ba62996b05a833c6
* Merge "[CNS-544][CNS-545] Added test cases for storage class parameters"Valerii Ponomarov2018-11-022-3/+46
|\
| * [CNS-544][CNS-545] Added test cases for storage class parametersvamahaja2018-11-022-3/+46
| | | | | | | | | | Change-Id: Iae63d250d4e0277ee7559e73df6114faf918c283 Signed-off-by: vamahaja <vamahaja@redhat.com>
* | CNS: adding testcase CNS-450 - Restart heketi podApeksha D Khakharia2018-10-312-1/+3
|/ | | | | Change-Id: Ie68628cb0f083fd5cd1ec9cd88a4c490bfca2e88 Signed-off-by: Apeksha D Khakharia <akhakhar@redhat.com>
* [CNS-1040] Resize PVC exceeding available free spaceValerii Ponomarov2018-10-241-0/+68
| | | | | | | Make sure that after failed attempt of PVC resize application POD continues to work and we are able to write data. Change-Id: I1dda1e4698ca4e569aa67740c2e9a5dca9a4e7bf
* CNS-439: adding heketi_down_pvc_delete caseApeksha D Khakharia2018-10-241-4/+8
| | | | | Change-Id: Id3b679cf3193b36bfd10fc498fb0ba930c5d2536 Signed-off-by: Apeksha D Khakharia <akhakhar@redhat.com>