def setup(self): """ Function to setup ganesha and create volume for testing. """ ret = setup_nfs_ganesha(self.no_of_ganesha_nodes) if ret: tc.logger.info("setup of ganesha for %s node is successfull" % self.no_of_ganesha_nodes) else: tc.logger.error("setup of ganesha for %s node is unsuccessfull" % self.no_of_ganesha_nodes) return False ret = GlusterBaseClass.setup(self) if not ret: return False time.sleep(10) ret = get_volume_status(self.volname) if ret is None: return False ret = get_volume_info(self.volname) if ret is None: return False ret, out, err = tc.run(self.mnode, "showmount -e localhost") if ret != 0: return False ret, out, err = mount_volume(self.volname, self.mount_proto, self.mountpoint, self.vips[0], self.clients[0], self.options) if ret != 0: tc.logger.error("Mounting Volume %s failed on %s:%s" % (self.volname, self.clients[0], self.mountpoint)) return False return True
def __init__(self, config_data, nfs_options="vers=3"): """ Initialise the class with the config values Kwargs: nfs_options (str): This argument takes the nfs options, say vers=3 or vers=4. Default value is vers=3. """ GlusterBaseClass.__init__(self, config_data) self.options = nfs_options self.no_of_ganesha_nodes = (config_data["gluster"] ["cluster_config"]["nfs_ganesha"] ["num_of_nfs_ganesha_nodes"]) self.no_of_ganesha_nodes = int(self.no_of_ganesha_nodes) self.vips = (config_data["gluster"]["cluster_config"] ["nfs_ganesha"]["vips"])
def __init__(self, globl_configs): GlusterBaseClass.__init__(self, globl_configs) self.filename = "dd_testfile" io_config_file = os.path.join(os.path.dirname (os.path.realpath(__file__)), "io_config.yml") dd_writes_config = yaml.load(open(io_config_file)) # Num of dd's to start per client/per file self.num_of_dd_writes_process = (dd_writes_config['gluster']['tests'] ['io']['dd_writes'] ['num_of_process_per_file']) # Num of files to create self.num_of_files = (dd_writes_config['gluster']['tests'] ['io']['dd_writes']['num_of_files']) # Input file for dd command self.dd_input_file = (dd_writes_config['gluster']['tests'] ['io']['dd_writes']['input_file']) # Block size self.block_size = (dd_writes_config['gluster']['tests'] ['io']['dd_writes']['block_size']) if "random" in self.block_size: self.block_size = ["1k", "10k", "256k", "512k" ,"1M", "10M", "100M", "256M", "512M", "1G"] # dd count self.dd_count = (dd_writes_config['gluster']['tests'] ['io']['dd_writes']['count']) # dd CONV if (dd_writes_config['gluster']['tests']['io'] ['dd_writes']).has_key('conv'): self.dd_conv = (dd_writes_config['gluster']['tests'] ['io']['dd_writes']['conv']) else: self.dd_conv = None # dd OFLAG if (dd_writes_config['gluster']['tests']['io'] ['dd_writes']).has_key('oflag'): self.dd_oflag = (dd_writes_config['gluster']['tests'] ['io']['dd_writes']['oflag']) else: self.dd_oflag = None
def teardown(self): for mount_obj in self.mounts: cleanup_mount_cmd = "rm -rf %s/*" % mount_obj.mountpoint ret, out, err = tc.run(mount_obj.client_system, cleanup_mount_cmd) for mount_obj in self.mounts: mount_obj.unmount() ret = GlusterBaseClass.teardown(self) if not ret: return False return True
def cleanup(Self, delete_vol=False): """ The function to cleanup the volume Kwargs: delete_vol (bool): If True deletes the volume. else leaves the volume as it is. Defualt value is False """ if not delete_vol: return True return GlusterBaseClass.cleanup(self)
def setup(self): ret = GlusterBaseClass.setup(self) if not ret: return False if self.mounts: for mount_obj in self.mounts: ret = mount_obj.mount() if not ret: tc.logger.error("Mounting Volume %s failed on %s:%s" % (mount_obj.volname, mount_obj.client_system, mount_obj.mountpoint)) return False return True
def setup(self): ret = GlusterBaseClass.setup(self) if not ret: return False if self.mounts: for mount_obj in self.mounts: ret = mount_obj.mount() if not ret: tc.logger.error( "Mounting Volume %s failed on %s:%s" % (mount_obj.volname, mount_obj.client_system, mount_obj.mountpoint)) return False return True
def __init__(self, config_data): """ Initialise the class with the config values """ tc.logger.info("Starting testcase for CTDB gluster setup") GlusterBaseClass.__init__(self, config_data)