1
0
mirror of https://github.com/samba-team/samba.git synced 2025-03-11 16:58:40 +03:00

tests: check reparse tag and POSIX file type from query-file with POSIX infolevel

Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Volker Lendecke <vl@samba.org>
This commit is contained in:
Ralph Boehme 2024-11-26 14:54:29 +01:00
parent 44a2458ca4
commit 26e8105518
2 changed files with 13 additions and 3 deletions

View File

@ -405,22 +405,30 @@ class ReparsePoints(samba.tests.libsmb.LibsmbTests):
def do_test_nfs_reparse(self, filename, filetype, nfstype):
"""Test special file reparse tag"""
smb2 = self.connection()
smb2 = self.connection(posix=True)
smb1 = self.connection_posix()
self.clean_file(smb2, filename)
smb1.mknod(filename, filetype | 0o755)
fd = smb2.create(
fd,_,_ = smb2.create_ex(
filename,
DesiredAccess=sec.SEC_FILE_READ_ATTRIBUTE|sec.SEC_STD_DELETE,
CreateOptions=libsmb.FILE_OPEN_REPARSE_POINT,
CreateDisposition=libsmb.FILE_OPEN)
CreateDisposition=libsmb.FILE_OPEN,
ShareAccess=(libsmb.FILE_SHARE_READ|libsmb.FILE_SHARE_WRITE|libsmb.FILE_SHARE_DELETE),
CreateContexts=[posix_context(0o600)])
smb2.delete_on_close(fd, 1)
info = smb2.qfileinfo(fd, libsmb.FSCC_FILE_ATTRIBUTE_TAG_INFORMATION);
self.assertEqual(info['tag'], libsmb.IO_REPARSE_TAG_NFS)
info = smb2.qfileinfo(fd, libsmb.FSCC_FILE_POSIX_INFORMATION);
self.assertEqual(info['reparse_tag'], libsmb.IO_REPARSE_TAG_NFS)
type, perms = self.wire_mode_to_unix(info['perms'])
self.assertEqual(type, filetype)
reparse = smb2.fsctl(fd, libsmb.FSCTL_GET_REPARSE_POINT, b'', 1024)
(tag, ) = reparse_symlink.get(reparse)
self.assertEqual(tag, nfstype)

View File

@ -0,0 +1,2 @@
^samba.tests.reparsepoints.samba.tests.reparsepoints.ReparsePoints.test_fifo_reparse\(fileserver_smb1\)
^samba.tests.reparsepoints.samba.tests.reparsepoints.ReparsePoints.test_sock_reparse\(fileserver_smb1\)