]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
qa: add test for cephx path check on unlinked snapped dir tree
authorPatrick Donnelly <pdonnell@redhat.com>
Thu, 4 Jul 2024 02:01:17 +0000 (22:01 -0400)
committerPatrick Donnelly <pdonnell@redhat.com>
Thu, 29 Aug 2024 20:23:56 +0000 (16:23 -0400)
Signed-off-by: Patrick Donnelly <pdonnell@redhat.com>
(cherry picked from commit 61381768ba93f507694ef1758bd3e51b8b6b5ca0)

qa/tasks/cephfs/test_snapshots.py

index ba3bc0fbd8af0ded5438f28505899764f8069c0b..c2184c41efff17e18d9f1392c2f9c609abdc8fd4 100644 (file)
@@ -376,6 +376,32 @@ class TestSnapshots(CephFSTestCase):
 
         self.mount_a.run_shell(["rmdir", Raw("d0/d2/dir/.snap/*")])
 
+    def test_snapshot_check_access(self):
+        """
+        """
+
+        self.mount_a.run_shell_payload("mkdir -p dir1/dir2")
+        self.mount_a.umount_wait(require_clean=True)
+
+        newid = 'foo'
+        keyring = self.fs.authorize(newid, ('/dir1', 'rws'))
+        keyring_path = self.mount_a.client_remote.mktemp(data=keyring)
+        self.mount_a.remount(client_id=newid, client_keyring_path=keyring_path, cephfs_mntpt='/dir1')
+
+        self.mount_a.run_shell_payload("pushd dir2; dd if=/dev/urandom of=file bs=4k count=1;")
+        self.mount_a.run_shell_payload("mkdir .snap/one")
+        self.mount_a.run_shell_payload("rm -rf dir2")
+        # ???
+        # Session check_access path ~mds0/stray3/10000000001/file
+        # 2024-07-04T02:05:07.884+0000 7f319ce86640 20 Session check_access: [inode 0x10000000002 [2,2] ~mds0/stray2/10000000001/file ...] caller_uid=1141 caller_gid=1141 caller_gid_list=[1000,1141]
+        # 2024-07-04T02:05:07.884+0000 7f319ce86640 20 Session check_access path ~mds0/stray2/10000000001/file
+        # should be
+        # 2024-07-04T02:11:26.990+0000 7f6b14e71640 20 Session check_access: [inode 0x10000000002 [2,2] ~mds0/stray2/10000000001/file ...] caller_uid=1141 caller_gid=1141 caller_gid_list=[1000,1141]
+        # 2024-07-04T02:11:26.990+0000 7f6b14e71640 20 Session check_access stray_prior_path /dir1/dir2
+        # 2024-07-04T02:11:26.990+0000 7f6b14e71640 10 MDSAuthCap is_capable inode(path /dir1/dir2 owner 1141:1141 mode 0100644) by caller 1141:1141 mask 1 new 0:0 cap: MDSAuthCaps[allow rws fsname=cephfs path="/dir1"]
+        self.mount_a.run_shell_payload("stat .snap/one/dir2/file")
+
+
     def test_multimds_mksnap(self):
         """
         check if snapshot takes effect across authority subtrees