1
0
mirror of https://github.com/samba-team/samba.git synced 2025-12-17 04:23:50 +03:00

tests: Check that we return the posix type in query_directory

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
This commit is contained in:
Volker Lendecke
2024-09-23 19:37:15 +02:00
committed by Ralph Boehme
parent 529951ade5
commit 83794d08bc
2 changed files with 15 additions and 3 deletions

View File

@@ -297,18 +297,28 @@ class Smb3UnixTests(samba.tests.libsmb.LibsmbTests):
for fname,perm in test_files.items():
self.assertIn(get_string(fname), found_files.keys(),
'Test file not found')
self.assertEqual(test_files[fname], found_files[fname]['perms'],
found_unixmode = found_files[fname]['perms']
found_perms = found_unixmode & (stat.S_IRWXU|
stat.S_IRWXG|
stat.S_IRWXO|
stat.S_ISUID|
stat.S_ISGID|
stat.S_ISVTX)
self.assertEqual(test_files[fname], found_perms,
'Requested %04o, Received %04o' % \
(test_files[fname], found_files[fname]['perms']))
(test_files[fname], found_perms))
self.assertEqual(found_files[fname]['reparse_tag'],
libsmb.IO_REPARSE_TAG_RESERVED_ZERO)
self.assertEqual(found_files[fname]['perms'], perm)
self.assertEqual(found_perms, perm)
self.assertEqual(found_files[fname]['owner_sid'],
self.samsid + "-1000")
self.assertTrue(found_files[fname]['group_sid'].startswith("S-1-22-2-"))
if fname.startswith("testfile"):
self.assertTrue(stat.S_ISREG(found_unixmode))
self.assertEqual(found_files[fname]['nlink'], 1)
self.assertEqual(found_files[fname]['size'], 4)
self.assertEqual(found_files[fname]['allocaction_size'],
@@ -316,6 +326,7 @@ class Smb3UnixTests(samba.tests.libsmb.LibsmbTests):
self.assertEqual(found_files[fname]['attrib'],
libsmb.FILE_ATTRIBUTE_ARCHIVE)
else:
self.assertTrue(stat.S_ISDIR(found_unixmode))
# Note: btrfs always reports the link count of directories as one.
if self.fstype == "btrfs":
self.assertEqual(found_files[fname]['nlink'], 1)