summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorubansal <ubansal@redhat.com>2020-06-25 15:29:29 +0530
committerBala Konda Reddy M <bala12352@gmail.com>2020-06-26 05:29:38 +0000
commitc5616cd0249993813440e1a51132755c6ef7f9bf (patch)
treed90ba198096d6ee64d7043449fa373c369ddcade
parent1260cc91802bd1903ebdcb68d2e2b1b37c8a0ee8 (diff)
[TestFix] Test FD IO's on replace-brick in EC volume
Change-Id: Ib39894e9f44c41f5539377c5c124ad45a786cbb3 Signed-off-by: ubansal <ubansal@redhat.com>
-rw-r--r--tests/functional/disperse/test_ec_replace_brick.py45
1 files changed, 41 insertions, 4 deletions
diff --git a/tests/functional/disperse/test_ec_replace_brick.py b/tests/functional/disperse/test_ec_replace_brick.py
index 3e6a955..b695cc0 100644
--- a/tests/functional/disperse/test_ec_replace_brick.py
+++ b/tests/functional/disperse/test_ec_replace_brick.py
@@ -44,9 +44,12 @@ class TestEcBrickReplace(GlusterBaseClass):
cls.get_super_method(cls, 'setUpClass')()
# Upload io scripts for running IO on mounts
- cls.script_upload_path = ("/usr/share/glustolibs/io/scripts/"
- "file_dir_ops.py")
- ret = upload_scripts(cls.clients, [cls.script_upload_path])
+ cls.script_upload_path1 = ("/usr/share/glustolibs/io/scripts/"
+ "file_dir_ops.py")
+ cls.script_upload_path2 = ("/usr/share/glustolibs/io/scripts/"
+ "fd_writes.py")
+ ret = upload_scripts(cls.clients, [cls.script_upload_path1,
+ cls.script_upload_path2])
if not ret:
raise ExecutionError("Failed to upload IO scripts to clients %s"
% cls.clients)
@@ -300,7 +303,7 @@ class TestEcBrickReplace(GlusterBaseClass):
"--dir-length 10 "
"--max-num-of-dirs 5 "
"--num-of-files 5 %s/dir1" % (
- self.script_upload_path, count,
+ self.script_upload_path1, count,
mount_obj.mountpoint))
proc = g.run_async(mount_obj.client_system, cmd,
user=mount_obj.user)
@@ -324,6 +327,40 @@ class TestEcBrickReplace(GlusterBaseClass):
self.assertTrue(ret, "IO failed on some of the clients")
g.log.info("Successfully validated all io's")
+ # Create 2 directories and start IO's which opens FD
+ ret = mkdir(self.mounts[0].client_system, "%s/count{1..2}"
+ % self.mounts[0].mountpoint)
+ self.assertTrue(ret, "Failed to create directories")
+ g.log.info("Directories created on %s successfully", self.mounts[0])
+
+ all_fd_procs, count = [], 1
+ for mount_obj in self.mounts:
+ cmd = ("cd %s ;/usr/bin/env python %s -n 10 -t 120 "
+ "-d 5 -c 16 --dir count%s" % (
+ mount_obj.mountpoint,
+ self.script_upload_path2, count))
+ proc = g.run_async(mount_obj.client_system, cmd,
+ user=mount_obj.user)
+ all_fd_procs.append(proc)
+ count += 1
+
+ # Replacing a brick while open FD IO's are going on
+ ret = replace_brick_from_volume(self.mnode, self.volname,
+ self.servers,
+ self.all_servers_info)
+ self.assertTrue(ret, "Unexpected:Replace brick is not successful")
+ g.log.info("Expected : Replace brick is successful")
+
+ # Wait for brick to come online
+ ret = wait_for_bricks_to_be_online(self.mnode, self.volname)
+ self.assertTrue(ret, "Unexpected:Bricks are not online")
+ g.log.info("Expected : Bricks are online")
+
+ # Validating IO's and waiting to complete
+ ret = validate_io_procs(all_fd_procs, self.mounts)
+ self.assertTrue(ret, "IO failed on some of the clients")
+ g.log.info("Successfully validated all io's")
+
# Close connection and check file exist for memory log
ret = file_exists(self.mnode,
'/var/log/glusterfs/mem_usage.log')