1 # Unix SMB/CIFS implementation.
2 # Copyright Volker Lendecke <vl@samba.org> 2022
4 # This program is free software; you can redistribute it and/or modify
5 # it under the terms of the GNU General Public License as published by
6 # the Free Software Foundation; either version 3 of the License, or
7 # (at your option) any later version.
9 # This program is distributed in the hope that it will be useful,
10 # but WITHOUT ANY WARRANTY; without even the implied warranty of
11 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 # GNU General Public License for more details.
14 # You should have received a copy of the GNU General Public License
15 # along with this program. If not, see <http://www.gnu.org/licenses/>.
18 from samba.samba3 import libsmb_samba_internal as libsmb
19 from samba import (ntstatus,NTSTATUSError)
20 from samba.dcerpc import security as sec
21 import samba.tests.libsmb
24 class Smb1PosixTests(samba.tests.libsmb.LibsmbTests):
26 def test_directory_case_sensivity(self):
27 """Test that in smb1 posix dirs are case sensitive"""
38 except NTSTATUSError as e:
39 if e.args[0] != ntstatus.NT_STATUS_OBJECT_NAME_COLLISION:
42 conn.mkdir("lower/second")
43 except NTSTATUSError as e:
44 if e.args[0] != ntstatus.NT_STATUS_OBJECT_NAME_COLLISION:
47 self.assertFalse(conn.chkpath("Lower/second"))
48 conn.rmdir("lower/second")
52 """Test SMB1 posix mknod"""
61 def do_test(name, filetype):
62 conn.mknod(name, filetype | 0o755)
63 st = conn.smb1_stat(name)
64 self.assertEqual(st["mode"], filetype | 0o755)
67 do_test("fifo", stat.S_IFIFO)
68 do_test("sock", stat.S_IFSOCK)
70 if __name__ == '__main__':