def setUp(self):
        """
        Setup and mount volume or raise ExecutionError
        """
        GlusterBaseClass.setUp.im_func(self)

        # Setup Volume
        ret = self.setup_volume_and_mount_volume(self.mounts)
        if not ret:
            g.log.error("Failed to Setup and Mount Volume")
            raise ExecutionError("Failed to Setup and Mount Volume")

        self.files = ('a.txt', 'b.txt', 'sub_folder/c.txt', 'sub_folder/d.txt')
    def tearDownClass(cls):
        """
        Clean up the volume and umount volume from client
        """
        # stopping the volume
        g.log.info("Starting to Unmount Volume and Cleanup Volume")
        ret = cls.unmount_volume_and_cleanup_volume(mounts=cls.mounts)
        if not ret:
            raise ExecutionError("Failed to Unmount Volume and Cleanup Volume")
        g.log.info("Successful in Unmount Volume and Cleanup Volume")

        # calling GlusterBaseClass tearDownClass
        GlusterBaseClass.tearDownClass.im_func(cls)
Exemplo n.º 3
0
 def setUpClass(cls):
     """
     Create and start volume
     """
     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)
Exemplo n.º 4
0
    def tearDown(self):
        """
        tearDown for every test
        """

        # stopping the volume and Cleaning up the volume
        ret = self.cleanup_volume()
        if not ret:
            raise ExecutionError("Failed Cleanup the Volume %s" % self.volname)
        g.log.info("Volume deleted successfully : %s", self.volname)

        # Calling GlusterBaseClass tearDown
        self.get_super_method(self, 'tearDown')()
Exemplo n.º 5
0
    def setUpClass(cls):
        cls.get_super_method(cls, 'setUpClass')()

        # Upload io scripts for running IO on mounts
        g.log.info(
            "Upload io scripts to clients %s for running IO on "
            "mounts", cls.clients)
        cls.script_upload_path = ("/usr/share/glustolibs/io/scripts/"
                                  "file_dir_ops.py")
        ret = upload_scripts(cls.clients, cls.script_upload_path)
        if not ret:
            raise ExecutionError("Failed to upload IO scripts " "to clients ")
        g.log.info("Successfully uploaded IO scripts to clients %s")
Exemplo n.º 6
0
    def setUp(self):
        # Calling GlusterBaseClass setUp
        self.get_super_method(self, 'setUp')()

        # Setup Volume and Mount Volume
        g.log.info("Starting to Setup Volume and Mount Volume")
        ret = self.setup_volume_and_mount_volume(mounts=self.mounts,
                                                 volume_create_force=False)
        if not ret:
            raise ExecutionError("Failed to Setup_Volume and Mount_Volume")
        g.log.info("Successful in Setup Volume and Mount Volume")

        self.bricks_list = get_all_bricks(self.mnode, self.volname)
Exemplo n.º 7
0
    def setUp(self):
        """
        setUp method for every test
        """
        # Creating Volume
        ret = self.setup_volume_and_mount_volume(self.mounts)
        if not ret:
            raise ExecutionError("Volume creation or mount failed: %s" %
                                 self.volname)
        g.log.info("Volme created and mounted successfully : %s", self.volname)

        # calling GlusterBaseClass setUp
        GlusterBaseClass.setUp.im_func(self)
Exemplo n.º 8
0
    def setUpClass(cls):
        # Calling GlusterBaseClass setUpClass
        cls.get_super_method(cls, 'setUpClass')()

        # Upload IO scripts for running IO on mounts
        cls.script_upload_path = ("/usr/share/glustolibs/io/scripts/"
                                  "file_dir_ops.py")
        ret = upload_scripts(cls.clients, [cls.script_upload_path])
        if not ret:
            raise ExecutionError("Failed to upload IO scripts to clients %s" %
                                 cls.clients)
        g.log.info("Successfully uploaded IO scripts to clients %s",
                   cls.clients)
    def tearDown(self):
        """
        tearDown for every test
        """
        # stopping the volume and Cleaning up the volume
        ret = self.cleanup_volume()
        if not ret:
            raise ExecutionError("Failed Cleanup the Volume %s" % self.volname)

        # Checking peers are in connected state or not
        ret = self.validate_peers_are_connected()
        if not ret:
            # Peer probe detached servers
            pool = nodes_from_pool_list(self.mnode)
            for node in pool:
                peer_detach(self.mnode, node)
            ret = peer_probe_servers(self.mnode, self.servers)
            if not ret:
                raise ExecutionError("Failed to probe detached servers %s" %
                                     self.servers)
        # Calling GlusterBaseClass tearDown
        self.get_super_method(self, 'tearDown')()
 def setUpClass(cls):
     """
     Create and start volume
     """
     GlusterBaseClass.setUpClass.im_func(cls)
     # 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)
Exemplo n.º 11
0
    def setUpClass(cls):
        """
        setup volume and initialize necessary variables which is used in tests
        """

        # calling GlusterBaseClass setUpClass
        cls.get_super_method(cls, 'setUpClass')()
        # Setup Volume
        ret = cls.setup_volume()
        if not ret:
            raise ExecutionError("Failed to Setup_Volume %s" % cls.volname)
        g.log.info("Successful in Setup Volume %s", cls.volname)
        cls.autodel_enable = {'auto-delete': 'enable'}
Exemplo n.º 12
0
    def setUp(self):

        # Uploading file_dir script in all client direcotries
        g.log.info(
            "Upload io scripts to clients %s for running IO on "
            "mounts", self.clients[0])
        self.script_upload_path = ("/usr/share/glustolibs/io/scripts/"
                                   "file_dir_ops.py")
        ret = upload_scripts(self.clients[0], self.script_upload_path)
        if not ret:
            raise ExecutionError("Failed to upload IO scripts to clients %s" %
                                 self.clients[0])
        g.log.info("Successfully uploaded IO scripts to clients %s",
                   self.clients[0])

        # SettingUp volume and Mounting the volume
        self.get_super_method(self, 'setUp')()
        g.log.info("Starting to SetUp Volume")
        ret = self.setup_volume_and_mount_volume(mounts=self.mounts)
        if not ret:
            raise ExecutionError("Failed to setup volume %s" % self.volname)
        g.log.info("Volume %s has been setup successfully", self.volname)
 def setUpClass(cls):
     """
     Setup and mount volume
     """
     GlusterBaseClass.setUpClass.im_func(cls)
     # Setup Volume and Mount Volume
     g.log.info("Starting volume setup and mount %s",
                cls.volname)
     ret = cls.setup_volume_and_mount_volume(cls.mounts)
     if not ret:
         raise ExecutionError("Failed to Setup "
                              "and Mount_Volume %s" % cls.volname)
     g.log.info("Successfully set and mounted the volume: %s", cls.volname)
    def tearDown(self):
        self.get_super_method(self, 'tearDown')()

        # Unmount the volume
        ret = umount_volume(mclient=self.mounts[0].client_system,
                            mpoint=self.mounts[0].mountpoint)
        if not ret:
            raise ExecutionError("Unable to umount the volume")
        g.log.info("Unmounting of the volume %s succeeded", self.volname)

        # The reason for volume reset is, metadata-cache is enabled
        # by group, can't disable the group in glusterfs.
        ret, _, _ = volume_reset(self.mnode, self.volname)
        if ret:
            raise ExecutionError("Unable to reset the volume {}".
                                 format(self.volname))
        g.log.info("Volume: %s reset successful ", self.volname)

        # Cleanup the volume
        if not self.cleanup_volume():
            raise ExecutionError("Unable to perform volume clenaup")
        g.log.info("Volume cleanup is successfull")
    def setUp(self):
        """
        - Setup Volume and Mount Volume
        """
        # Calling GlusterBaseClass setUpClass
        GlusterBaseClass.setUpClass.im_func(self)

        # Setup Volume and Mount Volume
        g.log.info("Starting to Setup Volume and Mount Volume")
        ret = self.setup_volume_and_mount_volume(mounts=self.mounts)
        if not ret:
            raise ExecutionError("Failed to Setup_Volume and Mount_Volume")
        g.log.info("Successful in Setup Volume and Mount Volume")
Exemplo n.º 16
0
    def setUp(self):
        GlusterBaseClass.setUp.im_func(self)
        g.log.info("Starting to Setup Volume %s", self.volname)

        self.all_mounts_procs = []
        self.io_validation_complete = False

        # Setup Volume and Mount Volume
        g.log.info("Starting to Setup Volume and Mount Volume")
        ret = self.setup_volume_and_mount_volume(mounts=self.mounts)
        if not ret:
            raise ExecutionError("Failed to Setup_Volume and Mount_Volume")
        g.log.info("Successful in Setup Volume and Mount Volume")
Exemplo n.º 17
0
    def setUpClass(cls):
        """
        Setup nfs-ganesha if not exists.
        Upload IO scripts to clients
        """
        cls.get_super_method(cls, 'setUpClass')()

        # Setup nfs-ganesha if not exists.
        ret = cls.setup_nfs_ganesha()
        if not ret:
            raise ExecutionError("Failed to setup nfs-ganesha cluster")
        g.log.info("nfs-ganesha cluster is healthy")

        # Upload IO scripts for running IO on mounts
        cls.script_upload_path = ("/usr/share/glustolibs/io/scripts/"
                                  "file_dir_ops.py")
        ret = upload_scripts(cls.clients, cls.script_upload_path)
        if not ret:
            raise ExecutionError("Failed to upload IO scripts to clients %s" %
                                 cls.clients)
        g.log.info("Successfully uploaded IO scripts to clients %s",
                   cls.clients)
    def tearDown(self):

        status_info = get_rebalance_status(self.mnode, self.volname)
        status = status_info['aggregate']['statusStr']
        if 'in progress' in status:
            # Stop rebalance on the volume
            g.log.info("Stop Rebalance on volume %s", self.volname)
            ret, _, _ = rebalance_stop(self.mnode, self.volname)
            if ret != 0:
                raise ExecutionError("Volume %s: Rebalance stop failed" %
                                     self.volname)
            g.log.info("Volume %s: Rebalance stop success", self.volname)

        # Unmount Volume and Cleanup Volume
        g.log.info("Starting to Unmount Volume and Cleanup Volume")
        ret = self.unmount_volume_and_cleanup_volume(mounts=self.mounts)
        if not ret:
            raise ExecutionError("Failed to Unmount Volume and Cleanup Volume")
        g.log.info("Successful in Unmount Volume and Cleanup Volume")

        # Calling GlusterBaseClass tearDown
        self.get_super_method(self, 'tearDown')()
    def setUp(self):
        """
        setup volume, mount volume and initialize necessary variables
        which is used in tests
        """
        # calling GlusterBaseClass setUpClass
        self.get_super_method(self, 'setUp')()

        # Setup Volume and Mount Volume
        g.log.info("Starting to Setup Volume and Mount Volume")
        ret = self.setup_volume_and_mount_volume(mounts=self.mounts)
        if not ret:
            raise ExecutionError("Failed to Setup_Volume and Mount_Volume")
        g.log.info("Successful in Setup Volume and Mount Volume")

        # Verfiy glustershd process releases its parent process
        g.log.info("Verifying Self Heal Daemon process is daemonized")
        ret = is_shd_daemonized(self.servers)
        if not ret:
            raise ExecutionError("Self Heal Daemon process was still"
                                 " holding parent process.")
        g.log.info("Self Heal Daemon processes are online")
    def setUpClass(cls):
        """
        setup volume and initialize necessary variables
        """

        cls.get_super_method(cls, 'setUpClass')()
        g.log.info("Starting %s:", cls.__name__)
        # Setup volume and mount
        g.log.info("Starting to Setup Volume")
        ret = cls.setup_volume()
        if not ret:
            raise ExecutionError("Failed to Setup_Volume")
        g.log.info("Successful in Setup Volume")
    def tearDown(self):
        """
        Cleanup and umount volume
        """
        # Cleanup and umount volume
        g.log.info("Starting to Unmount Volume and Cleanup Volume")
        ret = self.unmount_volume_and_cleanup_volume(mounts=self.mounts)
        if not ret:
            raise ExecutionError("Failed to umount the vol & cleanup Volume")
        g.log.info("Successful in umounting the volume and Cleanup")

        # Calling GlusterBaseClass teardown
        self.get_super_method(self, 'tearDown')()
Exemplo n.º 22
0
    def setUp(self):

        self.get_super_method(self, 'setUp')()

        # Setup Volume
        if not self.setup_volume_and_mount_volume([self.mounts[0]]):
            raise ExecutionError("Failed to Setup and mount volume")

        self.first_client = self.mounts[0].client_system

        self.second_vol_name = "second_volume"
        self.second_mountpoint = "/mnt/{}".format(self.second_vol_name)
        self.is_second_volume_created = False
Exemplo n.º 23
0
    def tearDownClass(cls):
        """
        Clean up the volume & mount
        """
        # stopping the volume and clean up the volume
        g.log.info("Starting to Cleanup Volume")
        ret = cls.unmount_volume_and_cleanup_volume(cls.mounts)
        if not ret:
            raise ExecutionError("Failed to Cleanup Volume and mount")
        g.log.info("Successful in Cleanup Volume and mount")

        # calling GlusterBaseClass tearDownClass
        cls.get_super_method(cls, 'tearDownClass')()
    def setUp(self):
        self.get_super_method(self, 'setUp')()
        self.num_of_dirs = 2

        # For test_ec_quota_errors_on_limit only one client is needed
        if 'on_limit' in self.id().split('.')[-1]:
            self.num_of_dirs = 1
            self.mounts = [self.mounts[0]]
        ret = self.setup_volume_and_mount_volume(mounts=self.mounts)
        self.all_mount_procs = []
        self.offline_bricks = []
        if not ret:
            raise ExecutionError('Failed to setup and mount volume')
 def setUpClass(cls):
     """
     setup volume and mount volume
     calling GlusterBaseClass setUpClass
     """
     GlusterBaseClass.setUpClass.im_func(cls)
     # Setup Volume and Mount Volume
     g.log.info("Starting to Setup and Mount Volume %s", cls.volname)
     ret = cls.setup_volume_and_mount_volume(mounts=cls.mounts)
     if not ret:
         raise ExecutionError("Failed to Setup_Volume "
                              "and Mount_Volume %s" % cls.volname)
     g.log.info("Successful in Setup and Mount Volume %s", cls.volname)
Exemplo n.º 26
0
    def setUpClass(cls):
        """
        setup volume and initialize necessary variables
        """

        GlusterBaseClass.setUpClass.im_func(cls)
        g.log.info("Starting %s:", cls.__name__)
        # Setup volume and mount
        g.log.info("Starting to Setup Volume")
        ret = cls.setup_volume()
        if not ret:
            raise ExecutionError("Failed to Setup_Volume")
        g.log.info("Successful in Setup Volume")
Exemplo n.º 27
0
    def setUp(self):
        # Calling GlusterBaseClass setUp
        self.get_super_method(self, 'setUp')()

        self.all_mounts_procs = []
        self.io_validation_complete = False

        # Setup Volume and Mount Volume
        g.log.info("Starting to Setup Volume and Mount Volume")
        ret = self.setup_volume_and_mount_volume(mounts=self.mounts)
        if not ret:
            raise ExecutionError("Failed to Setup_Volume and Mount_Volume")
        g.log.info("Successful in Setup Volume and Mount Volume")
Exemplo n.º 28
0
    def tearDownClass(cls):
        """
        Clean up the volume & mount
        """
        # stopping the volume and clean up the volume
        g.log.info("Starting to Cleanup Volume")
        ret = cls.cleanup_volume()
        if not ret:
            raise ExecutionError("Failed to Cleanup Volume and mount")
        g.log.info("Successful in Cleanup Volume and mount")

        # calling GlusterBaseClass tearDownClass
        GlusterBaseClass.tearDownClass.im_func(cls)
Exemplo n.º 29
0
    def tearDown(self):

        # Deleting all snapshot
        g.log.info("Deleting all snapshots created")
        ret, _, _ = snap_delete_all(self.mnode)
        if ret != 0:
            raise ExecutionError("Snapshot Delete Failed")
        g.log.info("Successfully deleted all snapshots")

        # Disable uss for volume
        g.log.info("Disabling uss for volume")
        ret, _, _ = disable_uss(self.mnode, self.volname)
        if ret != 0:
            raise ExecutionError("Failed to disable uss")
        g.log.info("Successfully disabled uss for volume" "%s", self.volname)

        # Unmount and cleanup original volume
        g.log.info("Starting to Unmount and Cleanup Volume")
        ret = self.unmount_volume_and_cleanup_volume(mounts=self.mounts)
        if not ret:
            raise ExecutionError("Failed to umount and cleanup Volume")
        g.log.info("Successful in umounting the volume and Cleanup")
Exemplo n.º 30
0
    def setUp(self):
        """
        setUp method for every test
        """
        # calling GlusterBaseClass setUp
        GlusterBaseClass.setUp.im_func(self)
        self.volume_list = []
        # create a volume
        ret = setup_volume(self.mnode, self.all_servers_info,
                           self.volume)
        self.volume_list.append(self.volname)
        if not ret:
            raise ExecutionError("Volume creation failed: %s" % self.volname)

        # Creating another volume
        second_volume = "second_volume"
        self.volume['name'] = second_volume
        ret = setup_volume(self.mnode, self.all_servers_info,
                           self.volume)
        self.volume_list.append(second_volume)
        if not ret:
            raise ExecutionError("Volume creation failed: %s" % second_volume)