summaryrefslogtreecommitdiffstats
path: root/tests/functional/dht/test_add_brick_while_remove_brick_is_in_progress.py
diff options
context:
space:
mode:
Diffstat (limited to 'tests/functional/dht/test_add_brick_while_remove_brick_is_in_progress.py')
-rw-r--r--tests/functional/dht/test_add_brick_while_remove_brick_is_in_progress.py32
1 files changed, 19 insertions, 13 deletions
diff --git a/tests/functional/dht/test_add_brick_while_remove_brick_is_in_progress.py b/tests/functional/dht/test_add_brick_while_remove_brick_is_in_progress.py
index 9451593a9..9c23c131e 100644
--- a/tests/functional/dht/test_add_brick_while_remove_brick_is_in_progress.py
+++ b/tests/functional/dht/test_add_brick_while_remove_brick_is_in_progress.py
@@ -1,4 +1,4 @@
-# Copyright (C) 2017-2018 Red Hat, Inc. <http://www.redhat.com>
+# Copyright (C) 2017-2020 Red Hat, Inc. <http://www.redhat.com>
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
@@ -14,7 +14,6 @@
# with this program; if not, write to the Free Software Foundation, Inc.,
# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
-
from glusto.core import Glusto as g
from glustolibs.gluster.brick_ops import add_brick, remove_brick
@@ -41,16 +40,14 @@ class RemoveBrickValidation(GlusterBaseClass):
def setUpClass(cls):
# Calling GlusterBaseClass setUpClass
- GlusterBaseClass.setUpClass.im_func(cls)
+ cls.get_super_method(cls, 'setUpClass')()
# Upload io scripts for running IO on mounts
g.log.info("Upload io scripts to clients %s for running IO on "
"mounts", cls.clients)
- script_local_path = ("/usr/share/glustolibs/io/scripts/"
- "file_dir_ops.py")
cls.script_upload_path = ("/usr/share/glustolibs/io/scripts/"
"file_dir_ops.py")
- ret = upload_scripts(cls.clients, script_local_path)
+ ret = upload_scripts(cls.clients, cls.script_upload_path)
if not ret:
raise ExecutionError("Failed to upload IO scripts to clients %s" %
cls.clients)
@@ -60,7 +57,7 @@ class RemoveBrickValidation(GlusterBaseClass):
def setUp(self):
# Calling GlusterBaseClass setUp
- GlusterBaseClass.setUp.im_func(self)
+ self.get_super_method(self, 'setUp')()
# Setup Volume and Mount Volume
g.log.info("Starting to Setup Volume and Mount Volume")
@@ -86,14 +83,14 @@ class RemoveBrickValidation(GlusterBaseClass):
for index, mount_obj in enumerate(self.mounts, start=1):
g.log.info("Starting IO on %s:%s", mount_obj.client_system,
mount_obj.mountpoint)
- cmd = ("python %s create_deep_dirs_with_files "
+ cmd = ("/usr/bin/env python %s create_deep_dirs_with_files "
"--dirname-start-num %d "
"--dir-depth 2 "
"--dir-length 2 "
"--max-num-of-dirs 2 "
- "--num-of-files 10 %s" % (self.script_upload_path,
- index + 10,
- mount_obj.mountpoint))
+ "--num-of-files 10 %s" % (
+ self.script_upload_path,
+ index + 10, mount_obj.mountpoint))
proc = g.run_async(mount_obj.client_system, cmd,
user=mount_obj.user)
all_mounts_procs.append(proc)
@@ -134,7 +131,7 @@ class RemoveBrickValidation(GlusterBaseClass):
g.log.info("Successful in Unmount Volume and Cleanup Volume")
# Calling GlusterBaseClass tearDown
- GlusterBaseClass.tearDown.im_func(self)
+ self.get_super_method(self, 'tearDown')()
def test_add_brick_while_remove_brick_is_in_progress(self):
# DHT Layout and hash validation
@@ -175,9 +172,18 @@ class RemoveBrickValidation(GlusterBaseClass):
g.log.info(out)
# Expanding volume while volume shrink is in-progress
- g.log.info("Volume %s: Expand volume while volume shrink in-progress")
+ g.log.info("Volume %s: Expand volume while volume shrink in-progress",
+ self.volname)
_, _, err = add_brick(self.mnode, self.volname, self.add_brick_list)
self.assertIn("rebalance is in progress", err, "Successfully added"
"bricks to the volume <NOT EXPECTED>")
g.log.info("Volume %s: Failed to add-bricks while volume shrink "
"in-progress <EXPECTED>", self.volname)
+
+ # cleanup add-bricks list
+ for brick in self.add_brick_list:
+ brick_node, brick_path = brick.split(":")
+ ret, _, _ = g.run(brick_node, ("rm -rf %s", brick_path))
+ if ret != 0:
+ g.log.error("Failed to clean %s:%s", brick_node, brick_path)
+ g.log.info("Successfully cleaned backend add-brick bricks list")