From b9ab4a1c72b7841024facc753ae4ead8953857b0 Mon Sep 17 00:00:00 2001 From: Sri Vignesh Date: Tue, 3 Mar 2020 10:35:22 +0530 Subject: [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 --- tests/functional/glusterd/test_rebalance_spurious.py | 19 +++++++++++++++++-- 1 file changed, 17 insertions(+), 2 deletions(-) (limited to 'tests/functional/glusterd/test_rebalance_spurious.py') diff --git a/tests/functional/glusterd/test_rebalance_spurious.py b/tests/functional/glusterd/test_rebalance_spurious.py index dab69b7b2..fa9f22084 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): -- cgit