Skip to content

Commit bdabe22

Browse files
committed
qa/cephfs: add 'root_squash' check from the keyring
Fixes: https://tracker.ceph.com/issues/63141 Signed-off-by: Xiubo Li <[email protected]>
1 parent c66cb5e commit bdabe22

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

qa/tasks/cephfs/caps_helper.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,14 +66,16 @@ def gen_mds_cap_str(caps):
6666
6767
caps = ((perm1, fsname1, cephfs_mntpt1), (perm2, fsname2, cephfs_mntpt2))
6868
"""
69-
def _gen_mds_cap_str(perm, fsname=None, cephfs_mntpt='/'):
69+
def _gen_mds_cap_str(perm, fsname=None, cephfs_mntpt='/', root_squash=False):
7070
mds_cap = f'allow {perm}'
7171
if fsname:
7272
mds_cap += f' fsname={fsname}'
7373
if cephfs_mntpt != '/':
7474
if cephfs_mntpt[0] == '/':
7575
cephfs_mntpt = cephfs_mntpt[1:]
7676
mds_cap += f' path={cephfs_mntpt}'
77+
if root_squash:
78+
mds_cap += ' root_squash'
7779
return mds_cap
7880

7981
if len(caps) == 1:

qa/tasks/cephfs/test_admin.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1688,7 +1688,7 @@ def test_idem_unaffected_root_squash(self):
16881688
keyring = self.fs.mon_manager.get_keyring(self.client_id)
16891689
moncap = gen_mon_cap_str((('r', self.fs.name,),))
16901690
osdcap = gen_osd_cap_str(((PERM, self.fs.name),))
1691-
mdscap = gen_mds_cap_str(((PERM, self.fs.name, PATH),))
1691+
mdscap = gen_mds_cap_str(((PERM, self.fs.name, PATH, True),))
16921692
for cap in (moncap, osdcap, mdscap):
16931693
self.assertIn(cap, keyring)
16941694
self._remount(self.mount_a, self.fs.name, keyring, PATH)

0 commit comments

Comments
 (0)