summaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorShwetha Panduranga <spandura@redhat.com>2016-11-09 07:33:11 +0530
committerJonathan Holloway <jholloway@redhat.com>2016-11-30 10:31:43 -0800
commit279c2a99af5cb45b0b889aa8da8450a92969e216 (patch)
tree857860cda79998f49bbc7181b8d7046689d1a666 /tests
parent5699e2305a44db35084b7bd5526832b7476fcf0a (diff)
Improving the GlusterVolumeBaseClass to check for nfs and smb exports.
Removing starting glusterd, peer probe from VolumeBaseClass and assuming the config/setup phase to handle the glusterd, peer probe. Changing the BVT case to baseclass 'GlusterVolumeBaseClass'. Change-Id: I930d785dfe652b826e4a1853f30a954f98d15ede Signed-off-by: Shwetha Panduranga <spandura@redhat.com>
Diffstat (limited to 'tests')
-rw-r--r--tests/bvt/test_bvt_lite_and_plus.py95
1 files changed, 6 insertions, 89 deletions
diff --git a/tests/bvt/test_bvt_lite_and_plus.py b/tests/bvt/test_bvt_lite_and_plus.py
index e47c13477..a77b6beea 100644
--- a/tests/bvt/test_bvt_lite_and_plus.py
+++ b/tests/bvt/test_bvt_lite_and_plus.py
@@ -18,19 +18,15 @@
import pytest
import os
from glusto.core import Glusto as g
-from glustolibs.gluster.gluster_base_class import GlusterBaseClass, runs_on
-from glustolibs.gluster.gluster_init import start_glusterd
-from glustolibs.gluster.peer_ops import (peer_probe_servers, is_peer_connected,
- peer_status)
-from glustolibs.gluster.volume_libs import setup_volume, cleanup_volume
-from glustolibs.gluster.volume_ops import volume_info, volume_status
+from glustolibs.gluster.gluster_base_class import (GlusterVolumeBaseClass,
+ runs_on)
import time
@runs_on([['replicated', 'distributed', 'distributed-replicated',
'dispersed', 'distributed-dispersed'],
['glusterfs', 'nfs', 'cifs']])
-class BvtTestsClass(GlusterBaseClass):
+class BvtTestsClass(GlusterVolumeBaseClass):
"""Class containing case for : BVT Lite and BVT Plus.
BVT Lite: Run the case on dis-rep volume with glusterfs, nfs, cifs
@@ -41,73 +37,10 @@ class BvtTestsClass(GlusterBaseClass):
"""
@classmethod
def setUpClass(cls):
- """Following are the setps in setupclass
- - Start glusterd on all servers
- - Peer Probe
- - Setup the volume
- - Mount the volume
+ """Setup Volume and Mounts.
"""
- GlusterBaseClass.setUpClass.im_func(cls)
g.log.info("Starting %s:" % cls.__name__)
-
- # Start Glusterd
- ret = start_glusterd(servers=cls.servers)
- assert (ret == True), "glusterd did not start on at least one server"
-
- # PeerProbe servers
- ret = peer_probe_servers(mnode=cls.servers[0], servers=cls.servers[1:])
- assert (ret == True), "Unable to peer probe one or more servers"
-
- # Validate if peer is connected from all the servers
- for server in cls.servers:
- ret = is_peer_connected(server, cls.servers)
- assert (ret == True), "Validating Peers to be in Cluster Failed"
-
- # Print Peer Status from mnode
- _, _, _ = peer_status(cls.mnode)
-
- # Setup Volume
- ret = setup_volume(mnode=cls.mnode,
- all_servers_info=cls.all_servers_info,
- volume_config=cls.volume, force=True)
- assert (ret == True), "Setup volume %s failed" % cls.volname
- time.sleep(10)
-
- # Print Volume Info and Status
- _, _, _ = volume_info(cls.mnode, cls.volname)
-
- _, _, _ = volume_status(cls.mnode, cls.volname)
-
- # Validate if volume is exported or not
- if 'nfs' in cls.mount_type:
- cmd = "showmount -e localhost"
- _, _, _ = g.run(cls.mnode, cmd)
-
- cmd = "showmount -e localhost | grep %s" % cls.volname
- ret, _, _ = g.run(cls.mnode, cmd)
- assert (ret == 0), "Volume %s not exported" % cls.volname
-
- if 'cifs' in cls.mount_type:
- cmd = "smbclient -L localhost"
- _, _, _ = g.run(cls.mnode, cmd)
-
- cmd = ("smbclient -L localhost -U | grep -i -Fw gluster-%s " %
- cls.volname)
- ret, _, _ = g.run(cls.mnode, cmd)
- assert (ret == 0), ("Volume %s not accessable via SMB/CIFS share" %
- cls.volname)
-
- # Create Mounts
- rc = True
- for mount_obj in cls.mounts:
- ret = mount_obj.mount()
- if not ret:
- g.log.error("Unable to mount volume '%s:%s' on '%s:%s'" %
- (mount_obj.server_system, mount_obj.volname,
- mount_obj.client_system, mount_obj.mountpoint))
- rc = False
- assert (rc == True), ("Mounting volume %s on few clients failed" %
- cls.volname)
+ GlusterVolumeBaseClass.setUpClass.im_func(cls)
# Upload io scripts
cls.script_local_path = ("/usr/share/glustolibs/io/"
@@ -194,20 +127,4 @@ class BvtTestsClass(GlusterBaseClass):
def tearDownClass(cls):
"""Cleanup mount and Cleanup the volume
"""
- GlusterBaseClass.tearDownClass.im_func(cls)
-
- # Unmount mounts
- rc = True
- for mount_obj in cls.mounts:
- ret = mount_obj.unmount()
- if not ret:
- g.log.error("Unable to unmount volume '%s:%s' on '%s:%s'" %
- (mount_obj.server_system, mount_obj.volname,
- mount_obj.client_system, mount_obj.mountpoint))
- rc = False
- assert (rc == True), ("UnMounting volume %s on few clients failed" %
- cls.volname)
-
- # Cleanup Volume
- ret = cleanup_volume(mnode=cls.mnode, volname=cls.volname)
- assert (ret == True), ("cleanup volume %s failed" % cls.volname)
+ GlusterVolumeBaseClass.tearDownClass.im_func(cls)