diff options
author | kshithijiyer <kshithij.ki@gmail.com> | 2020-10-29 15:18:19 +0530 |
---|---|---|
committer | kshithijiyer <kshithij.ki@gmail.com> | 2020-10-29 15:21:49 +0530 |
commit | 858a0227eb57d8ca5409b5bf105ac254ce79a124 (patch) | |
tree | 563911396c62005aa8752b48e1e65abdea007ee2 /tests/functional/dht | |
parent | c4e013bc9ad76e5256f407c22720308ed7fdac28 (diff) |
[Lib] Add get_usable_size_per_disk() to library
Changes done in this patch:
1. Adding get_usable_size_per_disk() to lib_utils.py.
2. Removing the redundant code from
dht/test_rename_with_brick_min_free_limit_crossed.py.
Change-Id: I80c1d6124b7f0ce562d8608565f7c46fd8612d0d
Signed-off-by: kshithijiyer <kshithij.ki@gmail.com>
Diffstat (limited to 'tests/functional/dht')
-rw-r--r-- | tests/functional/dht/test_rename_with_brick_min_free_limit_crossed.py | 7 |
1 files changed, 2 insertions, 5 deletions
diff --git a/tests/functional/dht/test_rename_with_brick_min_free_limit_crossed.py b/tests/functional/dht/test_rename_with_brick_min_free_limit_crossed.py index 0745ef565..0e481fce0 100644 --- a/tests/functional/dht/test_rename_with_brick_min_free_limit_crossed.py +++ b/tests/functional/dht/test_rename_with_brick_min_free_limit_crossed.py @@ -17,7 +17,7 @@ from glusto.core import Glusto as g from glustolibs.gluster.gluster_base_class import GlusterBaseClass, runs_on from glustolibs.gluster.exceptions import ExecutionError -from glustolibs.gluster.lib_utils import get_size_of_mountpoint +from glustolibs.gluster.lib_utils import get_usable_size_per_disk from glustolibs.gluster.brick_libs import get_all_bricks @@ -61,10 +61,7 @@ class TestRenameWithBricksMinFreeLimitCrossed(GlusterBaseClass): # Calculate the usable size and fill till it reachs # min free limit - node, brick_path = bricks[0].split(':') - size = int(get_size_of_mountpoint(node, brick_path)) - min_free_size = size * 10 // 100 - usable_size = ((size - min_free_size) // 1048576) + 1 + usable_size = get_usable_size_per_disk(bricks[0]) ret, _, _ = g.run(self.first_client, "fallocate -l {}G {}/file" .format(usable_size, self.mount_point)) self.assertFalse(ret, "Failed to fill disk to min free limit") |