]> git.ipfire.org Git - thirdparty/samba.git/commitdiff
tests: add test for cli_get_posix_fs_info
authorJule Anger <janger@samba.org>
Mon, 19 Aug 2024 09:09:53 +0000 (11:09 +0200)
committerVolker Lendecke <vl@samba.org>
Mon, 14 Oct 2024 08:48:07 +0000 (08:48 +0000)
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

python/samba/tests/smb3unix.py

index d8e8783670a8eae7e2f1294931b01bbd97ef16a6..302b34776d7b08b644869a6f823ccc831ed4d911 100644 (file)
@@ -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)