caps = ((perm1, fsname1, cephfs_mntpt1), (perm2, fsname2, cephfs_mntpt2))
"""
- def _gen_mds_cap_str(perm, fsname=None, cephfs_mntpt='/'):
+ def _gen_mds_cap_str(perm, fsname=None, cephfs_mntpt='/', root_squash=False):
mds_cap = f'allow {perm}'
if fsname:
mds_cap += f' fsname={fsname}'
if cephfs_mntpt[0] == '/':
cephfs_mntpt = cephfs_mntpt[1:]
mds_cap += f' path={cephfs_mntpt}'
+ if root_squash:
+ mds_cap += ' root_squash'
return mds_cap
if len(caps) == 1:
keyring = self.fs.mon_manager.get_keyring(self.client_id)
moncap = gen_mon_cap_str((('r', self.fs.name,),))
osdcap = gen_osd_cap_str(((PERM, self.fs.name),))
- mdscap = gen_mds_cap_str(((PERM, self.fs.name, PATH),))
+ mdscap = gen_mds_cap_str(((PERM, self.fs.name, PATH, True),))
for cap in (moncap, osdcap, mdscap):
self.assertIn(cap, keyring)
self._remount(self.mount_a, self.fs.name, keyring, PATH)