]> git.ipfire.org Git - thirdparty/samba.git/commitdiff
tests: check reparse tag and POSIX file type from query-file with POSIX infolevel
authorRalph Boehme <slow@samba.org>
Tue, 26 Nov 2024 13:54:29 +0000 (14:54 +0100)
committerRalph Boehme <slow@samba.org>
Wed, 27 Nov 2024 18:22:29 +0000 (18:22 +0000)
Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Volker Lendecke <vl@samba.org>
python/samba/tests/reparsepoints.py
selftest/knownfail.d/samba.tests.reparsepoints [new file with mode: 0644]

index 130fdca911c44bc4a42f355134eae4fc260a1eee..50e1fb591826928c5ee43e291293692ca8571811 100644 (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)
diff --git a/selftest/knownfail.d/samba.tests.reparsepoints b/selftest/knownfail.d/samba.tests.reparsepoints
new file mode 100644 (file)
index 0000000..fb7205e
--- /dev/null
@@ -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\)