summaryrefslogtreecommitdiffstats
path: root/glustolibs-gluster/glustolibs/gluster
diff options
context:
space:
mode:
authorSunil Kumar Acharya <sheggodu@redhat.com>2018-01-23 15:09:03 +0530
committerJonathan Holloway <jholloway@redhat.com>2018-06-14 04:48:00 +0000
commit809704b6665a6bfa50049dabfb85d5d242e9e12a (patch)
tree0e5c0f22441f5aca32d642f6ee96d713e07ba808 /glustolibs-gluster/glustolibs/gluster
parent1fc278d76394b64c4a2b5be8344be1cb25f92430 (diff)
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 <sheggodu@redhat.com>
Diffstat (limited to 'glustolibs-gluster/glustolibs/gluster')
-rw-r--r--glustolibs-gluster/glustolibs/gluster/lib_utils.py19
1 files changed, 19 insertions, 0 deletions
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