summaryrefslogtreecommitdiffstats
path: root/tests/functional/glusterd/test_rebalance_spurious.py
diff options
context:
space:
mode:
authorSri Vignesh <sselvan@redhat.com>2020-03-03 10:35:22 +0530
committerSri Vignesh <sselvan@redhat.com>2020-03-03 09:51:09 +0000
commitb9ab4a1c72b7841024facc753ae4ead8953857b0 (patch)
treed5b9e2f66f38ee25841b0619cbefb3b919f28c09 /tests/functional/glusterd/test_rebalance_spurious.py
parent7635a3ba91b5931ddf6a29b6b35498fbe8401c96 (diff)
[testfix] Add timeout to fix failures
Add extra time for beaker machines to validate the testcases for test_rebalance_spurious.py added cleanup in teardown because fix layout patch is still not merged. Change-Id: I7ee8324ff136bbdb74600b730b4b802d86116427 Signed-off-by: Sri Vignesh <sselvan@redhat.com>
Diffstat (limited to 'tests/functional/glusterd/test_rebalance_spurious.py')
-rw-r--r--tests/functional/glusterd/test_rebalance_spurious.py19
1 files changed, 17 insertions, 2 deletions
diff --git a/tests/functional/glusterd/test_rebalance_spurious.py b/tests/functional/glusterd/test_rebalance_spurious.py
index dab69b7..fa9f220 100644
--- a/tests/functional/glusterd/test_rebalance_spurious.py
+++ b/tests/functional/glusterd/test_rebalance_spurious.py
@@ -25,12 +25,13 @@ from glustolibs.gluster.peer_ops import (peer_probe, peer_detach,
peer_probe_servers,
nodes_from_pool_list,
is_peer_connected)
-from glustolibs.gluster.lib_utils import form_bricks_list
+from glustolibs.gluster.lib_utils import (
+ form_bricks_list, get_servers_bricks_dict)
from glustolibs.gluster.brick_ops import remove_brick
from glustolibs.gluster.exceptions import ExecutionError
from glustolibs.gluster.rebalance_ops import (rebalance_start,
wait_for_fix_layout_to_complete)
-from glustolibs.gluster.glusterdir import mkdir
+from glustolibs.gluster.glusterdir import mkdir, get_dir_contents
from glustolibs.gluster.mount_ops import mount_volume, umount_volume
from glustolibs.gluster.glusterfile import get_fattr
@@ -76,6 +77,20 @@ class TestSpuriousRebalance(GlusterBaseClass):
"servers %s" % self.servers)
g.log.info("Peer probe success for detached "
"servers %s", self.servers)
+
+ bricks = get_servers_bricks_dict(self.servers,
+ self.all_servers_info)
+
+ # Checking brick dir and cleaning it.
+ for server in self.servers:
+ for brick in bricks[server]:
+ if get_dir_contents(server, brick):
+ cmd = "rm -rf " + brick + "/*"
+ ret, _, _ = g.run(server, cmd)
+ if ret:
+ raise ExecutionError("Failed to delete the brick "
+ "dirs of deleted volume.")
+
self.get_super_method(self, 'tearDown')()
def test_spurious_rebalance(self):