Skip to content

Commit 6138176

Browse files
committed
qa: add test for cephx path check on unlinked snapped dir tree
Signed-off-by: Patrick Donnelly <[email protected]>
1 parent 9397f46 commit 6138176

File tree

1 file changed

+26
-0
lines changed

1 file changed

+26
-0
lines changed

qa/tasks/cephfs/test_snapshots.py

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -376,6 +376,32 @@ def _check_snapclient_cache(snaps_dump, cache_dump=None, rank=0):
376376

377377
self.mount_a.run_shell(["rmdir", Raw("d0/d2/dir/.snap/*")])
378378

379+
def test_snapshot_check_access(self):
380+
"""
381+
"""
382+
383+
self.mount_a.run_shell_payload("mkdir -p dir1/dir2")
384+
self.mount_a.umount_wait(require_clean=True)
385+
386+
newid = 'foo'
387+
keyring = self.fs.authorize(newid, ('/dir1', 'rws'))
388+
keyring_path = self.mount_a.client_remote.mktemp(data=keyring)
389+
self.mount_a.remount(client_id=newid, client_keyring_path=keyring_path, cephfs_mntpt='/dir1')
390+
391+
self.mount_a.run_shell_payload("pushd dir2; dd if=/dev/urandom of=file bs=4k count=1;")
392+
self.mount_a.run_shell_payload("mkdir .snap/one")
393+
self.mount_a.run_shell_payload("rm -rf dir2")
394+
# ???
395+
# Session check_access path ~mds0/stray3/10000000001/file
396+
# 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]
397+
# 2024-07-04T02:05:07.884+0000 7f319ce86640 20 Session check_access path ~mds0/stray2/10000000001/file
398+
# should be
399+
# 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]
400+
# 2024-07-04T02:11:26.990+0000 7f6b14e71640 20 Session check_access stray_prior_path /dir1/dir2
401+
# 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"]
402+
self.mount_a.run_shell_payload("stat .snap/one/dir2/file")
403+
404+
379405
def test_multimds_mksnap(self):
380406
"""
381407
check if snapshot takes effect across authority subtrees

0 commit comments

Comments
 (0)