diff --git a/qa/tasks/cephfs/mount.py b/qa/tasks/cephfs/mount.py index a5c0256c9bf..cf4369ed983 100644 --- a/qa/tasks/cephfs/mount.py +++ b/qa/tasks/cephfs/mount.py @@ -176,16 +176,12 @@ class CephFSMount(object): log.info('Ready to start {}...'.format(type(self).__name__)) def _create_mntpt(self): - stderr = StringIO() + self.client_remote.run(args=f'mkdir -p -v {self.hostfs_mntpt}', + timeout=60) # Use 0000 mode to prevent undesired modifications to the mountpoint on # the local file system. - script = f'mkdir -m 0000 -p -v {self.hostfs_mntpt}'.split() - try: - self.client_remote.run(args=script, timeout=(15*60), - stderr=stderr) - except CommandFailedError: - if 'file exists' not in stderr.getvalue().lower(): - raise + self.client_remote.run(args=f'chmod 0000 {self.hostfs_mntpt}', + timeout=60) @property def _nsenter_args(self): diff --git a/qa/tasks/vstart_runner.py b/qa/tasks/vstart_runner.py index 73480af9c80..e3781ad32ef 100644 --- a/qa/tasks/vstart_runner.py +++ b/qa/tasks/vstart_runner.py @@ -707,14 +707,11 @@ class LocalFuseMount(LocalCephFSMount, FuseMount): self._mount_cmd_cwd, self._mount_cmd_logger, \ self._mount_cmd_stdin = None, None, None + # XXX: CephFSMount._create_mntpt() sets mountpoint's permission mode to + # 0000 which doesn't work for vstart_runner since superuser privileges are + # not used for mounting Ceph FS with FUSE. def _create_mntpt(self): - stderr = StringIO() - script = f'mkdir -p -v {self.hostfs_mntpt}'.split() - try: - self.client_remote.run(args=script, stderr=stderr) - except CommandFailedError: - if 'file exists' not in stderr.getvalue().lower(): - raise + self.client_remote.run(args=f'mkdir -p -v {self.hostfs_mntpt}') def _run_mount_cmd(self, mntopts, check_status): super(type(self), self)._run_mount_cmd(mntopts, check_status)