summaryrefslogtreecommitdiffstats
path: root/glustolibs-gluster/glustolibs/gluster/lib_utils.py
diff options
context:
space:
mode:
authorArthy Loganathan <aloganat@redhat.com>2017-06-07 17:44:54 +0530
committerJonathan Holloway <jholloway@redhat.com>2017-06-20 15:30:46 +0000
commite95d95508064e0e93f24dce870bc990824c9d4ce (patch)
tree206bdd0db78e40b89d32d7acc26591fdfb8fe6d3 /glustolibs-gluster/glustolibs/gluster/lib_utils.py
parentdfe4514f6318dc89296abaade577d54f531bb58a (diff)
Added nfs ganesha tests to run IO test suites from multiple clients and checks nfs ganesha behaviour
Change-Id: I2dc7f0fb016982b7b7fa4a87c0310e4c96376f94 Signed-off-by: Arthy Loganathan <aloganat@redhat.com>
Diffstat (limited to 'glustolibs-gluster/glustolibs/gluster/lib_utils.py')
-rw-r--r--glustolibs-gluster/glustolibs/gluster/lib_utils.py52
1 files changed, 52 insertions, 0 deletions
diff --git a/glustolibs-gluster/glustolibs/gluster/lib_utils.py b/glustolibs-gluster/glustolibs/gluster/lib_utils.py
index d1329d6..1b3822d 100644
--- a/glustolibs-gluster/glustolibs/gluster/lib_utils.py
+++ b/glustolibs-gluster/glustolibs/gluster/lib_utils.py
@@ -659,3 +659,55 @@ def check_if_dir_is_filled(mnode, dirname, percent_to_fill,
" percentage")
return True
return False
+
+
+def install_epel(servers):
+ """
+ Module to install epel in rhel/centos/fedora systems.
+
+ Args:
+ servers (list): servers in which epel to be installed.
+
+ Returns:
+ bool: True, if epel is installed successfully, False otherwise
+
+ Example:
+ install_epel(["abc.com", "def.com"])
+ """
+
+ rt = True
+ results = g.run_parallel(servers, "yum list installed epel-release")
+ for server in servers:
+ if results[server][0] != 0:
+ ret, out, _ = g.run(server,
+ "cat /etc/redhat-release")
+ if ret != 0:
+ g.log.error("Failed to recognize OS release")
+ rt = False
+ release_string = out
+ if "release 5" in release_string:
+ ret, _, _ = g.run(server,
+ "yum -y install http://dl.fedoraproject.org/"
+ "pub/epel/epel-release-latest-5.noarch.rpm")
+ if ret != 0:
+ g.log.error("Epel install failed")
+ rt = False
+ elif "release 6" in release_string:
+ ret, _, _ = g.run(server,
+ "yum -y install http://dl.fedoraproject.org/"
+ "pub/epel/epel-release-latest-6.noarch.rpm")
+ if ret != 0:
+ g.log.error("Epel install failed")
+ rt = False
+ elif (("release 7" in release_string) or
+ ("Fedora" in release_string)):
+ ret, _, _ = g.run(server,
+ "yum -y install http://dl.fedoraproject.org/"
+ "pub/epel/epel-release-latest-7.noarch.rpm")
+ if ret != 0:
+ g.log.error("Epel install failed")
+ rt = False
+ else:
+ g.log.error("Unrecognized release. Skipping epel install")
+ rt = False
+ return rt