self.fuse_daemon = None
self._fuse_conn = None
- def mount(self, mount_path=None):
+ def mount(self, mount_path=None, mount_fs_name=None):
log.info("Client client.%s config is %s" % (self.client_id, self.client_config))
daemon_signal = 'kill'
if mount_path is not None:
fuse_cmd += ["--client_mountpoint={0}".format(mount_path)]
+ if mount_fs_name is not None:
+ fuse_cmd += ["--client_mds_namespace={0}".format(mount_fs_name)]
+
fuse_cmd += [
'--name', 'client.{id}'.format(id=self.client_id),
# TODO ceph-fuse doesn't understand dash dash '--',
],
)
- def mount(self, mount_path=None):
+ def mount(self, mount_path=None, mount_fs_name=None):
log.info('Mounting kclient client.{id} at {remote} {mnt}...'.format(
id=self.client_id, remote=self.client_remote, mnt=self.mountpoint))
if mount_path is None:
mount_path = "/"
+ opts = 'name={id},secretfile={secret}'.format(id=self.client_id,
+ secret=secret)
+
+ if mount_fs_name is not None:
+ opts += ",mds_namespace={0}".format(mount_fs_name)
+
self.client_remote.run(
args=[
'sudo',
self.mountpoint,
'-v',
'-o',
- 'name={id},secretfile={secret}'.format(id=self.client_id,
- secret=secret),
+ opts
],
)
def is_mounted(self):
raise NotImplementedError()
- def mount(self, mount_path=None):
+ def mount(self, mount_path=None, mount_fs_name=None):
raise NotImplementedError()
def umount(self):
fs_a, fs_b = self._setup_two()
# Mount a client on fs_a
- fs_a.set_ceph_conf(
- "client.{0}".format(self.mount_a.client_id),
- "client_mds_namespace", fs_a.name
- )
- self.mount_a.mount()
+ self.mount_a.mount(mount_fs_name=fs_a.name)
self.mount_a.write_n_mb("pad.bin", 1)
self.mount_a.write_n_mb("test.bin", 2)
a_created_ino = self.mount_a.path_to_ino("test.bin")
self.mount_a.create_files()
# Mount a client on fs_b
- fs_b.set_ceph_conf(
- "client.{0}".format(self.mount_b.client_id),
- "client_mds_namespace", fs_b.name
- )
- self.mount_b.mount()
+ self.mount_b.mount(mount_fs_name=fs_b.name)
self.mount_b.write_n_mb("test.bin", 1)
b_created_ino = self.mount_b.path_to_ino("test.bin")
self.mount_b.create_files()
if self.is_mounted():
super(LocalFuseMount, self).umount()
- def mount(self, mount_path=None):
+ def mount(self, mount_path=None, mount_fs_name=None):
self.client_remote.run(
args=[
'mkdir',
if mount_path is not None:
prefix += ["--client_mountpoint={0}".format(mount_path)]
+ if mount_fs_name is not None:
+ prefix += ["--client_mds_namespace={0}".format(mount_fs_name)]
+
self.fuse_daemon = self.client_remote.run(args=
prefix + [
"-f",