class LocalFuseMount(FuseMount):
- def __init__(self, test_dir, client_id):
- super(LocalFuseMount, self).__init__(None, test_dir, client_id, LocalRemote())
+ def __init__(self, ctx, test_dir, client_id):
+ super(LocalFuseMount, self).__init__(ctx, None, test_dir, client_id, LocalRemote())
@property
def config_path(self):
args, wait=wait, cwd=self.mountpoint
)
+ def setupfs(self, name=None):
+ if name is None and self.fs is not None:
+ # Previous mount existed, reuse the old name
+ name = self.fs.name
+ self.fs = LocalFilesystem(self.ctx, name=name)
+ log.info('Wait for MDS to reach steady state...')
+ self.fs.wait_for_daemons()
+ log.info('Ready to start {}...'.format(type(self).__name__))
+
@property
def _prefix(self):
return BIN_PREFIX
super(LocalFuseMount, self).umount()
def mount(self, mount_path=None, mount_fs_name=None):
+ self.setupfs(name=mount_fs_name)
+
self.client_remote.run(
args=[
'mkdir',
else:
self._fuse_conn = new_conns[0]
+ self.gather_mount_info()
+
def _run_python(self, pyscript):
"""
Override this to remove the daemon-helper prefix that is used otherwise
def __del__(self):
shutil.rmtree(self.teuthology_config['test_path'])
-
def exec_test():
# Parse arguments
interactive_on_error = False
test_dir = tempfile.mkdtemp()
teuth_config['test_path'] = test_dir
+ ctx = LocalContext()
+ ceph_cluster = LocalCephCluster(ctx)
+ mds_cluster = LocalMDSCluster(ctx)
+ mgr_cluster = LocalMgrCluster(ctx)
+
# Construct Mount classes
mounts = []
for client_id in clients:
open("./keyring", "a").write(p.stdout.getvalue())
- mount = LocalFuseMount(test_dir, client_id)
+ mount = LocalFuseMount(ctx, test_dir, client_id)
mounts.append(mount)
if mount.is_mounted():
log.warn("unmounting {0}".format(mount.mountpoint))
if os.path.exists(mount.mountpoint):
os.rmdir(mount.mountpoint)
- ctx = LocalContext()
- ceph_cluster = LocalCephCluster(ctx)
- mds_cluster = LocalMDSCluster(ctx)
- mgr_cluster = LocalMgrCluster(ctx)
-
from tasks.cephfs_test_runner import DecoratingLoader
class LogStream(object):