mirror of
https://github.com/ceph/ceph
synced 2025-01-21 02:31:19 +00:00
qa: add new mntargs option for fuse
test_client_recovery was also using mntopts to specify additional options to ceph-fuse. Because the two prior commits unify the behavior of ceph-fuse and the kernel mount so that the "-o" option is available for both, that changes breaks this test. Add a special set of args available only for fuse (there is no equivalent on the kernel). Signed-off-by: Patrick Donnelly <pdonnell@redhat.com>
This commit is contained in:
parent
d3295628eb
commit
483b16062d
@ -166,7 +166,7 @@ def task(ctx, config):
|
||||
for info in mounted_by_me.values():
|
||||
config = info["config"]
|
||||
mount_x = info['mount']
|
||||
mount_x.mount(mntopts=config.get('mntopts', []))
|
||||
mount_x.mount(mntopts=config.get('mntopts', []), mntargs=config.get('mntargs', []))
|
||||
|
||||
for info in mounted_by_me.values():
|
||||
info["mount"].wait_until_mounted()
|
||||
|
@ -42,14 +42,14 @@ class FuseMount(CephFSMount):
|
||||
self._mount_cmd_logger = log.getChild('ceph-fuse.{id}'.format(id=self.client_id))
|
||||
self._mount_cmd_stdin = run.PIPE
|
||||
|
||||
def mount(self, mntopts=None, check_status=True, **kwargs):
|
||||
def mount(self, mntopts=None, check_status=True, mntargs=None, **kwargs):
|
||||
self.update_attrs(**kwargs)
|
||||
self.assert_and_log_minimum_mount_details()
|
||||
|
||||
self.setup_netns()
|
||||
|
||||
try:
|
||||
return self._mount(mntopts, check_status)
|
||||
return self._mount(mntopts, mntargs, check_status)
|
||||
except RuntimeError:
|
||||
# Catch exceptions by the mount() logic (i.e. not remote command
|
||||
# failures) and ensure the mount is not left half-up.
|
||||
@ -59,20 +59,20 @@ class FuseMount(CephFSMount):
|
||||
self.umount_wait(force=True)
|
||||
raise
|
||||
|
||||
def _mount(self, mntopts, check_status):
|
||||
def _mount(self, mntopts, mntargs, check_status):
|
||||
log.info("Client client.%s config is %s" % (self.client_id,
|
||||
self.client_config))
|
||||
|
||||
self._create_mntpt()
|
||||
|
||||
retval = self._run_mount_cmd(mntopts, check_status)
|
||||
retval = self._run_mount_cmd(mntopts, mntargs, check_status)
|
||||
if retval:
|
||||
return retval
|
||||
|
||||
self.gather_mount_info()
|
||||
|
||||
def _run_mount_cmd(self, mntopts, check_status):
|
||||
mount_cmd = self._get_mount_cmd(mntopts)
|
||||
def _run_mount_cmd(self, mntopts, mntargs, check_status):
|
||||
mount_cmd = self._get_mount_cmd(mntopts, mntargs)
|
||||
mountcmd_stdout, mountcmd_stderr = StringIO(), StringIO()
|
||||
|
||||
# Before starting ceph-fuse process, note the contents of
|
||||
@ -93,7 +93,7 @@ class FuseMount(CephFSMount):
|
||||
return self._wait_and_record_our_fuse_conn(
|
||||
check_status, pre_mount_conns, mountcmd_stdout, mountcmd_stderr)
|
||||
|
||||
def _get_mount_cmd(self, mntopts):
|
||||
def _get_mount_cmd(self, mntopts, mntargs):
|
||||
daemon_signal = 'kill'
|
||||
if self.client_config.get('coverage') or \
|
||||
self.client_config.get('valgrind') is not None:
|
||||
@ -121,6 +121,8 @@ class FuseMount(CephFSMount):
|
||||
mount_cmd += ["--client_fs=" + self.cephfs_name]
|
||||
if mntopts:
|
||||
mount_cmd.extend(('-o', ','.join(mntopts)))
|
||||
if mntargs:
|
||||
mount_cmd.extend(mntargs)
|
||||
|
||||
return mount_cmd
|
||||
|
||||
|
@ -644,7 +644,7 @@ class TestClientRecovery(CephFSTestCase):
|
||||
self.mount_a.umount_wait()
|
||||
|
||||
if isinstance(self.mount_a, FuseMount):
|
||||
self.mount_a.mount_wait(mntopts=['--client_reconnect_stale=1', '--fuse_disable_pagecache=1'])
|
||||
self.mount_a.mount_wait(mntargs=['--client_reconnect_stale=1', '--fuse_disable_pagecache=1'])
|
||||
else:
|
||||
try:
|
||||
self.mount_a.mount_wait(mntopts=['recover_session=clean'])
|
||||
|
Loading…
Reference in New Issue
Block a user