summaryrefslogtreecommitdiff
path: root/python
diff options
context:
space:
mode:
authorJule Anger <janger@samba.org>2024-08-19 11:09:53 +0200
committerVolker Lendecke <vl@samba.org>2024-10-14 08:48:07 +0000
commit1428519372bfdee9521d377a399f3cc0d1dd1283 (patch)
tree7111782aefd0de1d473fbd8d79d4c2801e92b414 /python
parent6db94eda82c9cd954279663d73f9435a2899780f (diff)
downloadsamba-1428519372bfdee9521d377a399f3cc0d1dd1283.tar.gz
samba-1428519372bfdee9521d377a399f3cc0d1dd1283.tar.bz2
samba-1428519372bfdee9521d377a399f3cc0d1dd1283.zip
tests: add test for cli_get_posix_fs_info
Signed-off-by: Jule Anger <janger@samba.org> Reviewed-by: Volker Lendecke <vl@samba.org> Autobuild-User(master): Volker Lendecke <vl@samba.org> Autobuild-Date(master): Mon Oct 14 08:48:07 UTC 2024 on atb-devel-224
Diffstat (limited to 'python')
-rw-r--r--python/samba/tests/smb3unix.py20
1 files changed, 20 insertions, 0 deletions
diff --git a/python/samba/tests/smb3unix.py b/python/samba/tests/smb3unix.py
index d8e8783670a..302b34776d7 100644
--- a/python/samba/tests/smb3unix.py
+++ b/python/samba/tests/smb3unix.py
@@ -490,3 +490,23 @@ class Smb3UnixTests(samba.tests.libsmb.LibsmbTests):
l = winconn.list('', mask='test_delete_on_close')
found_files = {get_string(f['name']): f for f in l}
self.assertFalse('test_delete_on_close' in found_files)
+
+ def test_posix_fs_info(self):
+ """
+ Test the posix filesystem attributes list given by cli_get_posix_fs_info.
+ With a non-posix connection, a NT_STATUS_INVALID_INFO_CLASS error
+ is expected.
+ """
+ (winconn, posixconn) = self.connections()
+
+ try:
+ posix_info = posixconn.get_posix_fs_info()
+ except Exception as e:
+ self.fail(str(e))
+ self.assertTrue(isinstance(posix_info, dict))
+ self.assertTrue('optimal_transfer_size' in posix_info)
+
+ with self.assertRaises(NTSTATUSError) as cm:
+ winconn.get_posix_fs_info()
+ e = cm.exception
+ self.assertEqual(e.args[0], ntstatus.NT_STATUS_INVALID_INFO_CLASS)