1
0
mirror of https://github.com/ceph/ceph synced 2025-03-30 15:31:01 +00:00

Merge PR into master

* refs/pull/23097/head:
	vstart_runner: pass ctx to FuseMount and load mount info

Reviewed-by: Venky Shankar <vshankar@redhat.com>
This commit is contained in:
Patrick Donnelly 2018-07-19 08:55:49 -07:00
commit fa4c0309c1
No known key found for this signature in database
GPG Key ID: 3A2A7E25BEA8AADB
2 changed files with 24 additions and 9 deletions

View File

@ -158,6 +158,9 @@ class FuseMount(CephFSMount):
else:
self._fuse_conn = new_conns[0]
self.gather_mount_info()
def gather_mount_info(self):
status = self.admin_socket(['status'])
self.id = status['id']
try:

View File

@ -389,8 +389,8 @@ def safe_kill(pid):
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):
@ -409,6 +409,15 @@ class LocalFuseMount(FuseMount):
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
@ -439,6 +448,8 @@ class LocalFuseMount(FuseMount):
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',
@ -519,6 +530,8 @@ class LocalFuseMount(FuseMount):
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
@ -829,7 +842,6 @@ class LocalContext(object):
def __del__(self):
shutil.rmtree(self.teuthology_config['test_path'])
def exec_test():
# Parse arguments
interactive_on_error = False
@ -897,6 +909,11 @@ def exec_test():
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:
@ -912,7 +929,7 @@ def exec_test():
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))
@ -921,11 +938,6 @@ def exec_test():
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):