Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[DNM] quincy: qa: avoid explicit set to client mountpoint as "/" #51049

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
4 changes: 4 additions & 0 deletions qa/tasks/cephfs/fuse_mount.py
Expand Up @@ -113,8 +113,12 @@ def _get_mount_cmd(self, mntopts):
mount_cmd += ['--id', self.client_id]
if self.client_keyring_path and self.client_id:
mount_cmd += ['-k', self.client_keyring_path]

self.validate_subvol_options()

if self.cephfs_mntpt:
mount_cmd += ["--client_mountpoint=" + self.cephfs_mntpt]

if self.cephfs_name:
mount_cmd += ["--client_fs=" + self.cephfs_name]
if mntopts:
Expand Down
16 changes: 16 additions & 0 deletions qa/tasks/cephfs/mount.py
Expand Up @@ -1378,3 +1378,19 @@ def dir_checksum(self, path=None, follow_symlinks=False):
checksum_text = self.run_shell(cmd).stdout.getvalue().strip()
checksum_sorted = sorted(checksum_text.split('\n'), key=lambda v: v.split()[1])
return hashlib.md5(('\n'.join(checksum_sorted)).encode('utf-8')).hexdigest()

def validate_subvol_options(self):
mount_subvol_num = self.client_config.get('mount_subvol_num', None)
if self.cephfs_mntpt and mount_subvol_num is not None:
log.warning("You cannot specify both: cephfs_mntpt and mount_subvol_num")
log.info(f"Mounting subvol {mount_subvol_num} for now")

if mount_subvol_num is not None:
# mount_subvol must be an index into the subvol path array for the fs
if not self.cephfs_name:
self.cephfs_name = 'cephfs'
assert(hasattr(self.ctx, "created_subvols"))
# mount_subvol must be specified under client.[0-9] yaml section
subvol_paths = self.ctx.created_subvols[self.cephfs_name]
path_to_mount = subvol_paths[mount_subvol_num]
self.cephfs_mntpt = path_to_mount