summaryrefslogtreecommitdiffstats
path: root/openshift-storage-libs/openshiftstoragelibs/openshift_ops.py
Commit message (Collapse)AuthorAgeFilesLines
* [Test] Add TC's to validate elasticsearch pod respinArun Kumar2020-12-111-2/+7
| | | | | Change-Id: I2c969b67bb30666a0616919ced39653d9166ef38 Signed-off-by: Arun Kumar <arukumar@redhat.com>
* [Lib] Add lib is_job_completeNitin Goyal2020-12-081-0/+20
| | | | | | | Lib will check the job completion status Change-Id: Ifbcdc9f18e4d3af5b290982eb4a084459877f91b Signed-off-by: Nitin Goyal <nigoyal@redhat.com>
* [Lib] Add lib oc_create_offline_block_volume_expand_jobNitin Goyal2020-12-081-0/+85
| | | | | | | The lib will create a k8s JOB for expanding block PVC. Change-Id: I18b4f45b30c7541e90bfcb13bf819b1542560ba8 Signed-off-by: Nitin Goyal <nigoyal@redhat.com>
* [TestFix] Add config to read i/o imagesvamahaja2020-12-081-24/+5
| | | | | | Add support to pass I/O image from config file Change-Id: I2c943ba0efaeab3a44eef63030965f36f8086c1b
* [LibFix] Add parameter to lib 'oc_delete' to check resource presenceSushil Gupta2020-12-031-2/+5
| | | | | Change-Id: I3382f9c52013a58f038f28b1c3d64a82ece813f6 Signed-off-by: Sushil Gupta <susgupta@redhat.com>
* [Test] Add TC to perform post deployment validations of prometheusArun Kumar2020-09-281-10/+25
| | | | | Change-Id: I026f2aa944aaa6b338c45c54ac4504ecb854f00c Signed-off-by: Arun Kumar <arukumar@redhat.com>
* [Test] Add TC fill arbiter brick, shutdown data brick node and run ioArun Kumar2020-07-061-16/+43
| | | | | Change-Id: I36d44123db24154fe0aefc905ad2f5a5e5061558 Signed-off-by: Arun Kumar <aanand01762@gmail.com>
* [LibFix] Add 'collect_logs' param in 'oc_delete' libvamahaja2020-07-021-5/+12
| | | | | Change-Id: I9d99f367b82c6570e1390c6b137e0b9bf401a19c Signed-off-by: vamahaja <vamahaja@redhat.com>
* [LibFix] Add parameter 'overwrite' in 'oc_label' librarySri Vignesh2020-06-011-2/+6
| | | | | Change-Id: I7f765605ae032f9054937ca9ed5a5db06bc73464 Signed-off-by: Sri Vignesh <sselvan@redhat.com>
* [LibFix] Fix PVC create/status library timeoutsvamahaja2020-03-251-2/+2
| | | | | Change-Id: I8e027ff71429cd73eea892c6e27d53f638badc42 Signed-off-by: vamahaja <vamahaja@redhat.com>
* [Lib] Add arg label for labeling the DCNitin Goyal2020-02-251-2/+9
| | | | Change-Id: I28af35fdcc27e30957e02d83e19f0a7d4211f18b
* [lib] Add lib to match PV, Heketi and get gluster vols by name prefixSushilG962020-01-241-0/+29
| | | | | | | | | | | | This contains libraries - 1. match_pv_and_heketi_volumes - library for matching heketi volumes and PVCs. 2. heketi_volume_list_by_name_prefix - library to getvolume id and cluster id. 3. match_heketi_and_gluster_volumes_by_prefix - library for matching heketi and gluster volumes. Change-Id: I02af31405a9836000d758a2ffac932be13e52a03
* Fix 'yaml.load' which gives warningsvamahaja2020-01-161-2/+3
| | | | | | | | | | | | As per documenton [1], 'yaml.load(raw_data)' is deprecated and suggested to use parameter 'Loader=yaml.FullLoader'. Fix such instances of yaml.load in functions - oc_get_yaml, get_events and enable_pvc_resize [1] 'https://github.com/yaml/pyyaml/wiki/PyYAML-yaml.load(input)-Deprecation' Change-Id: I1fc5544f6f7f12b55e420486b4460f26db214139 Signed-off-by: vamahaja <vamahaja@redhat.com>
* Add TC and config data for metricsArun Kumar2019-12-261-11/+24
| | | | | | | | Test case to validate metrics add config data for metrics add config data of registry namespace to validate metrics Change-Id: I4886482ee33847f506ad898d4a313df866d0348c
* Fix provisioner name for gluster block stroage classkasturiNarra2019-12-131-1/+1
| | | | | | | | | | Provisioner name has been changed in "get_gluster_host_ips_by_pvc_name" of openshift-storage-libs/openshiftstoragelibs/openshift_ops.py module, since from OCS3.11.4 glusterblock storage class provisioner name has been changed from gluster.org/glusterblock to gluster.org/ glusterblock-glusterfs Change-Id: I2549b44e91a0f08384693cd55aea751acda458dd
* [py2to3] Fix various py3 incompatibilitiesValerii Ponomarov2019-12-111-13/+16
| | | | Change-Id: I6c517278c3f8bf6f374ab60bc27768e503161278
* Fix str/list/tuple distinguishing in library functions to support py3Valerii Ponomarov2019-11-281-6/+9
| | | | | | | | | | We try to distinguish strings from other iterable object types in several our library functions and now it is not compatible with py3. The problem is that in py2 strings don't have "__iter__" method, but it exists in case of py3. So, fix it by using py2/3 compatible check for string types. Change-Id: I3f833b5e79f1563a3ae6a2bb9ae43d8919d82c30
* Add TC deleting bunch of PVC's during network failureArun Kumar2019-11-261-5/+11
| | | | | | | | Create network failure while deleting PVC's Network side failure is introduced by opening and closing the ports related to gluster-blockd. Change-Id: Id3a749aa1a051bbce99b85046fa0a79831e85dd5
* Add TC restart initiator node when gluster node is downNitin Goyal2019-11-221-5/+72
| | | | | | | Add new TC where we verify iscsi rediscovery is happening properly on restart of initiator nodes when one gluster node is down. Change-Id: I515bb27d43843f7c19c4a12b6531a212e9c3285a
* Add test for inconsistencies in targetcli when BHV is downAditya Ramteke2019-11-191-2/+3
| | | | | | | Confirm no inconsistencies occur in targetcli when block devices are created with one block hosting volume down. Change-Id: I2a755ef2a88c6e6ca5326be3787ac07c0fb7db26
* Fix test case "test_heketi_node_add_with_valid_cluster"vamahaja2019-11-191-0/+30
| | | | | | | | | | Fix consists of - - Remove steps for add device validation. - Add steps for gluser peer status validation. - Add steps for endpoints validation. Change-Id: I773a883b1ea8bb2bc93660db3459fd864fcd1317 Signed-off-by: vamahaja <vamahaja@redhat.com>
* Add new oc librarieskasturiNarra2019-11-151-0/+138
| | | | Change-Id: I78eb0975c60d1c16b05914bed74b6f942dd0335e
* Make 'provisioner' be autocalculated for storage classesValerii Ponomarov2019-10-311-0/+7
| | | | | | | | | | | | | | | In OCS 3.11.4 was changed the approach for 'provisioners' in storage classes due to the BugZilla bugs [1] and [2]. So, change the approach for getting 'provisioner' value in this project making it be autocalculated based on the data taken from the block provisioner pod, which is located in the working namespace. [1] https://bugzilla.redhat.com/show_bug.cgi?id=1732787 [2] https://bugzilla.redhat.com/show_bug.cgi?id=1738394 Change-Id: Ic1037038e39abba2b2a1ad6dc3ddbfe42473cb88 Signed-off-by: vamahaja <vamahaja@redhat.com>
* Add test cases to perform heketi cluster operations with nodesvamahaja2019-10-171-0/+64
| | | | | Change-Id: I22410ad8c81ca71ac9c2cbaddd66f086abcdf3c5 Signed-off-by: vamahaja <vamahaja@redhat.com>
* Add TC Fail tcmu-runner service while creating and deleting pvcArun Kumar2019-09-251-0/+30
| | | | | | | | | | Create 8 Block PVC and wait for them to get bound. Delete created PVC's and create 8 more PVC's simultaneously. Kill the tcmu-runner service while PVC creation and deletion is in the progress. Restart all the services related to block volumes and verify all pending operations are completed sucessfully. Change-Id: I0cb4cd29b92233a65be93f4b96f1a9a0cb8bed9f
* Add multiple PVCs states waiterValerii Ponomarov2019-09-231-46/+62
| | | | | | | | Add new function called 'wait_for_pvcs_be_bound', which allows us to wait for 'Bound' state of multiple PVCs using single timeout. Also, reuse this new function in the baseclass.py Change-Id: Ia3809d322925b90fdef984db59b3e9e83a82abc7
* Add waiter for multiple resources absenceValerii Ponomarov2019-09-191-35/+62
| | | | | | | | | | Add new function called 'wait_for_resources_absence', which allows us to wait for absense of multiple resources using single timeout. Also, reuse this new function in the baseclass.py for PVC/PV removal waitings. Change-Id: I6e3daae012199e50d3aeb68b697cfae801b0b49b
* Add testcase for passing clusterid when creating storage classAshmitha2019-09-181-2/+2
| | | | Change-Id: I4a6fd02f5713b4e86a9d70cdaffd3ca9369932f4
* Fix multiple usages of waitersValerii Ponomarov2019-09-161-10/+11
| | | | | | | | | | | | | | | | Fix consists of 2 parts: - Calculate correctly left time for waiting in 'scale_dcs_pod_amount_and_wait' function. Before, it had bug, where we were waiting less time than requested. And it led to the unexpected timeout errors. Example: it could fail waiting only 180sec having 600sec as real timeout. - Reset 'attempts' on the instantiated 'waiter's to avoid redundant waiting reusing the single waiter instance. Example. On deletion of 20 PVCs we save about 1,5 minutes. In whole test suite we create much more PVCs than 20. Change-Id: I5d06a63dd0c2c5bd67fdb09fef87948d65e6bf22
* Fix get gluster pod library for independent clustervamahaja2019-09-131-0/+3
| | | | | | | | | | | | "get_ocp_gluster_pod_details" library gives error "IndexError: list index out of range" in case of independent mode setup as "get_custom_resource" returns "[[]]" which in not none. Added fix to check if any element present in list. Change-Id: Iffd081f835ffaf9cb50c020cd297444ea2678950 Signed-off-by: vamahaja <vamahaja@redhat.com>
* Add test case to try creation of storage class with duplicate nameAshmitha2019-09-121-2/+3
| | | | Change-Id: If30737958bc667264fc01fe81d411f406b501918
* Add TC abrupt reboot of initiator nodeNitin Goyal2019-09-061-0/+26
| | | | | | | Add new TC where we verify rediscovery of iscsi paths which happen after abrupt reboot of initiator node. Change-Id: I841e875881c47f8215d48821cd76c0399d43badc
* Add functionality to create more than 1 DC in parallelValerii Ponomarov2019-09-041-13/+58
| | | | | | | | We have test cases which create more than 1 app DC at once. So, add functionality to be able to create bunch of DCs in parallel and reuse it in one of test cases. Change-Id: Id606d02c31a919bbc6d49d59714dd5628c6a835d
* Fix pep8 errors in the files of the 'openshift-storage-libs' dirValerii Ponomarov2019-09-031-15/+13
| | | | Change-Id: Iaa7deca275958d4de68601dc16d1920f3dab85f2
* Remove extra '-' from create_secretNitin Goyal2019-08-201-1/+1
| | | | Change-Id: I2ebc1c2e7e7aefb5e0d70342a7ec243a12b0663b
* Workaround BZ-1727360 in the "get_gluster_pod_names_by_pvc_name" funcvamahaja2019-08-071-61/+68
| | | | | | | | | | "get_gluster_pod_names_by_pvc_name" function depends on the ocp3.11 specific shell command, which fails on old OCP versions. So, fix it by getting info in compatible way. Also, update usages of this function with new return data structure. Change-Id: Ibb8559590a1288c032630b3292f631d28bc87263 Signed-off-by: vamahaja <vamahaja@redhat.com>
* Add TC run IOs when tcmu-runner service is downNitin Goyal2019-07-191-5/+10
| | | | | | | | This test case verifies that when tcmu-runner is down we are able to run IOs on block volumes, and stoping tcmu-runner would effect gluster-blockd and gluster-block-target services. Change-Id: I0b4a23f7c2dce909f07a22893f83a6c1d0285091
* Add state arg in *_service_status_* libs in openshift-ops moduleNitin Goyal2019-07-021-5/+14
| | | | | | | | Before, these libraries could be used for 'active' state only. Make it accept one additional 'state' argument for possibility to use it for any state, not just one. Change-Id: I6d4fbd7584b308e3ad248213cb0ec3f4996f6437
* Add TC resize PVC with invalid sizeArun Kumar2019-07-011-1/+1
| | | | | | | | This test case checks if invalid size is passed, size of PVC does not change. Verify the size of PVC and I/O can be performed on the volume attached to PVC. Change-Id: Ia833c76a6d9990ebbac78759c54dc7d28f530ec6
* Use 'cmd_run' func instead of 'g.run' func in openshift_ops.pyValerii Ponomarov2019-05-291-143/+37
| | | | | | | | | | | | | It will allow us to recreate SSH connections when it is broken. Also, do following additional things: - Fix 'podcmd' module, where 'user' argument for 'g.run' is missing in it's wrapper. - Use "g.log.error" command to log errors when they appear inside of the 'cmd_run' func. - Delete several unused commands, instead of fixing them. - Update several test cases's logic due to the changes in the libraries. Change-Id: I908e5adcff739b6ab3a4aefaebfe46abdee22655
* Fix 'test_pv_resize_by_exact_free_space' tcValerii Ponomarov2019-05-291-1/+1
| | | | | | | | | | | | It was broken it 2 places: - It is first tc in the 'resize' test suite, which runs right after OCP API restart. And it happens to fail to talk to the OCP API. So, fix it by adding API service waiter in place where we restart it. - In this tc we delete huge volume which consumes almost whole disk space. And happens that this operation takes up to the 6 minutes. But we were waiting only for 5 minutes. So, just increase timeout. Change-Id: Ic6ada67b96ac8a37d13f57c0576e862226517b0d
* Add TCs creation of block vol greater than default size of BHVNitin Goyal2019-05-031-0/+39
| | | | | | | The purpose of TCs is to validate that block device size cannot be more than the block hosting volume. Change-Id: I35aac44bdc2b3e72f1de9ab167e1468ece932f14
* Use py2/3 compatible string type checksNitin Goyal2019-04-151-2/+2
| | | | | | | Replace usage of "types.StringTypes" with "six.string_types", because the latter one is compatible with both - py2 and py3. Change-Id: Ie8f9495914fca527da086af0915130470e3fd3e0
* Fix 'get_events' func for 3.9-3.11 OCP versionsNitin Goyal2019-04-151-1/+1
| | | | | | | As part of the fix we are fixing "AttributeError: 'str' object has no attribute 'append'" in 'get_events' func Change-Id: Ica2489e2d48f9ec8065fe0863b6c5d1633e93860
* Fix support of OCP3.6 and 3.7Valerii Ponomarov2019-04-111-3/+23
| | | | | | | Project has lots of inconsistencies with OCP3.6 and 3.7 So, fix it. Change-Id: I8d38773637b779e1c2e1631568f100c1ab1fdd50
* Add py3 support to our tox config and fix several incompatibilitiesValerii Ponomarov2019-04-111-7/+14
| | | | | | | | | | | | | | | | | | Required steps to run test cases using py3: 1) Install py3 2) Install 'tox' package using "pip3" 3) Run test cases using tox package installed via pip3 Note that full py3 support is not tested yet. It only allows you to run it on py3 not providing any guarantees. Example: $ python3 -m tox -e functional3 -- \ glusto -c /path/to/the/config/file.yaml \ '--pytest=-v -rsx tests -k test_glusterblock_logs' Change-Id: I610faac0b75364c401734b6f892649893ca2320e
* Reorder lib files removing redundant dir layerValerii Ponomarov2019-03-181-0/+1507
Move all the files of 'cns-libs/cnslibs/common' dir to the 'openshift-storage-libs/openshiftstoragelibs', because 'common' is the only dir there, which doesn't really makes sense. And "cns" is old project name, so, replace it with "openshift-storage-libs". Also, fix all the imports of these libs. Change-Id: Ife00a73554e73b21b214b15016b0c8dbbf423446