]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
test_cephfs.py: add test for readlinkat()
authorRishabh Dave <ridave@redhat.com>
Wed, 5 Nov 2025 05:23:03 +0000 (10:53 +0530)
committerRishabh Dave <ridave@redhat.com>
Thu, 16 Apr 2026 12:39:17 +0000 (18:09 +0530)
Signed-off-by: Rishabh Dave <ridave@redhat.com>
src/test/pybind/test_cephfs.py

index 68210442f74b69c3fb00bb38913833d4a3a228c7..21d174cad8f19389acf85f8b9e99f418d6b1d533 100644 (file)
@@ -314,6 +314,22 @@ def test_readlink(testdir):
     cephfs.unlink(b'/file-2')
     cephfs.unlink(b'/file-1')
 
+def test_readlinkat(testdir):
+    cephfs.mkdir(b'dir1', 0o755)
+
+    fd = cephfs.open(b'dir1/file1', 'w', 0o755)
+    cephfs.write(fd, b'abcd', 0)
+    cephfs.close(fd)
+
+    cephfs.chdir('dir1')
+    cephfs.symlink('file1', 'slink1')
+    cephfs.chdir('..')
+
+    fd = cephfs.open('dir1', os.O_RDONLY | os.O_DIRECTORY, 0o755)
+    o = cephfs.readlinkat(fd, 'slink1', 100)
+    assert_equal(o, b'file1')
+    cephfs.close(fd)
+
 def test_delete_cwd(testdir):
     assert_equal(b"/", cephfs.getcwd())