def setup(self, **kwargs): tools = kwargs['tools'] for dd in self.dax_devices: proc = tools.pmemdetect('-d', dd.path) if proc.returncode != 0: raise futils.Fail('checking {} with pmemdetect failed:{}{}' .format(dd.path, os.linesep, proc.stdout))
def get_size(path): """ Returns size of the file or dax device. Value "2**64 - 1" is checked because pmemdetect in case of error prints it. """ proc = tools.pmemdetect('-z', path) if int(proc.stdout) != 2**64 - 1: return int(proc.stdout) fail('Could not get size of the file, it is inaccessible or does not exist')
def get_size(self, path): """ Returns size of the file or dax device. Value "2**64 - 1" is checked because pmemdetect in case of error prints it. """ proc = tools.pmemdetect(self, '-z', path) if int(proc.stdout) != 2**64 - 1: return int(proc.stdout) futils.fail('Could not get size of the file, it is inaccessible or does not exist')
def supports_map_sync(path): """Checks if MAP_SYNC is supported on a filesystem from given path""" proc = tools.pmemdetect('-s', path) if proc.returncode == tools.PMEMDETECT_ERROR: fail(proc.stdout) if proc.returncode == tools.PMEMDETECT_TRUE: return True if proc.returncode == tools.PMEMDETECT_FALSE: return False fail('Unknown value {} returned by pmemdetect'.format(proc.returncode))
def is_devdax(path): """Checks if given path points to device dax""" proc = tools.pmemdetect('-d', path) if proc.returncode == tools.PMEMDETECT_ERROR: fail(proc.stdout) if proc.returncode == tools.PMEMDETECT_TRUE: return True if proc.returncode == tools.PMEMDETECT_FALSE: return False fail('Unknown value {} returned by pmemdetect'.format(proc.returncode))
def setup(self, **kwargs): # DevDax tests always require ndctl req.Requirements().check_ndctl_enable() req.Requirements().check_ndctl() tools = kwargs['tools'] for dd in self.dax_devices: proc = tools.pmemdetect('-d', dd.path) if proc.returncode != 0: raise futils.Fail( 'checking {} with pmemdetect failed:{}{}'.format( dd.path, os.linesep, proc.stdout))
def setup(self, **kwargs): # DevDax tests always require ndctl req.Requirements().check_ndctl_enable() req.Requirements().check_ndctl() tools = kwargs['tools'] for dd in self.dax_devices: proc = tools.pmemdetect('-d', dd.path) if proc.returncode != 0: raise futils.Fail('checking {} with pmemdetect failed:{}{}' .format(dd.path, os.linesep, proc.stdout)) if self.check_fs_exec: exec_allowed = tools.mapexec(dd.path) if exec_allowed.returncode != 1: raise futils.Skip('dax device {} has no exec rights for' ' mmap'.format(dd.path))