]> git.ipfire.org Git - thirdparty/samba.git/commitdiff
tests: Check that query_directory lists the reparse tag
authorVolker Lendecke <vl@samba.org>
Mon, 2 Jan 2023 15:01:28 +0000 (16:01 +0100)
committerJeremy Allison <jra@samba.org>
Tue, 4 Jun 2024 16:35:34 +0000 (16:35 +0000)
With the source3/ based clilist.c, we can't test all infolevels where
this matters (see callers of get_dirent_ea_size()). But porting the
source4 based all-infolevel search code into source3/libsmb or doing
this one the reparse point test in the source4 infrastructure to me
seems like a lot of effort for moderate gain.

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
python/samba/tests/reparsepoints.py
selftest/knownfail.d/reparse

index 1f74c61bc64c29c7f98ef7497b95bcb4e66d62d9..bf96def422dc15e51bf0bb00679b5c18c18c91e7 100644 (file)
@@ -170,6 +170,26 @@ class ReparsePoints(samba.tests.libsmb.LibsmbTests):
         conn.delete_on_close(fd, 1)
         conn.close(fd)
 
+    def test_query_dir_reparse(self):
+        conn = self.connection()
+        filename = 'reparse'
+        self.clean_file(conn, filename)
+
+        fd = conn.create(
+            filename,
+            DesiredAccess=sec.SEC_FILE_WRITE_ATTRIBUTE,
+            CreateDisposition=libsmb.FILE_CREATE)
+        b = reparse_symlink.symlink_put("y", "y", 0, 0)
+        conn.fsctl(fd, libsmb.FSCTL_SET_REPARSE_POINT, b, 0)
+        conn.close(fd)
+
+        dirents = conn.list("", filename)
+        self.assertEqual(
+            dirents[0]["reparse_tag"],
+            libsmb.IO_REPARSE_TAG_SYMLINK)
+
+        self.clean_file(conn, filename)
+
     # Show that directories can carry reparse points
 
     def test_create_reparse_directory(self):
index 11d094aa5c698580b2c4be996fbc38800cd8ef66..0e6654b2084c426ee4230ea2995dcc978a079738 100644 (file)
@@ -1,2 +1,3 @@
 ^samba.tests.reparsepoints.samba.tests.reparsepoints.ReparsePoints.test_create_reparse_directory
 ^samba.tests.reparsepoints.samba.tests.reparsepoints.ReparsePoints.test_create_reparse_nonempty_directory
+^samba.tests.reparsepoints.samba.tests.reparsepoints.ReparsePoints.test_query_dir_reparse