diff options
author | Sri Vignesh <sselvan@redhat.com> | 2019-12-27 12:16:33 +0530 |
---|---|---|
committer | Bala Konda Reddy M <bala12352@gmail.com> | 2020-02-18 05:45:36 +0000 |
commit | 25064013d6c0889db3d2bf931b0b2d01c72f6a96 (patch) | |
tree | 52e1b4814202b6445a717a27195fd5a7b16b6b2c /tests/functional/glusterd/test_remove_brick_after_restart_glusterd.py | |
parent | 49e9cdbc710ed25434f5e7faec94281afa8d54ce (diff) |
Add steps to stabilize the existing content in glusterd
Added wait_for_io_to_complete function to testcases
used wait_for_glusterd function
and wait_for_peer_connect function
Change-Id: I4811848aad8cca4198cc93d8e200dfc47ae7ac9b
Signed-off-by: Sri Vignesh <sselvan@redhat.com>
Diffstat (limited to 'tests/functional/glusterd/test_remove_brick_after_restart_glusterd.py')
-rw-r--r-- | tests/functional/glusterd/test_remove_brick_after_restart_glusterd.py | 17 |
1 files changed, 15 insertions, 2 deletions
diff --git a/tests/functional/glusterd/test_remove_brick_after_restart_glusterd.py b/tests/functional/glusterd/test_remove_brick_after_restart_glusterd.py index a538ba073..4dd2d3d13 100644 --- a/tests/functional/glusterd/test_remove_brick_after_restart_glusterd.py +++ b/tests/functional/glusterd/test_remove_brick_after_restart_glusterd.py @@ -1,4 +1,4 @@ -# Copyright (C) 2018 Red Hat, Inc. <http://www.redhat.com> +# Copyright (C) 2018-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 @@ -29,7 +29,10 @@ from glustolibs.gluster.lib_utils import form_bricks_list from glustolibs.gluster.brick_ops import remove_brick from glustolibs.gluster.exceptions import ExecutionError from glustolibs.gluster.mount_ops import mount_volume, umount_volume -from glustolibs.io.utils import validate_io_procs +from glustolibs.io.utils import ( + wait_for_io_to_complete, + validate_io_procs) +from glustolibs.gluster.glusterdir import rmdir from glustolibs.gluster.gluster_init import restart_glusterd @@ -54,6 +57,10 @@ class TestRemoveBrickAfterRestartGlusterd(GlusterBaseClass): self.mounts[0].mountpoint, mtype=self.mount_type) self.assertTrue(ret, ("Failed to Unmount Volume %s" % self.volname)) g.log.info("Successfully Unmounted Volume %s", self.volname) + ret = rmdir(self.mounts[0].client_system, self.mounts[0].mountpoint) + if not ret: + raise ExecutionError("Failed to remove directory mount directory.") + g.log.info("Mount directory is removed successfully") # Clean up all volumes and peer probe to form cluster vol_list = get_volume_list(self.mnode) @@ -165,6 +172,12 @@ class TestRemoveBrickAfterRestartGlusterd(GlusterBaseClass): user=self.mounts[0].user) self.all_mounts_procs.append(proc) self.io_validation_complete = False + + # wait for io to complete + self.assertTrue( + wait_for_io_to_complete(self.all_mounts_procs, self.mounts), + "Io failed to complete on some of the clients") + # Validate IO ret = validate_io_procs(self.all_mounts_procs, self.mounts) self.io_validation_complete = True |