summaryrefslogtreecommitdiffstats
path: root/glustolibs-gluster
Commit message (Collapse)AuthorAgeFilesLines
* [py2to3] Add py3 support in 'tests/functional/nfs_ganesha'Valerii Ponomarov2019-12-181-2/+2
| | | | | Change-Id: I7a76e0c2e491caffd7ba1b648b47c4c6a687c89a Signed-off-by: Valerii Ponomarov <kiparis.kh@gmail.com>
* Fix volume cleanup in 'gluster_base_class' moduleValerii Ponomarov2019-12-171-1/+1
| | | | | | | | | | | | | One of the recent changes [1] broke volume cleanup logic which is located in base class. Fix it by proper handling of the cleanup function results where '0' return code is 'success' and not 'failure' as it was considered in that change. [1] 6cd137615aec29dade5b41975fcbdae06852cf53 Change-Id: I674493369202ceabc6983fae0b3834e3b0708bf1 Signed-off-by: Valerii Ponomarov <kiparis.kh@gmail.com>
* [py2to3] Add py3 support in 'tests/functional/snapshot'Valerii Ponomarov2019-12-171-1/+1
| | | | | Change-Id: Ie408d7972452123b63eb5cc17c61bc319a99e304 Signed-off-by: Valerii Ponomarov <kiparis.kh@gmail.com>
* [py2to3] Add py3 support in 'tests/functional/samba'Valerii Ponomarov2019-12-171-1/+1
| | | | | Change-Id: Iae0f6e729c26e466d82c4133439bdd7021485e7f Signed-off-by: Valerii Ponomarov <kiparis.kh@gmail.com>
* Add steps to stablize the existing contents in cleanupSri Vignesh2019-12-131-7/+18
| | | | | Change-Id: I0d405afb3ed84ae8a67f7c2e6a303063096f490c Signed-off-by: Sri Vignesh <sselvan@redhat.com>
* [Fix] Changing license to GPLv3+ in setup.py files.kshithijiyer2019-12-101-4/+4
| | | | | | | | | | The license details of the project needs to be updated for all the files in the project. Fixing all setup.py files in the project and submitting a patch. Change-Id: I7b53330a65891969403c6267e934606ea9b76352 Signed-off-by: kshithijiyer <kshithij.ki@gmail.com>
* [py2to3] Add py3 support for tests in 'tests/functional/bvt'Valerii Ponomarov2019-12-091-6/+4
| | | | | Change-Id: I8b8aad4c3e4a2ad924478f1842498289323b7098 Signed-off-by: Valerii Ponomarov <kiparis.kh@gmail.com>
* [lib]:Adding the default configs for arbiter and dist-arbitersayaleeraut2019-11-291-1/+15
| | | | | | | | | | | Adding the default configurations for arbiter and distributed- arbiter volume types, as it was missing from the gluster_base_class.py. Adding Arbiter and Distributed arbiter configuration in the glusto_tests_config.yml Change-Id: Ic078505975ff1a1171a4bc6ee6ad2c67f0fb45f1 Signed-off-by: sayaleeraut <saraut@redhat.com>
* [lib]-Adding support for arbiter volumes in setup_volume()sayaleeraut2019-11-291-1/+36
| | | | | | | | Adding support for arbiter and distributed-arbiter volume types as it was not present earlier in setup_volume(). Change-Id: I836e4865bb2066478d5f08254f37f115b3a1aac5 Signed-off-by: sayaleeraut <saraut@redhat.com>
* [py2to3] Refactor gluster_base_class.pyValerii Ponomarov2019-11-281-165/+127
| | | | | | | | | | | | | | | | | | Following changes were implemented: - Delete unused imports and place used ones in the alphabetical order. Imports are splitted into 3 groups: built-ins, third-parties and local modules/libs. - Make changes to support py3 in addition to py2. - Minimize number of code lines keeping the same behaviour and improving readability. - Add possibility to get 'bound' (cls) methods using 'get_super_method' staticmethod from base class. Before it was possible to call only unbound (self) methods. - Update 'test_add_brick.py' module as PoC for running base class bound methods in both - py2 and py3. Now this module py2/3 compatible. Change-Id: I1b66b3a91084b2487c26bec8763ab2b4e12ac482 Signed-off-by: Valerii Ponomarov <kiparis.kh@gmail.com>
* [py2to3] Delete 'GlusterBlockBaseClass'Valerii Ponomarov2019-11-281-646/+1
| | | | | | | | | For following reasons: - It is unused. - It is not compatible with py3. Signed-off-by: Valerii Ponomarov <kiparis.kh@gmail.com> Change-Id: Ied6373c398406ffd08d7673892fde89ec6e04fe2
* [py2to3] Add method to the base class for proper calling of it's methodsValerii Ponomarov2019-11-221-0/+26
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Lots of test classes are wrapped by the 'runs_on' decorator. This decorator replaces original test class with it's copy where parent class is original test class if we use py3. Such situation leads to the impossibility to use following approach in py3: super(SomeClass, some_class_instance).some_method() And, the above approach is py2/3 compatible approach for calling parent class's methods. The problem we face is that we fall into the unexpected recursion here. So, add 'get_super_method' to the base class, which detects such situation and returns proper method of a proper parent class. Also, fix test class located at 'glusterd/test_peer_status.py' module to have proof of concept. With this change 'test_peer_probe_status' test case becomes completely py2/3 compatible. Example of new method usage: @runs_on([['distributed'], ['glusterfs']]) class TestDecoratedClass(GlusterBaseClass): ... def setUp(self): self.get_super_method(self, 'setUp')() ... This approach must be used instead of existing calls of 'im_func' function if we want to support both at once - python2 and python3. Signed-off-by: Valerii Ponomarov <kiparis.kh@gmail.com> Change-Id: I23f4462b64f9d4dd90812273f08fb756d073ab76
* [py2to3] Replace usage of ".iteitems()" attr with ".items()"Valerii Ponomarov2019-11-213-6/+6
| | | | | | | | Dict attribute called "iteritems()" is not supported in the py3. So, replace it's usage with another similar attr called "items()". Change-Id: I130b7f67f0a2d5da5ed6c3d792f5ff024ba148f4 Signed-off-by: Valerii Ponomarov <kiparis.kh@gmail.com>
* Using egrep instead of grepArjun Sharma2019-09-261-1/+1
| | | | | | | | | Since egrep treats a pattern as extended regular expression it is more suited to be used in this case. The current usage of grep fails to identify the expression after the first pipe. Change-Id: Id02f884356048c56066a406937f8d86456ee8bd7 Signed-off-by: Arjun Sharma <arjsharm@redhat.com>
* Added AD integration, winbind services nmb services ctdb servicesvivek das2019-09-261-5/+410
| | | | | | | Change-Id: I5c9c6ce48a973c6c902186f4e62afda196faf442 Signed-off-by: vivek das <vdas@redhat.com> Signed-off-by: srivickynesh <sselvan@redhat.com> Signed-off-by: vivek das <vdas@redhat.com>
* Removing redundant classes:Arjun Sharma2019-09-251-247/+1
| | | | | | | | NfsGaneshaVolumeBaseClass and NfsGaneshaIOBaseClass are essentially not needed and act as redundant. Change-Id: I45f95e018daa4bf9575f4e831111f91615085bdc Signed-off-by: Arjun Sharma <arjsharm@redhat.com>
* Removing redundant method 'run_refresh_config'Jilju Joy2019-09-201-51/+0
| | | | | | | The method 'refresh_config' can be used instead of 'run_refresh_config' Change-Id: I6c70b4dff1fd4531fdf6eaa4f044d2d1992d8151 Signed-off-by: Jilju Joy <jijoy@redhat.com>
* [lib] Merging functions to make generic library.kshithijiyer2019-09-171-184/+181
| | | | | | | | | | | | | | | | | | | | | At present there are 2 different functions for prerequisites and create session merging them and adding checks to make the functions more effective when called from a conftest.py file. By doing so we also avoid the possibility of running the same function twice which might lead to problems. For example when commands like: $ gluster system:: execute gsec_create it would make 2 entries in authorized keys files leading to workers getting into faulty state. Note: This patch should only be merged after merging the below mentioned patches: [1] https://review.gluster.org/#/c/glusto-tests/+/23291/ [2] https://review.gluster.org/#/c/glusto-tests/+/23293/ Change-Id: I3f8cda7b589c86de4dab8c66d033b364dd495b9b Signed-off-by: kshithijiyer <kshithij.ki@gmail.com>
* [lib] Modifying georep libraries as per changes in lib_utils.kshithijiyer2019-09-172-191/+66
| | | | | | | | | | | | | | | | | | | | THIS PATCH IS DEPENDENT ON THE BELOW PATCH: https://review.gluster.org/#/c/glusto-tests/+/23291/ Removing the below functions as a more generic function is added in lib_utils: georep_ssh_keygen georep_ssh_copyid georep_groupadd georep_geoaccount georep_geoaccount_setpasswd Adding georep_mountbroker_remove_user to remove users from mountbroker which will be needed in teardown. Change-Id: I5b484b93cbc1660cdf223cfa4bac2a32acc8fc77 Signed-off-by: kshithijiyer <kshithij.ki@gmail.com>
* [lib] Adding group_add,ssh_keygen,ssh_copy_id, set_passwd to lib_utils.kshithijiyer2019-09-171-12/+130
| | | | | | | | | | | | | | | | Adding the following functions tot lib_utils.py: 1.ssh_keygen(): Creates a pair of ssh private and public key if not present. 2.set_passwd(): Sets password for a given username. 3.ssh_copy_id(): Copies the default ssh public key. 4.group_add(): Creates a group in all the servers. Modifying add_user() to create and add user to a specific group. Also modifying the code in add_user() to take list of servers. Change-Id: I58cdef967293204073aa912fa98adb9606f6885d Signed-off-by: kshithijiyer <kshithij.ki@gmail.com>
* Corrections to geo-rep libskshithijiyer2019-08-071-27/+23
| | | | | | Change-Id: I0f32dc73d960f8bfeb662643e736291ffb74cb81 Signed-off-by: Roch-elle <rallan@redhat.com> Signed-off-by: kshithijiyer <kshithij.ki@gmail.com>
* Fix TypeError caused in heal_libs.pyVinayak Papnoi2019-08-071-1/+1
| | | | | | | | | | | | | | | | The line 316 of heal_libs.py library contains a function called 'wait_for_self_heal_daemons_to_be_online' which makes use of the 'volname' and 'timeout' arguements for string formatting. The method used for the string formatting was wrong which causes an error 'TypeError: not enough arguments for format string'. Due to this, all the test cases which make use of heal_libs.py will result in a TypeError scenario. This patch will fix the TypeError for the string formatting. Change-Id: I73abe573d2ccb60b74ccd6ae268b950640d75600 Signed-off-by: Vinayak Papnoi <vpapnoi@redhat.com>
* Fix brickmux_ops libraryVinayak Papnoi2019-08-021-1/+1
| | | | | | | | | The function 'is_brick_mux_enabled' has an incorrect check for the ValueError. The format specifier was incorrect and missing. It has been added with this fix. Change-Id: Idac536de8b9916207ebdda1ba6c981837f01a220 Signed-off-by: Vinayak Papnoi <vpapnoi@redhat.com>
* Moving check_gluster_shared_volume to library.kshithijiyer2019-08-011-4/+57
| | | | | | | | Adding function check_gluster_shared_volume() to check if gluster_shared_storage is present or absent. Change-Id: Ifa646187a0ef351f3dd37b54bb0a3a8a7c8b2500 Signed-off-by: kshithijiyer <kshithij.ki@gmail.com>
* Add library to reset particular volume optionVinayak Papnoi2019-07-311-0/+35
| | | | | | | | | | | | | Currently there is a library to reset the volume entirely. There needs to be a library to reset a particular volume option because if a user has set a lot of other volume options then it becomes a tedious job to reset and set the other options explicitly. The library function 'reset_volume_option' takes particular volume options as a string and resets it. Change-Id: I2049ea4a49d321d921d940f34e124d1f34bfa068 Signed-off-by: Vinayak Papnoi <vpapnoi@redhat.com>
* Adding get_brick_processes_count() to brickmux_ops.kshithijiyer2019-07-231-0/+18
| | | | | | | | | | | Adding get_brick_processes_count() which can be used to get the number of brick processes running on a given node would be needed for brickmux testcases to check if brickmux is honored or not. Change-Id: I6ec608b8f9d715d0f21e95fc3c0293eed287b16c Signed-off-by: kshithijiyer <kshithij.ki@gmail.com>
* [geo-rep] Removing 'create_shared_storage' function as separate libraries existVinayak Papnoi2019-07-231-23/+0
| | | | | | | | | | | The function 'create_shared_storage' is redundant as the same function is available as part of the shared-storage library. This part will be removed from the geo-rep library with this fix. To create/enable shared storage, make use of the shared_storage_ops.py library. Change-Id: Ibefca73140e1218f0aa9331f061ef4fc8d9360e3 Signed-off-by: Vinayak Papnoi <vpapnoi@redhat.com>
* Added more checking mechanism for crashesnchilaka2019-07-171-6/+16
| | | | | | | | | Added more checking mechanism for crashes, as sometimes coredumps may not get collected by systems due to settings and hence can miss out on any crashes hit Change-Id: Id45a844bd0d7877d335c06287d4db873776e89db Signed-off-by: nchilaka <nchilaka@redhat.com>
* Library: GlusterfindVinayak Papnoi2019-06-071-0/+536
| | | | | | | | | | | | | | Adding library for the glusterfind operations such as: * glusterfind create * glusterfind delete * glusterfind pre * glusterfind post * glusterfind query * glusterfind list Change-Id: I94372f8c4a14cc94d68451dec1763401d9d66d90 Signed-off-by: Vinayak Papnoi <vpapnoi@redhat.com>
* Adding find_and_replace_in_file & check_if_pattern_in_file to library.kshithijiyer2019-05-281-0/+46
| | | | | | | | | | | The function do the following in a nutshell: 1. find_and_replace_in_file: Find and replace a given pattern in a specific file. 2. check_if_pattern_in_file: Check if a give pattern is in seen in file or not. Change-Id: Ib035f54490592f2be32a30f0e8a10e7847812990 Signed-off-by: kshithijiyer <kshithij.ki@gmail.com>
* Adding is_ganesha_installed & is_ganesha_running to nfs_ganesha_ops.pykshithijiyer2019-05-231-0/+33
| | | | | | Change-Id: Ib557ce211f1616ef261bf414a2c0b3864a5be24e Signed-off-by: Ambarish Soman <asoman@redhat.com> Signed-off-by: kshithijiyer <kshithij.ki@gmail.com>
* Removing non-ASCII character from the fileJilju Joy2019-05-101-1/+1
| | | | | Change-Id: Ib8a832901430da30f5f49686ba78b8fb2b76b8e7 Signed-off-by: Jilju Joy <jijoy@redhat.com>
* Enhancement in ganesha cluster setupJilju Joy2019-05-091-26/+55
| | | | | | | | * Code change to do peer probe if not already done * Changes to avoid prerequeste of password less ssh between nodes Change-Id: I8260a80ad8c75a6b3d569cc7ee652e569ec9153a Signed-off-by: Jilju Joy <jijoy@redhat.com>
* Avoid using gdeploy for nfs-ganesha setup, teardown, acl and root-squash libsJilju Joy2019-04-152-320/+589
| | | | | | | | | | * Removed dependency on gdeploy for setup and teardown of ganesha cluster * Correction of pylint errors * Added new method to set acl * Added new method to set root-squash * Added new method for refresh-config * Removed setUp and tearDown methods from NfsGaneshaClusterSetupClass Change-Id: I1266fe7c09e1fed148ca222712e15932a5ad928c
* Modificatons to base class to include slave infoRoch-elle2019-04-121-0/+14
| | | | | | | Added new config file for georep Change-Id: I544ee35f8cd6a2f2ed744f72caa28fa4fd63e5b3 Signed-off-by: Roch-elle <rallan@redhat.com>
* Modifying get_online_bricks_list() to give brick list with node downkshithijiyer2019-04-041-1/+5
| | | | | | | | | | get_online_bricks_list() used to fail in case of node down secnarios with KeyError exception adding code to catch the exception and provide brick list with bricks from gluster v status. Signed-off-by: kshithijiyer <kshithij.ki@gmail.com> Change-Id: Ia26208a52e4197050421bc34b9b8cdaf74ac4da6
* Adding get_dir_contents() to glusterdir library.kshithijiyer2019-03-201-0/+18
| | | | | Change-Id: I7a043753b8ae2ae46ee944e04ddd9137f177960f Signed-off-by: kshithijiyer <kshithij.ki@gmail.com>
* Adding library for profile operationskshithijiyer2019-02-211-0/+265
| | | | | Change-Id: I6db42f6762fe323e8ea0af6b7a9ecbe9af9f5b59 Signed-off-by: kshithijiyer <kshithij.ki@gmail.com>
* Delete quorum method from old file. Added fixes for flake8Vitalii Koriakov2019-01-302-75/+75
| | | | | Change-Id: I2acf835a4cf7301c64c4c8a9423f78672cdf9aa4 Signed-off-by: Vitalii Koriakov <vkoriako@redhat.com>
* fixng lib according to functinality changenagpavanchilakam2019-01-031-2/+2
| | | | Change-Id: I1525d783c223dd3bb3099419bcd9a5efcf0f0085
* setting user.cifs to on for all cifs volumesVijay Avuthu2018-12-271-0/+8
| | | | Change-Id: I4c0b5c9e39d1e7903a64ad9fe91c2feb6ecf7f8e
* Fixed: servers with no bricks are not icluded in servers_unused_bricks_dictVitalii Koriakov2018-12-191-1/+2
| | | | | Change-Id: I953975d66c333c141b03b4eaa7118a93859be878 Signed-off-by: Vitalii Koriakov <vkoriako@redhat.com>
* Correction in volume export scenarioJilju Joy2018-12-061-7/+7
| | | | | | | | | Either nfs-ganesha or gnfs can be enabled. Both cannot co-exist. If 'nfs_ganesha' enable option is set to True in the configuration file, volume will be exported through nfs-ganesha, else it will be exported through gnfs Change-Id: I26e5aa8b29d54fc5d41d77fea7951df66e4de1e7
* Convert bitrot_ops to python3Vitalii Koriakov2018-11-191-2/+2
| | | | | Change-Id: I2183252ee881b5f9c8c74af62c7d8fd2cafb8fc9 Signed-off-by: Vitalii Koriakov <vkoriako@redhat.com>
* Convert auth_ops.py and lib_utils.py to python3Vitalii Koriakov2018-11-082-15/+16
| | | | | Change-Id: I8baf97066c5ae47e2a298581eeb74374fc09a21e Signed-off-by: Vitalii Koriakov <vkoriako@redhat.com>
* Convert geo_rep_ops to python3Vitalii Koriakov2018-11-081-3/+3
| | | | | Change-Id: I2f491f7cadd92846730c6528920c9fa8c2c9edce Signed-off-by: Vitalii Koriakov <vkoriako@redhat.com>
* Using a raw strings for fixing flake warningsVitalii Koriakov2018-10-298-20/+17
| | | | | Change-Id: Ie134790ea05919a4b396657c11cbc3fc7a7fc529 Signed-off-by: Vitalii Koriakov <vkoriako@redhat.com>
* glustolibs: Add GlusterBlockBaseClassbhumikagoyal2018-10-251-2/+647
| | | | | | | | | | | | | | | | | | | | | | | | | | Add the base class for gluster-block which includes functions that helps in automating the test cases on client and target side. These functions will help in block creation, block discovery, login on the client, getting mpath, mounting the block, logout. The teardown function will take care of unmounting blocks, logging out and block deletion and volume cleanup. The .yml file for block should be like: Example gluster_block_args_info: volname: testvol #Should be same as volume name in glusterfs config fle servers: #Server names should be same as names in glusterfs config file - 192.168.100.163 - 192.168.100.192 size: 2GiB ha: 3 auth: enable prealloc: num_of_blocks: 2 #Number of blocks to be created with this configuration ring-buffer: 16 blockname: block_testing #Base name of the blocks to be created. Change-Id: I8cd354fc991cd21c542cfd7f03399cc23c9f7917 Signed-off-by: Bhumika Goyal <bgoyal@redhat.com>
* Revert "Raise Exceptions in setup_volume and mount_volume"Jonathan Holloway2018-09-141-77/+96
| | | | | | This reverts commit 2d425798657a725e02d63ff631c5b87187ea4ca4. Change-Id: I388fe7ff11e28e027fe9006512e35ec57ff10d9c
* Raise Exceptions in setup_volume and mount_volumeNigel Babu2018-09-121-96/+77
| | | | Change-Id: I1310b9da1262b06e77a621831d599cd4077c31ed