summaryrefslogtreecommitdiffstats
path: root/glustolibs-gluster/glustolibs/gluster/volume_libs.py
Commit message (Collapse)AuthorAgeFilesLines
* [LibFix] Optimizing setup_volume api.srijan-sivakumar2020-12-181-2/+2
| | | | | | | | | | | | | | | | Currently the setup volume API is calling the get_volume_info to obtain the volume information to check if the said volume already exists. Internally the get_volume_info would have to parse the complete xml dump received for volume info. Instead of that one can invoke the get_volume_list which would mean reduced effort put into parsing the output received as volume name is the only important factor in this check inside setup_volume. Change-Id: I024d42fe471bf26ac85dd3108d6f123cd56a0766 Signed-off-by: srijan-sivakumar <ssivakum@redhat.com>
* [LibFix] Fix code to avoid failuresayaleeraut2020-08-191-1/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | Description: Earlier, on running a test script which calls get_volume_type(), the test script displayed below failure message in glusto logs: "INFO (get_volume_type) Failed to find brick-path 10.70.47.44:/bricks/brick2/testvol_distributed_brick0// for volume testvol_distributed" - even though the brick-path was present in the volume. Checked by directly calling the function as well: >>> from glusto.core import Glusto as g >>> from glustolibs.gluster.volume_libs import get_volume_type >>> ret = get_volume_type('10.70.47.44:/bricks/brick2/vol1-b1/') >>> print ret Distribute >>> ret = get_volume_type('10.70.47.44:/bricks/brick2/vol1-b1//') >>> print ret None Observed that the issue occurs if an extra "/" is present at the end of the brickdir_path(str) parameter passed to the function. Hence have added a check for the same. Change-Id: I01fe2d05b7f206d7767c83e57e714053358dc42c Signed-off-by: sayaleeraut <saraut@redhat.com>
* [Libfix] Remove tier libraries from glusto-testsBala Konda Reddy M2020-07-081-736/+81
| | | | | | | | | | | | Tier libraries are not used across test cases and due to checks across brick_libs.py and volume_libs.py, performance of regular test cases(time taken for execution) is getting degraded. One more factor to remove Tier libraries across glusto-tests is, the functionality is deprecated. Change-Id: Ie56955800515b2ff5bb3b55debaad0fd88b5ab5e Signed-off-by: Bala Konda Reddy M <bala12352@gmail.com>
* [Lib] Add parse_vol_file methodPranav2020-06-241-0/+59
| | | | | | | | This method parses the given .vol file and returns the content as a dictionary. Change-Id: I6d57366ddf4d4c0249fff6faaca2ed005cd89e7d Signed-off-by: Pranav <prprakas@redhat.com>
* [Libfix] Change sequence of option set & start opPranav2020-06-031-8/+24
| | | | | | | | As SSL cannot be set after volume start op, moving set_volume_option prior to volume start. Change-Id: I14e1dc42deb0c0c28736f03e07cf25f3adb48349 Signed-off-by: Pranav <prprakas@redhat.com>
* [Libfix] Add parameter for volume create onlyBala Konda Reddy M2020-05-181-5/+18
| | | | | | | | | | | | | | | | | | | | | | | | | Problem: Currently setup_volume in volume_libs.py and gluster_base_class.py are to create volume and start it. There are tests, where only volume_create is required and if the test has to run on all volume types. Any contributor have to do all the validations which are already implemented in setup_volume and classmethod of setup volume in the gluster_base_class to their test. Solution: Added a parameter in the setup_volume() function "create_only" by default it is false, unless specified this paramter setup_volume will work as it is. similarly, have added a parameter in classmethod of setup_volume in gluster_base_class.py "only_volume_create", here also defaults to false unless specified. Note: After calling "setup_volume() -> volume_stop" is not same as just "volume_create()" in the actual test. Change-Id: I76cde1b668b3afcac41dd882c2a376cb6fac88a3 Signed-off-by: Bala Konda Reddy M <bala12352@gmail.com>
* [Libfix] Add brick sharing spt to replace_brick_from_volume()kshithijiyer2020-04-211-5/+17
| | | | | | | | | | | | | | | | | | | | | | Problem: `replace_brick_from_volume()` function doesn't support brick shareing which creates a problem as when we try to perform replace brick with a large number of volumes it is unable to get bricks and hence failes. Solution: Adding code for boolean kawrg for multi_vol and using form_bricks_for_multivol() or form_bricks_list() according to the value of multi_vol. The default value of multi_vol is false which would only use form_bricks_list() as done without the changes. Blocks: This patch currently blocks the below mentioned patch: https://review.gluster.org/#/c/glusto-tests/+/19483/ Change-Id: I842a4ebea81e53e694b5b194294f1b941f47d380 Signed-off-by: kshithijiyer <kshithij.ki@gmail.com>
* [Lib] Library for multi volume creation Bala Konda Reddy M2020-03-161-5/+74
| | | | | | | | | | | | | | | | | | | Earlier, brick creation is carried out based on the difference of used and unused bricks. This is a bottleneck for implementing brick multiplexing testcases. Moreover we can't create more than 10 volumes. With this library, implementing a way to create bricks on top of the existing servers in a cyclic way to have equal number of bricks on each brick partition on each server Added paramter in setup_volume function, if multi_vol flag is set it will fetch bricks using cyclic manner using (form_bricks_for_multi_vol) otherwise it will fetch using old mechanism. Added bulk_volume_creation function, to create multiple volumes the user has specified. Change-Id: I2103ec6ce2be4e091e0a96b18220d5e3502284a0 Signed-off-by: Bala Konda Reddy M <bala12352@gmail.com>
* [LibFix] Add code to check bricksayaleeraut2020-02-181-4/+7
| | | | | | | | | | | | | | | | | | | | | Earlier the method get_volume_type() passed when ran on interpreter. But when the method was called in a TC, it failed at condition (Line: 2235) because : e.g. The value of brickdir_path is "dhcp47-3.lab.eng.blr.redhat.com:/bricks/ brick2/testvol_replicated_brick2/" and it is trying to find the value in the list ['10.70.46.172:/bricks/brick2/testvol_replicated_brick0', '10.70.46.195:/bricks/brick2/testvol_replicated_brick1', '10.70.47.3:/bricks/brick2/testvol_replicated_brick2'] returned by get_all_bricks(), which will fail. Now, with fix, it will run successfully as it tries to check if for host dhcp47-3.lab.eng.blr.redhat.com, the brick /bricks/brick2/testvol_replicated_brick2 is present in the list brick_paths[] which consists of only the paths and not the IP addresses of the bricks present on that host. Change-Id: Ie595faba1e92c559293ddd04f46b85065b23dfc5 Signed-off-by: sayaleeraut <saraut@redhat.com>
* [Lib] Add function get_volume_type()sayaleeraut2020-02-141-1/+35
| | | | | | | | | The function get_volume_type() will return the type of volume (as distributed/replicate/disperse/arbiter/distributed-replicated/ distributed-dispersed/distributed-arbiter) under test. Change-Id: Ib23ae1ad18ef65d0520fe041a5f80211030a034b Signed-off-by: sayaleeraut <saraut@redhat.com>
* [py2to3] Change str to list in isinstance()kshithijiyer2020-01-091-3/+3
| | | | | | | | | | | | Use 'list' object type in comparisons instead of 'str' Because it is differently treated in py2 and py3. Example: In py2 isinstance(u'foo', str) is False In py3 isinstance(u'foo', str) is True Change-Id: I7663d42494bf59d74550ff4897379d35cc357db4 Signed-off-by: kshithijiyer <kshithij.ki@gmail.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>
* Fix spelling mistake across the codebaseNigel Babu2018-08-071-14/+14
| | | | Change-Id: I46fc2feffe6443af6913785d67bf310838532421
* Adding a function which gets all files and directories on a bricksPrasad Desala2018-07-271-0/+53
| | | | | Change-Id: I0a439b8defeb6b8e72694f1d97e1309a7ba988fa Signed-off-by: Prasad Desala <tdesala@redhat.com>
* Quota: Fixing quota libs in glustoSanoj Unnikrishnan2018-06-131-4/+4
| | | | | | | | | | - added quota_libs.py with quota_validate library - Removed redundant function in quota_ops. - changed naming of quota_ops to be consistent and intutive w.r.t cli Change-Id: I4faf448ea308c9e04b548d6174d900fcf56978a5 Signed-off-by: Sanoj Unnikrishnan <sunnikri@redhat.com>
* Fix form_bricks_list to work with arbiterNigel Babu2018-05-111-2/+12
| | | | Change-Id: I04d3b8ef5ff08cc50fddf07461874210a08248a6
* Adding functions to form_bricks_list_to_add_bricks, remove_brick and ↵ShwethaHP2018-04-161-137/+378
| | | | | | | | | replace_brick. Replaced the expand_volume, shrink_volume to also make use of these functions. Change-Id: Ic5afdb90dc939cdc9b76a7b3f8e3d1cf0108b58e Signed-off-by: ShwethaHP <spandura@redhat.com>
* Check if servers/nodes which is expected to be passed as listShwethaHP2018-01-161-4/+11
| | | | | | | | is str. i.e passing a single node to the function. If it is str, then convert it to list Change-Id: I1abacf62fdbe1ec56fe85c86d8e2a323a2c3971b Signed-off-by: ShwethaHP <spandura@redhat.com>
* Adding functions for:ShwethaHP2018-01-111-1/+43
| | | | | | | | | 1. Waiting for all bricks to be online 2. Waiting for all self-heal-daemons to be online 3. Waiting for all volume processes to be online Change-Id: I01a8711838227eb167e69710ecbd3abd0fecb9e6 Signed-off-by: ShwethaHP <spandura@redhat.com>
* Do not validate the return code of the 'rebalance status' command when just ↵stableShwethaHP2017-09-111-8/+3
| | | | | | | | | logging the output Change-Id: I6ff7e363871607c2f9d4272be7198150db59af5d Signed-off-by: ShwethaHP <spandura@redhat.com>
* Fix to match only the given volname in showmountArthy Loganathan2017-06-201-1/+1
| | | | | Change-Id: I41290d79f016e590a936d031665259f61aa1474a Signed-off-by: Arthy Loganathan <aloganat@redhat.com>
* Resolving the Cyclic Imports. It cased during resolving theShwethaHP2017-06-061-1/+1
| | | | | | | merge confilts. Change-Id: Ie48d758c8883b8189ece735708fb5469ece5a0c2 Signed-off-by: ShwethaHP <spandura@redhat.com>
* Adding sanity heal tests when IO in progress.Shwetha Panduranga2017-06-011-1/+288
| | | | | | | | | 1) test heal with replace-brick when io in progress 2) test heal when bricks goes offline and comes back online when io in progress. Change-Id: Id9002c465aec8617217a12fa36846cdc1f61d7a4 Signed-off-by: Shwetha Panduranga <spandura@redhat.com> Signed-off-by: ShwethaHP <spandura@redhat.com>
* Adding a sanity case to test shrinking volume. i.e remove-brickShwetha Panduranga2017-05-311-10/+302
| | | | | | | | | Remove brick Sanity case covers testing of remove-brick of a subvolume, waiting for rebalance to complete, commiting the operation and validate IO is successful on the mount. Change-Id: I5912f62b3df5dfb5bf5339de036967f83b6a5117 Signed-off-by: Shwetha Panduranga <spandura@redhat.com>
* Adding a test for Gluster Basic Component Verification Sanity Suite.Shwetha Panduranga2017-03-031-4/+164
| | | | | | | - expanding the volume i.e test add-brick is successful on the volume. Change-Id: I8110eea97cf46e3ccc24156d6c67cae0cbf5a7c1 Signed-off-by: Shwetha Panduranga <spandura@redhat.com>
* Adding a new test to VVT:Shwetha Panduranga2017-02-271-83/+99
| | | | | | | | | | | | | | | | | | | | | 1) glusterbaseclass: - Making changes in glusterbaseclass to not necessarily have volume_type and mount_type. 2) volume_libs: - setup_volume don't have to export the volume. It just creates starts and setup's any operation on the volume. - Moved the sharing/exporting the volume to BaseClass 3) Renaming samba_ops to samba_libs to have better naming practice. 4) Adding nfs_ganesha_libs for any nfs related helper functions 5) Adding a new vvt case which creates, deteles, creates the volume. Change-Id: I238c349df7165d669d3bc7234d97845dba2f51a6 Signed-off-by: Shwetha Panduranga <spandura@redhat.com>
* Adding helper functions to volume libs:Shwetha Panduranga2017-02-061-10/+100
| | | | | | | | | | | 1) To check if volume is exported as nfs/cifs share 2) A function which logs volume info and volume status. This will be used in most of the tests for validation purposes 3) Check if all process of the volume is running or not. This will be used mostly in all the cases for validation purposes. Change-Id: I0cd797e5bfe269da8630b41193ea458be3a720f9 Signed-off-by: Shwetha Panduranga <spandura@redhat.com>
* Clean up pyflakes and pep8 errorsNigel Babu2016-12-121-17/+11
| | | | | Change-Id: Ibdd092118d3bb912716c46fd278ef3c680a6e742 Signed-off-by: Nigel Babu <nigelb@redhat.com>
* Start gluster nfs-server only when the mount type is 'nfs'.Shwetha Panduranga2016-12-011-7/+0
| | | | | Change-Id: Ie7a25927d9bd55a7115adfae4fd550f96f435950 Signed-off-by: Shwetha Panduranga <spandura@redhat.com>
* set nfs.disable to off on the volume to start nfs server on that volume.Shwetha Panduranga2016-11-071-0/+7
| | | | | Change-Id: Ic63a69ec0d0cafcb71059b41625fe054167910d0 Signed-off-by: Shwetha Panduranga <spandura@redhat.com>
* Adding a bvt testcaseShwetha Panduranga2016-10-261-17/+32
| | | | | Change-Id: Ide7e3bac46fbaf354a2a5c8baef8510b4aefec78 Signed-off-by: Shwetha Panduranga <spandura@redhat.com>
* Adding libs for brick ops, volume helpers, mount helpers, gluster baseShwetha Panduranga2016-10-171-0/+980
class, heal related helpers, samba helpers, and windows ops helpers Change-Id: I0ad8fc7548c88e89d2ba6441166b9a38af76cea0 Signed-off-by: Shwetha Panduranga <spandura@redhat.com>