From 809704b6665a6bfa50049dabfb85d5d242e9e12a Mon Sep 17 00:00:00 2001 From: Sunil Kumar Acharya Date: Tue, 23 Jan 2018 15:09:03 +0530 Subject: tests: Test case to verify brick consumable size When bricks of various sizes are used to create a disperse volume, volume size should be of the size (number of data bricks * least of brick size) RHG3-11124 Change-Id: Ic791212bf028328996b896ae4896cf860c153264 Signed-off-by: Sunil Kumar Acharya --- glustolibs-gluster/glustolibs/gluster/lib_utils.py | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) (limited to 'glustolibs-gluster') diff --git a/glustolibs-gluster/glustolibs/gluster/lib_utils.py b/glustolibs-gluster/glustolibs/gluster/lib_utils.py index 0b86291b0..e4459eec2 100644 --- a/glustolibs-gluster/glustolibs/gluster/lib_utils.py +++ b/glustolibs-gluster/glustolibs/gluster/lib_utils.py @@ -921,3 +921,22 @@ def add_services_to_firewall(nodes, firewall_service, permanent=False): _rc = False return _rc + + +def get_size_of_mountpoint(node, mount_point): + """ + get_size_of_mountpoint: + Returns the size in blocks for the mount point + + Args: + node - node on which path is mounted + mount_point - mount point path + + Returns: + Size of the mount point in blocks or none. + """ + + cmd = "df %s | grep -v '^Filesystem' | awk '{print $4}'" % (mount_point) + _, out, _ = g.run(node, cmd) + + return out -- cgit