]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
qa/cephfs: add 'root_squash' check from the keyring
authorXiubo Li <xiubli@redhat.com>
Mon, 4 Dec 2023 06:15:47 +0000 (14:15 +0800)
committerXiubo Li <xiubli@redhat.com>
Sun, 28 Apr 2024 01:25:29 +0000 (09:25 +0800)
Fixes: https://tracker.ceph.com/issues/63141
Signed-off-by: Xiubo Li <xiubli@redhat.com>
(cherry picked from commit bdabe22a0d3a4c0bbc9da3697add00639f688c18)

qa/tasks/cephfs/caps_helper.py
qa/tasks/cephfs/test_admin.py

index 2b02ea71ea0417edff4c5185f49915591a55bffc..c9ac2803e4785839cb41cffaa9268a163d519747 100644 (file)
@@ -66,7 +66,7 @@ def gen_mds_cap_str(caps):
 
     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}'
@@ -74,6 +74,8 @@ def gen_mds_cap_str(caps):
             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:
index ee2c72f900ef8566a0902a90ed08df439f0ed1dd..afac6f1dfcbd234705cacf89836541c74cd3f6a7 100644 (file)
@@ -1688,7 +1688,7 @@ class TestFsAuthorizeUpdate(CephFSTestCase):
         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)