summaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeFilesLines
...
* [Test] Replica 3 to arbiter conversion with ongoing IO'sArthy Loganathan2020-10-061-13/+106
| | | | | Change-Id: I3920be66ac84fe700c4d0d6a1d2c1750efb43335 Signed-off-by: Arthy Loganathan <aloganat@redhat.com>
* [Test] multiple clients dd on same-fileArthy Loganathan2020-10-011-9/+14
| | | | | Change-Id: I465fefeae36a5b700009bb1d6a3c6639ffafd6bd Signed-off-by: Arthy Loganathan <aloganat@redhat.com>
* [Test] Add tests to check rebalance of files with holeskshithijiyer2020-09-301-0/+128
| | | | | | | | | | | | | | | | | | | | | Scenarios: --------- Test case: 1. Create a volume, start it and mount it using fuse. 2. On the volume root, create files with holes. 3. After the file creation is complete, add bricks to the volume. 4. Trigger rebalance on the volume. 5. Wait for rebalance to complete. Test case: 1. Create a volume, start it and mount it using fuse. 2. On the volume root, create files with holes. 3. After the file creation is complete, remove-brick from volume. 4. Wait for remove-brick to complete. Change-Id: Icf512685ed8d9ceeb467fb694d3207797aa34e4c Signed-off-by: kshithijiyer <kshithij.ki@gmail.com>
* [Test] Glusterfind --full --type optionShwetha K Acharya2020-09-301-0/+175
| | | | | | | | | | | | | | | | | | | | | | * Create a volume * Create a session on the volume * Create various files on mount point * Create various directories on point * Perform glusterfind pre with --full --type f --regenerate-outfile * Check the contents of outfile * Perform glusterfind pre with --full --type d --regenerate-outfile * Check the contents of outfile * Perform glusterfind pre with --full --type both --regenerate-outfile * Check the contents of outfile * Perform glusterfind query with --full --type f * Check the contents of outfile * Perform glusterfind query with --full --type d * Check the contents of outfile * Perform glusterfind query with --full --type d * Check the contents of outfile Change-Id: I5c4827ff2052a90613de7bd38d61aaf23cb3284b Signed-off-by: Shwetha K Acharya <sacharya@redhat.com>
* [Test] Validate copy of filesayaleeraut2020-09-291-0/+336
| | | | | | | | | | | | | | | | | | | This test script covers following scenarios: 1) Sub-volume is down copy file where source and destination files are on up sub-volume 2) Sub-volume is down copy file where source - hashed down, cached up, destination - hashed down 3) Sub-volume is down copy file where source - hashed down, cached up, destination hashed to up 4) Sub-volume is down copy file where source and destination files are hashing to down sub-volume 5) Sub-volume is down copy file where source file is stored on down sub-volume and destination file is stored on up sub-volume 6) Sub-volume is down copy file where source file is stored on up sub-volume and destination file is stored on down sub-volume Change-Id: I2765857950723aa8907456364aee9159f9a529ed Signed-off-by: sayaleeraut <saraut@redhat.com>
* [Test] Test Quorum specific CLI commands.srijan-sivakumar2020-09-291-0/+97
| | | | | | | | | | | Steps- 1. Create a volume and start it. 2. Set the quorum-type to 'server' and verify it. 3. Set the quorum-type to 'none' and verify it. 4. Set the quorum-ratio to some value and verify it. Change-Id: I08715972c13fc455cee25f25bdda852b92a48e10 Signed-off-by: srijan-sivakumar <ssivakum@redhat.com>
* [Test] Test set and reset of storage.reserve limit on glusterdsrijan-sivakumar2020-09-291-0/+91
| | | | | | | | | | Steps- 1. Create a volume and start it. 2. Set storage.reserve limit on the created volume and verify 3. Reset storage.reserve limit on the created volume and verify Change-Id: I6592d19463696ba2c43efbb8f281024fc610d18d Signed-off-by: srijan-sivakumar <ssivakum@redhat.com>
* [Test] Validate peer probe with hostname,ip,fqdnPranav2020-09-291-0/+146
| | | | | | | | | Test to validate gluster peer probe scenarios using ip addr, hostname and fqdn by verifying each with peer status output, pool list and cmd_history.log Change-Id: I77512cfcf62b28e70682405c47014646be71593c Signed-off-by: Pranav <prprakas@redhat.com>
* [Test]: Volume status show bricks online though brickpath is deletednik-redhat2020-09-281-0/+81
| | | | | | | | | | | | Steps- 1) Create a volume and start it. 2) Fetch the brick list 3) Remove any brickpath 4) Check number of bricks online is equal to number of bricks in volume Change-Id: I4c3a6692fc88561a47a7d2564901f21dfe0073d4 Signed-off-by: nik-redhat <nladha@redhat.com>
* [Test]Add test to validate glusterd.info configuration file“Milind”2020-09-281-0/+67
| | | | | | | | | | | | | 1. Check for the presence of /var/lib/glusterd/glusterd.info file 2. Get the UUID of the current NODE 3. check the value of the uuid returned by executing the command "gluster system:: uuid get " 4. Check the uuid value shown by other node in the cluster for the same node "gluster peer status" on one node will give the UUID of the other node Change-Id: I61dfb227e37b87e889577b77283d65eda4b3cd29 Signed-off-by: “Milind” <mwaykole@redhat.com>
* [TestFix] Removing the 'cd' in file operationssrijan-sivakumar2020-09-251-4/+4
| | | | | | | | | Reason : The cd will change the working directory to root and renames and softlink creations for subsequent files will fail as seen in the glusto logs. Change-Id: I174ac11007dc301ba6ec8ccddaeb919a181b1c30 Signed-off-by: srijan-sivakumar <ssivakum@redhat.com>
* [Test] Add test to check invalid mem read after freedkshithijiyer2020-09-251-0/+102
| | | | | | | | | | | | | Test case: 1. Create a volume and start it. 2. Mount the volume using FUSE. 3. Create multiple level of dirs and files inside every dir. 4. Rename files such that linkto files are created. 5. From the mount point do an rm -rf * and check if all files are delete or not from mount point as well as backend bricks. Change-Id: I658f67832715dde7260827cc0a27b005b6df5fe3 Signed-off-by: kshithijiyer <kshithij.ki@gmail.com>
* [Test] Add test to check for data loss with readdrip offkshithijiyer2020-09-241-0/+103
| | | | | | | | | | | | | | Test case: 1. Create a 2 x (4+2) disperse volume and start it. 2. Disable performance.force-readdirp and dht.force-readdirp. 3. Mount the volume on one client and create 8 directories. 4. Do a lookup on the mount using the same mount point, number of directories should be 8. 5. Mount the volume again on a different client and check if number of directories is the same or not. Change-Id: Id94db2bc9200ab2ce4ca2fb604f38ca4525e6ed1 Signed-off-by: kshithijiyer <kshithij.ki@gmail.com>
* [Test] Add test rm -rf * with self pointing linkto fileskshithijiyer2020-09-241-0/+140
| | | | | | | | | | | | | | | | | | | Test case: 1. Create a pure distribute volume with 2 bricks, start and mount it. 2. Create dir dir0/dir1/dir2 inside which create 1000 files and rename all the files. 3. Start remove-brick operation on the volume. 4. Check remove-brick status till status is completed. 5. When remove-brick status is completed stop it. 6. Go to brick used for remove brick and perform lookup on the files. 8. Change the linkto xattr value for every file in brick used for remove brick to point to itself. 9. Perfrom rm -rf * from mount point. Change-Id: Ic4a5e0ff93485c9c7d9a768093a52e1d34b78bdf Signed-off-by: kshithijiyer <kshithij.ki@gmail.com>
* [Test] Add test to create and delete sparse fileskshithijiyer2020-09-241-0/+156
| | | | | | | | | | | | | | | | | | | Test case: 1. Create volume with 5 sub-volumes, start and mount it. 2. Check df -h for available size. 3. Create 2 sparse file one from /dev/null and one from /dev/zero. 4. Find out size of files and compare them through du and ls. (They shouldn't match.) 5. Check df -h for available size.(It should be less than step 2.) 6. Remove the files using rm -rf. CentOS-CI failure analysis: The testcase fails on CentOS-CI on distributed-disperse volumes as it requires 30 bricks which aren't avaliable on CentOS-CI. Change-Id: Ie53b2531cf6105117625889d21c6e27ad2c10667 Signed-off-by: kshithijiyer <kshithij.ki@gmail.com>
* [Test] Add test to nuke happy pathkshithijiyer2020-09-221-0/+95
| | | | | | | | | | | | | Test case: 1. Create a distributed volume, start and mount it 2. Create 1000 dirs and 1000 files under a directory say 'dir1' 3. Set xattr glusterfs.dht.nuke to "test" for dir1 4. Validate dir-1 is not seen from mount point 5. Validate if the entry is moved to '/brickpath/.glusterfs/landfill' and deleted eventually. Change-Id: I6359ee3c39df4e9e024a1536c95d861966f78ce5 Signed-off-by: kshithijiyer <kshithij.ki@gmail.com>
* [TestFix] Add node restart validationPranav2020-09-221-64/+84
| | | | | | | | | | Extending the existing validation by adding node restart as a method to bring back offline bricks along with exiting volume start approach. Change-Id: I1291b7d9b4a3c299859175b4cdcd2952339c48a4 Signed-off-by: Pranav <prprakas@redhat.com>
* [Test] Add test to check directory permissions wipe outkshithijiyer2020-09-221-0/+132
| | | | | | | | | | | | | | | | | | Test case: 1. Create a 1 brick pure distributed volume. 2. Start the volume and mount it on a client node using FUSE. 3. Create a directory on the mount point. 4. Check trusted.glusterfs.dht xattr on the backend brick. 5. Add brick to the volume using force. 6. Do lookup from the mount point. 7. Check the directory permissions from the backend bricks. 8. Check trusted.glusterfs.dht xattr on the backend bricks. 9. From mount point cd into the directory. 10. Check the directory permissions from backend bricks. 11. Check trusted.glusterfs.dht xattr on the backend bricks. Change-Id: I1ba2c07560bf4bdbf7de5d3831e5de71173b64a2 Signed-off-by: kshithijiyer <kshithij.ki@gmail.com>
* [Test] Rebalance with quota on mountpointsrijan-sivakumar2020-09-211-0/+188
| | | | | | | | | | | | | | Steps- 1. Create Volume of type distribute 2. Set Quota limit on the root directory 3. Do some IO to reach the Hard limit 4. After IO ends, compute arequal checksum 5. Add bricks to the volume. 6. Start rebalance 7. After rebalance is completed, check arequal checksum Change-Id: I1cffafbe90dd30013e615c353d6fd7daa5990a86 Signed-off-by: srijan-sivakumar <ssivakum@redhat.com>
* [Test] Rebalance with special filessrijan-sivakumar2020-09-211-0/+158
| | | | | | | | | | | | | | Steps- 1. Create and start volume. 2. Create some special files on mount point. 3. Once it is complete, start some IO. 4. Add brick into the volume and start rebalance. 5. All IO should be successful. Failing on centos-ci issue due to: https://github.com/gluster/glusterfs/issues/1461 Change-Id: If91886afb3f44d5ede09dfc84e966f66c89ff709 Signed-off-by: srijan-sivakumar <ssivakum@redhat.com>
* [Test] Rebalance with quota on subdirectorysrijan-sivakumar2020-09-181-0/+195
| | | | | | | | | | | | | | Steps- 1. Create Volume of type distribute 2. Set Quota limit on subdirectory 3. Do some IO to reach the Hard limit 4. After IO ends, compute arequal checksum 5. Add bricks to the volume. 6. Start rebalance 7. After rebalance is completed, check arequal checksum Change-Id: I0a431ffb5d1c957e8d11817dd8142d9551323a65 Signed-off-by: srijan-sivakumar <ssivakum@redhat.com>
* [Test] Rename Files after Rebalancesrijan-sivakumar2020-09-181-0/+181
| | | | | | | | | | | | | | | Steps- 1. Create a volume 2. Create directories or files 3. Calculate checksum using arequal 4. Add brick and start rebalance 5. While rebalance is running, rename the files or directories 6. After rebalance is completed, calculate checksum 7. Compare the Checksum Change-Id: I59f80b06a23f6b4c406907673d71b254d054461d Signed-off-by: srijan-sivakumar <ssivakum@redhat.com>
* [Test] Check heal of custom xattr on directorysayaleeraut2020-09-181-0/+332
| | | | | | | | | | | | | | | This test script covers below scenarios: 1) Sub-volume is down - Directory - Verify extended attribute creation, display, modification and removal. 2) Directory self heal - extended custom attribute when sub-volume is up again. 3) Sub-volume is down -create new Directory - Verify extended attribute creation, display, modification and removal. 4) Newly Directory self heal - extended custom attribute when sub-volume is up again. Change-Id: I35f8772d7758c2e9c02558b46301681d6c0f319b Signed-off-by: sayaleeraut <saraut@redhat.com>
* [Test] Brick removal with Quota in Distribute volumesrijan-sivakumar2020-09-181-0/+160
| | | | | | | | | | | | | Steps- 1. Create a distribute volume. 2. Set quota limit on a directory on mount. 3. Do IO to reach the hardlimit on the directory. 4. After IO is completed, remove a brick. 5. Check if quota is validated, i.e. hardlimit exceeded true after rebalance. Change-Id: I8408cc31f70019c799df91e1c3faa7dc82ee5519 Signed-off-by: srijan-sivakumar <ssivakum@redhat.com>
* [TestFix] As bug #BZ1761932 is fixed removing skip logic“Milind”2020-09-181-3/+0
| | | | | Change-Id: I54ecce22f243b10248eea78b52c6b8cf2c7fd338 Signed-off-by: “Milind” <mwaykole@redhat.com>
* [Test] Rebalance with brick down in replicasrijan-sivakumar2020-09-181-0/+171
| | | | | | | | | | | | | | Steps- 1. Create a Replica volume. 2. Bring down one of the brick down in the replica pair 3. Do some IO and create files on the mount point 4. Add a pair of bricks to the volume 5. Initiate rebalance 6. Bring back the brick which was down 7. After self heal happens, all the files should be present. Change-Id: I78a42866d585b00c40a2712c4ae8f2ab3552adca Signed-off-by: srijan-sivakumar <ssivakum@redhat.com>
* [Config] Add stale.yml to enable stale botkshithijiyer2020-09-171-0/+25
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Problem: We have received a lot of issues in the past which have been abandoned for quite sometime and were not closed every after a couple of years, one such example is [1] which was open for almost 2 years. Hence to take care of such issues we have decided to add stale bot which will close stale issues automatically. The process which is to be followed will be as below: 1. Once we get a new issue by default we will be adding `ToBeTriaged` label. 2. Once the issue is triaged and is to be fixed it will be assigned to a contributor and the label `ToBeFixed` will be added. 3. If the issue is not be be fixed then we will be removing the `ToBeTriaged` label after this the bot will wait for 90 days for any comment. 4. Once 90 days are complete stale bot will drop a last comment and will wait for 14 days post which the bot will automatically close the issue with `wontfix` label. links: [1] https://github.com/gluster/glusto-tests/issues/15 Fixes: https://github.com/gluster/glusto-tests/issues/31 Change-Id: I6c4c72433eccdb22fbefea2c62f511634d928576 Signed-off-by: kshithijiyer <kshithij.ki@gmail.com>
* [Testfix] Added reboot scenario to shared_storage testBala Konda Reddy M2020-09-171-74/+129
| | | | | | | | | | Currently, there is no validation for shared storage whether it is mounted or not post reboot. Added the validation for reboot scenario Made the testcase modular for future updates to the test. Change-Id: I9d39beb3c6718e648eabe15a409c4b4985736645 Signed-off-by: Bala Konda Reddy M <bala12352@gmail.com>
* [TestFix] Adding sleep so that the brick will get port“Milind”2020-09-151-0/+3
| | | | | | | | | | Problem :ValueError: invalid literal for int() with base 10: 'N/A' Solution : Wait for 5 sec so that brick will get the port Change-Id: Idf518392ba5584d09e81e76fca6e29037ac43e90 Signed-off-by: “Milind” <mwaykole@redhat.com>
* [Testfix] Increase timeouts and fix I/O errorskshithijiyer2020-09-145-6/+11
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Problem: -------- Problem 1: In the latest runs the following testcases fail with wait timeout mostly on rebalance with an exception on test_stack_overflow which fails on layout: 1.functional.dht.test_stack_overflow.TestStackOverflow_cplex_dispersed_glusterfs.test_stack_overflow 2.functional.dht.test_rebalance_dir_file_from_multiple_clients.RebalanceValidation_cplex_dispersed_glusterfs.test_expanding_volume_when_io_in_progress 3.functional.dht.test_restart_glusterd_after_rebalance.RebalanceValidation_cplex_dispersed_glusterfs.test_restart_glusterd_after_rebalance 4.functional.dht.test_stop_glusterd_while_rebalance_in_progress.RebalanceValidation_cplex_dispersed_glusterfs.test_stop_glusterd_while_rebalance_in_progress 5.functional.dht.test_rebalance_with_hidden_files.RebalanceValidation_cplex_dispersed_glusterfs.test_rebalance_with_hidden_files This is mostly observed on disprese volumes which is expected as in most cases disprese volumes take more time than pure replicated or distributed volumes due to it's design. Problem 2: Another issue which was observed was that test_rebalance_with_hidden_files failing on I/O with distributed volume type with the below stack trace: Traceback (most recent call last): File "/usr/share/glustolibs/io/scripts/file_dir_ops.py", line 1246, in <module> rc = args.func(args) File "/usr/share/glustolibs/io/scripts/file_dir_ops.py", line 374, in create_files base_file_name, file_types) File "/usr/share/glustolibs/io/scripts/file_dir_ops.py", line 341, in _create_files ret = pool.map(lambda file_tuple: _create_file(*file_tuple), files) File "/usr/lib64/python2.7/multiprocessing/pool.py", line 250, in map return self.map_async(func, iterable, chunksize).get() File "/usr/lib64/python2.7/multiprocessing/pool.py", line 554, in get raise self._value IOError: [Errno 17] File exists: '/mnt/testvol_distributed_glusterfs/.1.txt' Solution: -------- Problem 1 Increasing or adding timeout so that wait timeouts are not observed. Problem 2 Adding counter logic to fix the I/O failure. Change-Id: I917137abdeb2e3844ee666258235f6ccc854ee9f Signed-off-by: kshithijiyer <kshithij.ki@gmail.com>
* [Test] Validate copy of directorysayaleeraut2020-09-111-0/+308
| | | | | | | | | | | | | | This test script verifies below scenarios: 1)Sub-volume is down copy directory 2)Sub-volume is down copy directory - destination dir hash to up sub-volume 3)Sub-volume is down copy newly created directory - destination dir hash to up sub-volume 4)Sub-volume is down copy newly created directory - destination dir hash to down sub-volume Change-Id: I22b9bf79ef4775b1128477fb858c509a719efb4a Signed-off-by: sayaleeraut <saraut@redhat.com>
* [Lib] Add memory and cpu leak testing frameworkkshithijiyer2020-09-112-0/+1109
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Summary: ======== Currently we don't have a memory and cpu leak testing framework which blocks automation development of all testcases around memory and CPU leaks. To solve this problem we need the libraries for: 1. Logging memory and CPU utilization 2. Checking for OOM killer on gluster processes 3. Checking for memory leaks 4. Checking for cpu usage spikes 5. Wrapper functions in base class to make development easy 6. Compute statistics of usage Detailed description: ===================== We have already added script to log CPU and memory usage through patch [1]. In this patch we would be using patch [1] and building logic to process the CSV files generated by the script which would help us to achieve the following: 1. Checking if there are memory leaks or CPU spikes 2. Computing statistics of memory and CPU usage Function sets added: ~~~~~~~~~~~~~~~~~~~~ Set 1 - Functions to perfrom logging using script ------------------------------------------------- Public functions: 1. check_upload_memory_and_cpu_logger_script() 2. log_memory_and_cpu_usage_on_servers() 3. log_memory_and_cpu_usage_on_clients() 4. log_memory_and_cpu_usage_on_cluster() 5. wait_for_logging_processes_to_stop() 6. kill_all_logging_processes() Private functions to support public functions: 1. _start_logging_processes() 2. _process_wait_flag_append() Set 2 - Functions to check for OOM killers ------------------------------------------ Public functions: 1. check_for_oom_killers_on_servers() 2. check_for_oom_killers_on_clients() Private functions to support public functions: 1. _check_for_oom_killers() Set 3 - Functions to check for memory leaks ------------------------------------------- Public functions: 1. check_for_memory_leaks_in_glusterd() 2. check_for_memory_leaks_in_glusterfs() 3. check_for_memory_leaks_in_glusterfsd() 4. check_for_memory_leaks_in_glusterfs_fuse() Private functions to support public functions: 1. _perform_three_point_check_for_memory_leak() Set 4 - Functions to check for cpu usage spikes ----------------------------------------------- Public functions: 1. check_for_cpu_usage_spikes_on_glusterd() 2. check_for_cpu_usage_spikes_on_glusterfs() 3. check_for_cpu_usage_spikes_on_glusterfsd() 4. check_for_cpu_usage_spikes_on_glusterfs_fuse() Private functions to support public functions: 1. _check_for_cpu_usage_spikes() Set 7 - Functions to calculate stats ------------------------------------ Public functions: 1. compute_data_usage_stats_on_servers() 2. compute_data_usage_stats_on_clients() Private functions to support public functions: 1. _get_min_max_mean_median() 2. _compute_min_max_mean_median() Set 6 - Wrapper functions added to base class --------------------------------------------- 1. start_memory_and_cpu_usage_logging() 2. compute_and_print_usage_stats() 3. check_for_memory_leaks_and_oom_kills_on_servers() 4. check_for_memory_leaks_and_oom_kills_on_clients() 5. check_for_cpu_usage_spikes_on_servers() 6. check_for_cpu_spikes_on_clients() Set 7 - Other generic functions ------------------------------- Public functions: 1. create_dataframe_from_csv() Third party libraries added to glusto-tests through patch: 1. Numpy(It is being used in file_dir_ops.py but it's installed on clients and not on management node.) 2. Pandas 3. Statistics How do I use it in my testcase? ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ For example if we take the testcase to Check the server side memory leak with fuse mount, we would need to perfrom the below steps: 1. Create Disperse volumes 2. Fuse mount on the client 3. Start creating files in 1000's in parallel with 3. Create directories in 1000's in parallel 4. Do linux untar and wait for completion 5. Watch the memory usage on the server side and check for the OOM killers. Here steps 1-4 would be as usual, for step five what we need to do would be after step 2 we would need to start logging memory usage with the below code: ``` proc_dict = cls.start_memory_and_cpu_usage_logging() assertIsNotNone(proc_dict, <Error message>) ``` Once step 4 is complete we would need to wait for the logging process to stop with the below code: ``` ret = wait_for_logging_processes_to_stop(proc_dict, cluster=True) assertTrue(ret, <Error message>) ``` And lastly to check for memory leaks and OOM killers we would need use the below code: ``` ret = cls.check_for_memory_leaks_and_oom_kills_on_servers() assertTrue(ret, 'Memory leaks or OOM killer found') ``` NOTE: Interval and count of function start_memory_and_cpu_usage_logging() and gain of check_for_memory_leaks_and_oom_kills_on_servers() would need tweaking on a case by case scenario. Links: ====== [1] https://review.gluster.org/#/c/glusto-tests/+/24659/ Change-Id: Ib617fae102b8280723e54d0a38f77791558f5658 Signed-off-by: kshithijiyer <kshithij.ki@gmail.com>
* [Test] Resolve and validate gfid split filesLeela Venkaiah G2020-09-081-228/+200
| | | | | | | | | | | Three Scenarios: - Simulate gfid split brain files under a directory - Resolve gfid splits using `source-brick`, `bigger-file` and `latest-mtime` methods - Validate all the files are healed and data is consistent Change-Id: I8b143f341c0db2f32086ecb6878cbfe3bdb247ce Signed-off-by: Leela Venkaiah G <lgangava@redhat.com>
* [Libfix] Fix python3 break in c_unit32()kshithijiyer2020-09-081-2/+8
| | | | | | | | | | | | | | | | | Problem: In python3, c_unit32() needs explict declaration of encoding due to which the hash calculated by compute_hash.py was wrong causeing 8 failures in latest CI runs on the newer platforms like CentOS 8. Solution: Add logic to specifiy encoding based on the version of python. Change-Id: I8907d8d266ac20d29d730a5ed948cf4da30f01b8 Signed-off-by: kshithijiyer <kshithij.ki@gmail.com>
* [Test] Add test to add brick with IO & rsync runningkshithijiyer2020-09-071-0/+151
| | | | | | | | | | | | | | | | | Test case: 1. Create, start and mount a volume. 2. Create a directory on the mount point and start linux utar. 3. Create another directory on the mount point and start rsync of linux untar directory. 4. Add bricks to the volume 5. Trigger rebalance on the volume. 6. Wait for rebalance to complete on volume. 7. Wait for I/O to complete. 8. Validate if checksum of both the untar and rsync is same. Change-Id: I008c65b1783d581129b4c35f3ff90642fffe29d8 Signed-off-by: kshithijiyer <kshithij.ki@gmail.com>
* [Test] Checks gluster compilation at glusterfs mountpointubansal2020-09-071-0/+209
| | | | | | | | | | | | | | | | | | | Steps- 1. Create a volume and mount it 2. Start gluster compilation 3. Bring down redundant bricks 4. Wait for compilation to complete 5. Bring up bricks 6. Check if mountpoint is accessible 7. Delete glusterfs from mountpoint and start gluster compilation again 8. Bring down redundant bricks 9. Wait for compilation to complete 10. Bring up bricks 11. Check if mountpoint is accessible Change-Id: Ic5a272fba7db9707c4acf776d5a505a31a34b915 Signed-off-by: ubansal <ubansal@redhat.com>
* [Testfix] Fix hostname issue with special file caseskshithijiyer2020-09-041-3/+3
| | | | | | | | | | | | | | Problem: The code fails if we have give hostname in glusto-tests config file. This is becuase we have a converstion logic present in the testcase which converts IP to hostname. Solution: Adding code to check if it's an IP and then only run the code to convert it. Change-Id: I3bb1a566d469a4c32161c91fa610da378d46e77e Signed-off-by: kshithijiyer <kshithij.ki@gmail.com>
* [Test] Add basic tests for different device fileskshithijiyer2020-09-021-0/+328
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Adding the following testcases for block, character and pipe files: Test case 1: 1. Create distributed volume with 5 sub-volumes, start and mount it. 2. Create character and block device files. 3. Check filetype of files from mount point. 4. Verify that the files are stored on only the bricks which is mentioned in trusted.glusterfs.pathinfo xattr. 5. Verify stat output from mount point and bricks. Test case 2: 1. Create distributed volume with 5 sub-volumes, start and mount it. 2. Create character and block device files. 3. Check filetype of files from mount point. 4. Verify that the files are stored on only one bricks which is mentioned in trusted.glusterfs.pathinfo xattr. 5. Delete the files. 6. Verify if the files are delete from all the bricks Test case 3: 1. Create distributed volume with 5 sub-volumes, start and mount it. 2. Create character and block device files. 3. Check filetype of files from mount point. 4. Set a custom xattr for files. 5. Verify that xattr for files is displayed on mount point and bricks. 6. Modify custom xattr value and verify that xattr for files is displayed on mount point and bricks. 7. Remove the xattr and verify that custom xattr is not displayed. 8. Verify that mount point and brick shows pathinfo xattr properly. Test case 4: 1. Create distributed volume with 5 sub-volumes, start and mount it. 2. Create a pipe file. 3. Check filetype of files from mount point. 4. Verify that the files are stored on only the bricks which is mentioned in trusted.glusterfs.pathinfo xattr. 5. Verify stat output from mount point and bricks. 6. Write data to fifo file and read data from fifo file from the other instance of the same client. Upstream bug: https://github.com/gluster/glusterfs/issues/1461 Change-Id: I0e72246ba3d6d20a5de95a95d51271337b6b5a57 Signed-off-by: kshithijiyer <kshithij.ki@gmail.com>
* [Test] Validate data, metadata, entry split-brainLeela Venkaiah G2020-09-011-0/+264
| | | | | | | | | | | | | | | | | Steps: - Create and mount a replicated volume and disable quorum, self-heal deamon - Create ~10 files from the mount point and simulate data, metadata split-brain for 2 files each - Create a dir with some files and simulate entry/gfid split brain - Validate volume successfully recognizing split-brain - Validate a lookup on split-brain files fails with EIO error on mount - Validate `heal info` and `heal info split-brain` command shows only the files that are in split-brain - Validate new files and dir's can be created from the mount Change-Id: I8caeb284c53304a74473815ae5181213c710b085 Signed-off-by: Leela Venkaiah G <lgangava@redhat.com>
* [Testfix] Fix wrong comparion in test_create_filekshithijiyer2020-08-311-1/+1
| | | | | | | | | | | | | Problem: brickdir.hashrange_contains_hash() returns true or False. However it test test_create_file it's check it ret == 1 or not Fix: Changing ret == 1 to ret. Change-Id: I53655794f10fc5d778790bdffbe65563907bef6d Signed-off-by: kshithijiyer <kshithij.ki@gmail.com>
* [Libfix] Change logic to restart glusterdkshithijiyer2020-08-311-3/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Problem: bring_bricks_online() method uses direct invocation of `service glusterd restart` at line 212. However due to change in behaviour of glusterd through patch [1] and [2] if glusterd is restart more than 6 times in an hour it goes into failed state which has to be reset using the `systemctl rest-failed` command. This causes a random failures as shown below: ``` 2020-08-25 18:00:51,600 INFO (run) root@rhs-vm24.blr.com (cp): service glusterd restart 2020-08-25 18:00:51,601 DEBUG (_get_ssh_connection) Retrieved connection from cache: root@rhs-vm24.blr.com 2020-08-25 18:00:51,830 INFO (_log_results) ^[[34;1mRETCODE (root@rhs-vm24.blr.com): 1^[[0m 2020-08-25 18:00:51,830 INFO (_log_results) ^[[31;1mSTDERR (root@rhs-vm24.blr.com)... Redirecting to /bin/systemctl restart glusterd.service Job for glusterd.service failed. See "systemctl status glusterd.service" and "journalctl -xe" for details. ^[[0m 2020-08-25 18:00:51,830 ERROR (bring_bricks_online) Unable to restart glusterd on node rhs-vm24.blr.com ``` Fix: Change the code to use restart_glusterd() from gluster_init. Links: [1] https://review.gluster.org/#/c/glusterfs/+/23751/ [2] https://review.gluster.org/#/c/glusterfs/+/23970/ Change-Id: Ibe44463ac1d444f3d2155c9ae11680c9ffd8dab9 Signed-off-by: kshithijiyer <kshithij.ki@gmail.com>
* [TestFix] Fix py2/3 compatiblity in `str.rsplit`Leela Venkaiah G2020-08-311-1/+1
| | | | | | | | - `str.rsplit` doesn't accept named args in py2 - Removed named arg to make it compatible with both versions Change-Id: Iba287ef4c98ebcbafe55f2166c99aef0c20ed9aa Signed-off-by: Leela Venkaiah G <lgangava@redhat.com>
* [Test] Checks data rename and delete in arbiter volumeubansal2020-08-241-0/+110
| | | | | | | | | | | | | | Steps: 1.Create a volume and mount it 2.Create deep directory and file in each directory 3.Rename the file 4.Check if brickpath contains old files 5.Delete all data 6.Check .glusterfs/indices/xattrop is empty 7.Check if brickpath is empty Change-Id: I04e50ef94379daa344be1ae1d19cf2d66f8f460b Signed-off-by: ubansal <ubansal@redhat.com>
* [Test] Creates a split brain and verifies IO failureubansal2020-08-241-0/+165
| | | | | | | | | | | | | | | | | | | | | Steps: 1. Create a volume and mount it 2. Disable heal and cluster-quorum-count 3. Bring down one data and arbiter brick from one subvol 4. Write IO and validate it 5. Bring up bricks 6. Bring down another data brick and arbiter brick from the same subvol 7. Write IO and validate it 8. Bring up bricks 9. Check if split-brain is created 10. Write IO -> should fail 11. Enable heal and cluster-quorum-count 12. Write IO -> should fail Change-Id: I229b58c1bcd70dcd87d35dc410e12f51b032b9c4 Signed-off-by: ubansal <ubansal@redhat.com>
* [Libfix] Add interval_check for monitor_heal_completionBala Konda Reddy M2020-08-211-3/+6
| | | | | | | | | | | | | | | | | | | | | | | Adding a parameter `interval_check` will ease the user and help in the reducing the waiting time for heal in scenarios. By default, ls -l <brickpath> | grep -ve "xattrop-" | wc -l is checked for every 2 minutes. Problem: I have 100 files that needs to be healed, after 2 minutes. suppose there are only 2/3 files that needs to be healed. With the existing approach the next check will wait for whole 2 minutes even though the files would have healed by 10 seconds after previouscheck. Solution: Giving an option for the user to check at which interval to check for the files that needs to healed, we can reduce the unnecssary waiting time. It won't affect the existing cases as the interval_check is defaults to 120. Change-Id: Ib288c75549644b6f6c94b5288f1c07cce7933915 Signed-off-by: Bala Konda Reddy M <bala12352@gmail.com>
* [Test] Directory creation with subvol downBala Konda Reddy M2020-08-211-0/+194
| | | | | | | | | | | | | | | | | | | | | | Test Steps: 1. Create a distributed-replicated(3X3)/distributed-arbiter(3X(2+1)) and mount it on one client 2. Kill 3 bricks corresponding to the 1st subvol 3. Unmount and remount the volume on the same client 4. Create deep dir from mount point 'dir1/subdir1/deepdir1' 5. Create files under dir1/subdir1/deepdir1; touch <filename> 6. Now bring all sub-vols up by volume start force 7. Validate backend bricks for dir creation, the subvol which is offline will have no dirs created, whereas other subvols will have dirs created from step 4 8. Trigger heal from client by '#find . | xargs stat' 9. Verify that the directory entries are created on all back-end bricks 10. Create new dir (dir2) on location dir1/subdir1/deepdir1 11. Trigger rebalance and wait for the completion 12. Check backend bricks for all entries of dirs Change-Id: I4d8f39e69c84c28ec238ea73935cd7ca0288bffc Signed-off-by: Bala Konda Reddy M <bala12352@gmail.com>
* [Testfix] Remove redundant logging - Part 2Bala Konda Reddy M2020-08-215-155/+9
| | | | | | | | | | | | | | | | | | Problem: In most of the testcases due to redundant logging, the performance of the whole suite completion time is affected. Solution: In BVT Test suite, there are 184 g.log.info messages more than half of them are redundant. Removed logs wherever it is not required. Added missing get_super_method for setUp and tearDown for one testcase, modified increment in the test. Change-Id: I19e4462f2565906710c2be117bc7c16c121ddd32 Signed-off-by: Bala Konda Reddy M <bala12352@gmail.com>
* [Test] Test conservative merge between two bricksBala Konda Reddy M2020-08-211-0/+175
| | | | | | | | | | | | | | | | | | | | | | Test Steps: 1) Create 1x3 volume and fuse mount the volume 2) On mount created a dir dir1 3) Pkill glusterfsd on node n1 (b2 on node2 and b3 and node3 up) 4) touch f{1..10} on the mountpoint 5) b2 and b3 xattrs would be blaming b1 as files are created while b1 is down 6) Reset the b3 xattrs to NOT blame b1 by using setattr 7) Now pkill glusterfsd of b2 on node2 8) Restart glusterd on node1 to bring up b1 9) Now bricks b1 online , b2 down, b3 online 10) touch x{1..10} under dir1 itself 11) Again reset xattr on node3 of b3 so that it doesn't blame b2, as done for b1 in step 6 12) Do restart glusterd on node2 hosting b2 to bring all bricks online 13) Check for heal info, split-brain and arequal for the bricks Change-Id: Ieea875dd7243c7f8d2c6959aebde220508134d7a Signed-off-by: Bala Konda Reddy M <bala12352@gmail.com>
* [Testfix] Add logic to log more infokshithijiyer2020-08-201-6/+26
| | | | | | | | Add logic to do ls -l before and after. Add logic to set all log-levels to debug. Change-Id: I512e3b229fe9e2126f6c596fdc031c00a25fbe0b Signed-off-by: kshithijiyer <kshithij.ki@gmail.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>