From 1dba6d3cfc53931d3c8968e12e0d9cde272824be Mon Sep 17 00:00:00 2001 From: Volker Lendecke Date: Mon, 2 Jan 2023 16:01:28 +0100 Subject: [PATCH] tests: Check that query_directory lists the reparse tag 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 Reviewed-by: Jeremy Allison --- python/samba/tests/reparsepoints.py | 20 ++++++++++++++++++++ selftest/knownfail.d/reparse | 1 + 2 files changed, 21 insertions(+) diff --git a/python/samba/tests/reparsepoints.py b/python/samba/tests/reparsepoints.py index 1f74c61bc64..bf96def422d 100644 --- a/python/samba/tests/reparsepoints.py +++ b/python/samba/tests/reparsepoints.py @@ -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): diff --git a/selftest/knownfail.d/reparse b/selftest/knownfail.d/reparse index 11d094aa5c6..0e6654b2084 100644 --- a/selftest/knownfail.d/reparse +++ b/selftest/knownfail.d/reparse @@ -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 -- 2.47.3