diff options
Diffstat (limited to 'tests/functional/authentication')
8 files changed, 203 insertions, 79 deletions
diff --git a/tests/functional/authentication/test_auth_allow.py b/tests/functional/authentication/test_auth_allow.py index 194ea189c..1f4b4b067 100644 --- a/tests/functional/authentication/test_auth_allow.py +++ b/tests/functional/authentication/test_auth_allow.py @@ -25,8 +25,7 @@ from glustolibs.gluster.auth_ops import set_auth_allow @runs_on([['replicated', 'distributed', 'distributed-replicated', - 'dispersed', 'distributed-dispersed'], - ['glusterfs']]) + 'dispersed', 'distributed-dispersed'], ['glusterfs']]) class FuseAuthAllow(GlusterBaseClass): """ Tests to verify auth.allow feature on fuse mount. @@ -38,13 +37,10 @@ class FuseAuthAllow(GlusterBaseClass): """ cls.get_super_method(cls, 'setUpClass')() # Create and start volume - g.log.info("Starting volume setup process %s", cls.volname) ret = cls.setup_volume() if not ret: raise ExecutionError("Failed to setup " "and start volume %s" % cls.volname) - g.log.info("Successfully created and started the volume: %s", - cls.volname) def authenticated_mount(self, mount_obj): """ @@ -147,7 +143,6 @@ class FuseAuthAllow(GlusterBaseClass): auth_dict = {'all': [self.mounts[0].client_system]} ret = set_auth_allow(self.volname, self.mnode, auth_dict) self.assertTrue(ret, "Failed to set authentication") - g.log.info("Successfully set authentication on volume") # Mounting volume on client1 self.authenticated_mount(self.mounts[0]) @@ -179,7 +174,6 @@ class FuseAuthAllow(GlusterBaseClass): auth_dict = {'all': [hostname_client1.strip()]} ret = set_auth_allow(self.volname, self.mnode, auth_dict) self.assertTrue(ret, "Failed to set authentication") - g.log.info("Successfully set authentication on volume") # Mounting volume on client1 self.authenticated_mount(self.mounts[0]) @@ -204,8 +198,9 @@ class FuseAuthAllow(GlusterBaseClass): """ Cleanup volume """ - g.log.info("Cleaning up volume") ret = self.cleanup_volume() if not ret: raise ExecutionError("Failed to cleanup volume.") - g.log.info("Volume cleanup was successful.") + + # Calling GlusterBaseClass tearDown + self.get_super_method(self, 'tearDown')() diff --git a/tests/functional/authentication/test_auth_allow_with_brick_down.py b/tests/functional/authentication/test_auth_allow_with_brick_down.py new file mode 100644 index 000000000..8fe365aed --- /dev/null +++ b/tests/functional/authentication/test_auth_allow_with_brick_down.py @@ -0,0 +1,171 @@ +# Copyright (C) 2021 Red Hat, Inc. <http://www.redhat.com> +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2 of the License, or +# any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License along +# with this program; if not, write to the Free Software Foundation, Inc., +# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + +""" Description: + Test cases in this module tests the authentication allow feature +""" +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.auth_ops import set_auth_allow +from glustolibs.gluster.brick_libs import (get_all_bricks, + bring_bricks_offline, + bring_bricks_online, + are_bricks_offline) +from glustolibs.gluster.heal_ops import trigger_heal +from glustolibs.gluster.heal_libs import (monitor_heal_completion, + is_heal_complete) + + +@runs_on([['distributed-replicated', 'distributed-dispersed'], ['glusterfs']]) +class FuseAuthAllow(GlusterBaseClass): + """ + Tests to verify auth.allow feature on fuse mount. + """ + @classmethod + def setUpClass(cls): + """ + Create and start volume + """ + cls.get_super_method(cls, 'setUpClass')() + # Create and start volume + ret = cls.setup_volume() + if not ret: + raise ExecutionError("Failed to setup " + "and start volume %s" % cls.volname) + + def _authenticated_mount(self, mount_obj): + """ + Mount volume on authenticated client + + Args: + mount_obj(obj): Object of GlusterMount class + """ + # Mount volume + ret = mount_obj.mount() + self.assertTrue(ret, ("Failed to mount %s on client %s" % + (mount_obj.volname, + mount_obj.client_system))) + g.log.info("Successfully mounted %s on client %s", mount_obj.volname, + mount_obj.client_system) + + # Verify mount + ret = mount_obj.is_mounted() + self.assertTrue(ret, ("%s is not mounted on client %s" + % (mount_obj.volname, mount_obj.client_system))) + g.log.info("Verified: %s is mounted on client %s", + mount_obj.volname, mount_obj.client_system) + + def _brick_down_heal(self): + # Create files on mount point using dd command + cmd = ('cd %s;for i in {1..10};' + 'do dd if=/dev/urandom bs=1024 count=1 of=file$i;done;' + % (self.mounts[0].mountpoint)) + ret, _, _ = g.run(self.mounts[0].client_system, cmd) + self.assertEqual(ret, 0, "Failed to createfiles on mountpoint") + g.log.info("Successfully created files on mountpoint") + + # Bring brick1 offline + bricks_list = get_all_bricks(self.mnode, self.volname) + ret = bring_bricks_offline(self.volname, bricks_list[1]) + self.assertTrue(ret, 'Failed to bring brick1 offline') + ret = are_bricks_offline(self.mnode, self.volname, + [bricks_list[1]]) + self.assertTrue(ret, 'Brick1 is not offline') + g.log.info('Bringing brick1 offline is successful') + + # Bring brick1 back online + ret = bring_bricks_online(self.mnode, self.volname, + [bricks_list[1]]) + self.assertTrue(ret, 'Failed to bring brick1 online') + g.log.info('Bringing brick1 online is successful') + + # Start healing + ret = trigger_heal(self.mnode, self.volname) + self.assertTrue(ret, 'Heal is not started') + g.log.info('Healing is started') + + # Monitor heal completion + ret = monitor_heal_completion(self.mnode, self.volname) + self.assertTrue(ret, 'Heal has not yet completed') + + # Check if heal is completed + ret = is_heal_complete(self.mnode, self.volname) + self.assertTrue(ret, 'Heal is not complete') + g.log.info('Heal is completed successfully') + + def test_auth_allow_with_heal(self): + """ + Validating the FUSE authentication volume options with Heal. + Steps: + 1. Setup and start volume + 2. Set auth.allow on volume for client1 using ip of client1 + 3. Mount volume on client1. + 4. Create files on mount point using dd command + 5. Bring down one brick of the volume + 6. Bring the brick back up after few seconds using + "gluster volume start force" + 7. Start volume heal by using gluster volume heal + 8. See the heal status using gluster volume heal info + 9. Set auth.allow on volume for client1 using hostname of client1. + 10. Repeat steps from 3 to 9 + """ + # Setting authentication on volume for client1 using ip + auth_dict = {'all': [self.mounts[0].client_system]} + ret = set_auth_allow(self.volname, self.mnode, auth_dict) + self.assertTrue(ret, "Failed to set authentication") + + # Mounting volume on client1 + self._authenticated_mount(self.mounts[0]) + + # Create files,bring brick down and check heal + self._brick_down_heal() + + # Unmount volume from client1 + ret = self.mounts[0].unmount() + self.assertTrue(ret, ("Failed to unmount volume %s from client %s" + % (self.volname, self.mounts[0].client_system))) + + # Obtain hostname of client1 + ret, hostname_client1, _ = g.run(self.mounts[0].client_system, + "hostname") + self.assertEqual(ret, 0, ("Failed to obtain hostname of client %s" + % self.mounts[0].client_system)) + g.log.info("Obtained hostname of client. IP- %s, hostname- %s", + self.mounts[0].client_system, hostname_client1.strip()) + + # Setting authentication on volume for client1 using hostname + auth_dict = {'all': [hostname_client1.strip()]} + ret = set_auth_allow(self.volname, self.mnode, auth_dict) + self.assertTrue(ret, "Failed to set authentication") + + # Mounting volume on client1 + self._authenticated_mount(self.mounts[0]) + + # Create files,bring brick down and check heal + self._brick_down_heal() + + def tearDown(self): + """ + Cleanup volume + """ + ret = self.cleanup_volume() + if not ret: + raise ExecutionError("Failed to cleanup volume.") + + # Calling GlusterBaseClass tearDown + self.get_super_method(self, 'tearDown')() diff --git a/tests/functional/authentication/test_auth_invalid_values.py b/tests/functional/authentication/test_auth_invalid_values.py index 7fd514b71..a494c8357 100644 --- a/tests/functional/authentication/test_auth_invalid_values.py +++ b/tests/functional/authentication/test_auth_invalid_values.py @@ -27,9 +27,8 @@ from glustolibs.gluster.volume_ops import set_volume_options from glustolibs.gluster.volume_libs import is_volume_exported -@runs_on([['replicated', 'distributed', 'distributed-replicated', - 'dispersed', 'distributed-dispersed'], - ['glusterfs', 'nfs']]) +@runs_on([['replicated', 'distributed', 'distributed-replicated', 'dispersed', + 'distributed-dispersed'], ['glusterfs', 'nfs']]) class AuthInvalidValues(GlusterBaseClass): """ Tests to verify negative scenario in authentication allow and reject @@ -42,13 +41,10 @@ class AuthInvalidValues(GlusterBaseClass): """ cls.get_super_method(cls, 'setUpClass')() # Create and start volume - g.log.info("Starting volume setup process %s", cls.volname) ret = cls.setup_volume() if not ret: raise ExecutionError("Failed to setup " "and start volume %s" % cls.volname) - g.log.info("Successfully created and started the volume: %s", - cls.volname) def set_invalid_auth(self, auth_opt, values_list): """ @@ -157,8 +153,9 @@ class AuthInvalidValues(GlusterBaseClass): """ Cleanup volume """ - g.log.info("Cleaning up volume") ret = self.cleanup_volume() if not ret: raise ExecutionError("Failed to cleanup volume.") - g.log.info("Volume cleanup was successful.") + + # Calling GlusterBaseClass tearDown + self.get_super_method(self, 'tearDown')() diff --git a/tests/functional/authentication/test_auth_reject_allow.py b/tests/functional/authentication/test_auth_reject_allow.py index 083b08e1b..6afdc5ae8 100644 --- a/tests/functional/authentication/test_auth_reject_allow.py +++ b/tests/functional/authentication/test_auth_reject_allow.py @@ -28,8 +28,7 @@ from glustolibs.gluster.auth_ops import set_auth_allow, set_auth_reject @runs_on([['replicated', 'distributed', 'distributed-replicated', - 'dispersed', 'distributed-dispersed'], - ['glusterfs']]) + 'dispersed', 'distributed-dispersed'], ['glusterfs']]) class FuseAuthRejectAllow(GlusterBaseClass): """ Tests to verify auth.reject and auth.allow volume options in volume and @@ -42,13 +41,10 @@ class FuseAuthRejectAllow(GlusterBaseClass): """ cls.get_super_method(cls, 'setUpClass')() # Create and start volume - g.log.info("Starting volume setup process %s", cls.volname) ret = cls.setup_volume() if not ret: raise ExecutionError("Failed to setup " "and start volume %s" % cls.volname) - g.log.info("Successfully created and started the volume: %s", - cls.volname) def authenticated_mount(self, mount_obj): """ @@ -167,13 +163,11 @@ class FuseAuthRejectAllow(GlusterBaseClass): auth_dict = {'all': [self.mounts[0].client_system]} ret = set_auth_reject(self.volname, self.mnode, auth_dict) self.assertTrue(ret, "Failed to set auth.reject volume option.") - g.log.info("Successfully set auth.reject option on volume") # Setting auth.allow on volume for client2 using ip auth_dict = {'all': [self.mounts[1].client_system]} ret = set_auth_allow(self.volname, self.mnode, auth_dict) self.assertTrue(ret, "Failed to set auth.allow volume option") - g.log.info("Successfully set auth.allow option on volume") # Trying to mount volume on client1 self.unauthenticated_mount(self.mounts[0]) @@ -213,13 +207,11 @@ class FuseAuthRejectAllow(GlusterBaseClass): auth_dict = {'all': [hostname_client1.strip()]} ret = set_auth_reject(self.volname, self.mnode, auth_dict) self.assertTrue(ret, "Failed to set auth.reject volume option.") - g.log.info("Successfully set auth.reject option on volume") # Setting auth.allow on volume for client2 using hostname auth_dict = {'all': [hostname_client2.strip()]} ret = set_auth_allow(self.volname, self.mnode, auth_dict) self.assertTrue(ret, "Failed to set auth.allow volume option") - g.log.info("Successfully set auth.allow option on volume") # Trying to mount volume on client1 self.unauthenticated_mount(self.mounts[0]) @@ -251,13 +243,11 @@ class FuseAuthRejectAllow(GlusterBaseClass): auth_dict = {'/d1': [self.mounts[0].client_system]} ret = set_auth_reject(self.volname, self.mnode, auth_dict) self.assertTrue(ret, "Failed to set auth.reject volume option.") - g.log.info("Successfully set auth.reject option.") # Setting auth.allow on d1 for client2 using ip auth_dict = {'/d1': [self.mounts[1].client_system]} ret = set_auth_allow(self.volname, self.mnode, auth_dict) self.assertTrue(ret, "Failed to set auth.allow volume option") - g.log.info("Successfully set auth.allow option.") # Creating mount object for sub-directory mount on client1 mount_obj_client1 = copy.deepcopy(self.mounts[0]) @@ -291,13 +281,11 @@ class FuseAuthRejectAllow(GlusterBaseClass): auth_dict = {'/d1': [hostname_client1.strip()]} ret = set_auth_reject(self.volname, self.mnode, auth_dict) self.assertTrue(ret, "Failed to set auth.reject volume option.") - g.log.info("Successfully set auth.reject option.") # Setting auth.allow on d1 for client2 using hostname auth_dict = {'/d1': [hostname_client2.strip()]} ret = set_auth_allow(self.volname, self.mnode, auth_dict) self.assertTrue(ret, "Failed to set auth.allow volume option") - g.log.info("Successfully set auth.allow option.") # Trying to mount d1 on client1 self.unauthenticated_mount(mount_obj_client1) @@ -322,8 +310,9 @@ class FuseAuthRejectAllow(GlusterBaseClass): """ Cleanup volume """ - g.log.info("Cleaning up volume") ret = self.cleanup_volume() if not ret: raise ExecutionError("Failed to cleanup volume.") - g.log.info("Volume cleanup was successful.") + + # Calling GlusterBaseClass tearDown + self.get_super_method(self, 'tearDown')() diff --git a/tests/functional/authentication/test_authentication_allow_blank.py b/tests/functional/authentication/test_authentication_allow_blank.py index dab0baab3..4bef00f31 100644 --- a/tests/functional/authentication/test_authentication_allow_blank.py +++ b/tests/functional/authentication/test_authentication_allow_blank.py @@ -28,8 +28,7 @@ from glustolibs.gluster.volume_libs import cleanup_volume @runs_on([['replicated', 'distributed-replicated', 'dispersed', - 'distributed-dispersed'], - ['glusterfs']]) + 'distributed-dispersed'], ['glusterfs']]) class AuthAllowEmptyString(GlusterBaseClass): """ Tests to verify auth.allow functionality on Volume and Fuse subdir @@ -38,13 +37,12 @@ class AuthAllowEmptyString(GlusterBaseClass): """ Setup Volume """ + # Calling GlusterBaseClass Setup + self.get_super_method(self, 'setUp')() + ret = self.setup_volume() if not ret: raise ExecutionError("Failed to setup volume") - g.log.info("Volume %s has been setup successfully", self.volname) - - # Calling GlusterBaseClass Setup - self.get_super_method(self, 'setUp')() def test_validate_authallow(self): """ @@ -76,5 +74,6 @@ class AuthAllowEmptyString(GlusterBaseClass): if not ret: raise ExecutionError("Failed to Cleanup the " "Volume %s" % self.volname) - g.log.info("Volume deleted successfully " - ": %s", self.volname) + + # Calling GlusterBaseClass tearDown + self.get_super_method(self, 'tearDown')() diff --git a/tests/functional/authentication/test_fusereject.py b/tests/functional/authentication/test_fusereject.py index 19bafdff7..6600f4e49 100644 --- a/tests/functional/authentication/test_fusereject.py +++ b/tests/functional/authentication/test_fusereject.py @@ -28,8 +28,7 @@ from glustolibs.gluster.mount_ops import (mount_volume, is_mounted, from glustolibs.gluster.brick_libs import get_all_bricks, are_bricks_online -@runs_on([['replicated'], - ['glusterfs']]) +@runs_on([['replicated'], ['glusterfs']]) class AuthRejectVol(GlusterBaseClass): """ Create a replicated volume and start the volume and check @@ -40,18 +39,18 @@ class AuthRejectVol(GlusterBaseClass): """ Creating a replicated volume and checking if it is started """ + # Calling GlusterBaseClass Setup + self.get_super_method(self, 'setUp')() + ret = self.setup_volume() if not ret: raise ExecutionError("Failed to setup volume %s" % self.volname) - g.log.info("Volume %s has been setup successfully", self.volname) # Check if volume is started volinfo = get_volume_info(self.mnode, self.volname) if volinfo[self.volname]['statusStr'] != "Started": raise ExecutionError("Volume has not Started") g.log.info("Volume is started") - # Calling GlusterBaseClass Setup - self.get_super_method(self, 'setUp')() def tearDown(self): """ @@ -64,13 +63,10 @@ class AuthRejectVol(GlusterBaseClass): raise ExecutionError("Failed to unmount volume from client" " %s" % client) g.log.info("Unmounted Volume from client %s successfully", client) - g.log.info("Cleaning up volume") ret = self.cleanup_volume() if not ret: raise ExecutionError("Failed to Cleanup the " "Volume %s" % self.volname) - g.log.info("Volume deleted successfully " - ": %s", self.volname) # Calling GlusterBaseClass tearDown self.get_super_method(self, 'tearDown')() @@ -106,7 +102,6 @@ class AuthRejectVol(GlusterBaseClass): # Fetching all the bricks self.mountpoint = "/mnt/testvol" - g.log.info("Fetching bricks for the volume : %s", self.volname) bricks_list = get_all_bricks(self.mnode, self.volname) self.assertIsNotNone(bricks_list, "Brick list is empty") g.log.info("Brick List : %s", bricks_list) @@ -114,7 +109,6 @@ class AuthRejectVol(GlusterBaseClass): # Check are bricks online ret = are_bricks_online(self.mnode, self.volname, bricks_list) self.assertTrue(ret, "All bricks are not online") - g.log.info("All bricks are online") # Using this way to check because of bug 1586036 # Mounting volume @@ -144,10 +138,8 @@ class AuthRejectVol(GlusterBaseClass): # Mounting the vol on client2 # Check bricks are online - g.log.info("Brick List : %s", bricks_list) ret = are_bricks_online(self.mnode, self.volname, bricks_list) self.assertTrue(ret, "All bricks are not online") - g.log.info("All bricks are online") # Mounting Volume ret, _, _ = mount_volume(self.volname, self.mount_type, @@ -162,7 +154,6 @@ class AuthRejectVol(GlusterBaseClass): user='root') self.assertTrue(out, "Volume %s has failed to mount" % self.volname) - g.log.info("Volume is mounted successfully %s", self.volname) # Reset Volume ret, _, _ = volume_reset(mnode=self.mnode, volname=self.volname) @@ -170,10 +161,8 @@ class AuthRejectVol(GlusterBaseClass): g.log.info("Volume %s reset operation is successful", self.volname) # Checking if bricks are online - g.log.info("Brick List : %s", bricks_list) ret = are_bricks_online(self.mnode, self.volname, bricks_list) self.assertTrue(ret, "All bricks are not online") - g.log.info("All bricks are online") # Mounting Volume ret, _, _ = mount_volume(self.volname, self.mount_type, diff --git a/tests/functional/authentication/test_verify_auth_reject_precedence.py b/tests/functional/authentication/test_verify_auth_reject_precedence.py index d51e61443..ce8420690 100644 --- a/tests/functional/authentication/test_verify_auth_reject_precedence.py +++ b/tests/functional/authentication/test_verify_auth_reject_precedence.py @@ -28,8 +28,7 @@ from glustolibs.gluster.auth_ops import set_auth_allow, set_auth_reject @runs_on([['replicated', 'distributed', 'distributed-replicated', - 'dispersed', 'distributed-dispersed'], - ['glusterfs']]) + 'dispersed', 'distributed-dispersed'], ['glusterfs']]) class VerifyAuthRejectPrecedence(GlusterBaseClass): """ Tests to verify auth.reject precedence over auth.allow option. @@ -41,13 +40,10 @@ class VerifyAuthRejectPrecedence(GlusterBaseClass): """ cls.get_super_method(cls, 'setUpClass')() # Create and start volume - g.log.info("Starting volume setup process %s", cls.volname) ret = cls.setup_volume() if not ret: raise ExecutionError("Failed to setup " "and start volume %s" % cls.volname) - g.log.info("Successfully created and started the volume: %s", - cls.volname) def authenticated_mount(self, mount_obj): """ @@ -182,14 +178,12 @@ class VerifyAuthRejectPrecedence(GlusterBaseClass): auth_dict = {'all': ['*']} ret = set_auth_reject(self.volname, self.mnode, auth_dict) self.assertTrue(ret, "Failed to set auth.reject volume option.") - g.log.info("Successfully set auth.reject option on volume") # Setting auth.allow on volume for client1 and client2 using ip auth_dict = {'all': [self.mounts[0].client_system, self.mounts[0].client_system]} ret = set_auth_allow(self.volname, self.mnode, auth_dict) self.assertTrue(ret, "Failed to set auth.allow volume option") - g.log.info("Successfully set auth.allow option on volume") # Trying to mount volume on client1 self.unauthenticated_mount(self.mounts[0]) @@ -230,7 +224,6 @@ class VerifyAuthRejectPrecedence(GlusterBaseClass): auth_dict = {'all': [hostname_client1, hostname_client2]} ret = set_auth_allow(self.volname, self.mnode, auth_dict) self.assertTrue(ret, "Failed to set auth.allow volume option") - g.log.info("Successfully set auth.allow option on volume") # Trying to mount volume on client1 self.unauthenticated_mount(self.mounts[0]) @@ -255,14 +248,12 @@ class VerifyAuthRejectPrecedence(GlusterBaseClass): auth_dict = {'/d1': ['*']} ret = set_auth_reject(self.volname, self.mnode, auth_dict) self.assertTrue(ret, "Failed to set auth.reject volume option.") - g.log.info("Successfully set auth.reject option.") # Setting auth.allow on d1 for client1 and client2 using ip auth_dict = {'/d1': [self.mounts[0].client_system, self.mounts[1].client_system]} ret = set_auth_allow(self.volname, self.mnode, auth_dict) self.assertTrue(ret, "Failed to set auth.allow volume option") - g.log.info("Successfully set auth.allow option.") # Creating mount object for sub-directory mount on client1 mount_obj_client1 = copy.deepcopy(self.mounts[0]) @@ -296,7 +287,6 @@ class VerifyAuthRejectPrecedence(GlusterBaseClass): auth_dict = {'/d1': [hostname_client1, hostname_client2]} ret = set_auth_allow(self.volname, self.mnode, auth_dict) self.assertTrue(ret, "Failed to set auth.allow volume option") - g.log.info("Successfully set auth.allow option.") # Trying to mount d1 on client1 self.unauthenticated_mount(mount_obj_client1) @@ -320,8 +310,9 @@ class VerifyAuthRejectPrecedence(GlusterBaseClass): """ Cleanup volume """ - g.log.info("Cleaning up volume") ret = self.cleanup_volume() if not ret: raise ExecutionError("Failed to cleanup volume.") - g.log.info("Volume cleanup was successful.") + + # Calling GlusterBaseClass tearDown + self.get_super_method(self, 'tearDown')() diff --git a/tests/functional/authentication/test_vol_auth.py b/tests/functional/authentication/test_vol_auth.py index 646ab3520..fa5e34a2f 100644 --- a/tests/functional/authentication/test_vol_auth.py +++ b/tests/functional/authentication/test_vol_auth.py @@ -30,27 +30,26 @@ from glustolibs.gluster.brick_libs import get_all_bricks, are_bricks_online from glustolibs.gluster.volume_libs import cleanup_volume -@runs_on([['replicated'], - ['glusterfs']]) +@runs_on([['replicated'], ['glusterfs']]) class AuthRejectVol(GlusterBaseClass): """ Create a replicated volume and start the volume and check if volume is started """ def setUp(self): + # Calling GlusterBaseClass Setup + self.get_super_method(self, 'setUp')() + # Setup Volume to create a replicated volume ret = self.setup_volume() if not ret: raise ExecutionError("Failed to setup volume %s" % self.volname) - g.log.info("Volume %s has been setup successfully", self.volname) # Check if volume is started volinfo = get_volume_info(self.mnode, self.volname) if volinfo[self.volname]['statusStr'] != "Started": raise ExecutionError("Volume has not Started") g.log.info("Volume is started.") - # Calling GlusterBaseClass Setup - self.get_super_method(self, 'setUp')() def tearDown(self): # tearDown for every test @@ -59,8 +58,6 @@ class AuthRejectVol(GlusterBaseClass): if not ret: raise ExecutionError("Failed to Cleanup the " "Volume %s" % self.volname) - g.log.info("Volume deleted successfully " - ": %s", self.volname) # Calling GlusterBaseClass tearDown self.get_super_method(self, 'tearDown')() @@ -90,7 +87,6 @@ class AuthRejectVol(GlusterBaseClass): for client in self.clients: # Fetching all the bricks self.mountpoint = '/mnt/testvol' - g.log.info("Fetching bricks for the volume : %s", self.volname) bricks_list = get_all_bricks(self.mnode, self.volname) self.assertIsNotNone(bricks_list, "Brick list is empty") g.log.info("Brick List : %s", bricks_list) @@ -98,7 +94,6 @@ class AuthRejectVol(GlusterBaseClass): # Check are bricks online ret = are_bricks_online(self.mnode, self.volname, bricks_list) self.assertTrue(ret, "All bricks are not online") - g.log.info("All bricks are online") # Creating directory to mount cmd = ("mkdir -p /mnt/testvol") @@ -138,7 +133,6 @@ class AuthRejectVol(GlusterBaseClass): # Check if bricks are online and Mounting the vol on client1 # Fetching bricks - g.log.info("Fetching bricks for the volume : %s", self.volname) bricks_list = get_all_bricks(self.mnode, self.volname) self.assertIsNotNone(bricks_list, "Brick list is empty") g.log.info("Brick List : %s", bricks_list) @@ -146,7 +140,6 @@ class AuthRejectVol(GlusterBaseClass): # Checking if bricks are online ret = are_bricks_online(self.mnode, self.volname, bricks_list) self.assertTrue(ret, "All bricks are not online") - g.log.info("All bricks are online") # Creating directory to mount cmd = ("mkdir -p /mnt/testvol") |