libsmb: Use clistr_smb2_extract_snapshot_token() in cli_smb2_create_fnum_send()
[Samba.git] / python / samba / tests / smb1posix.py
blob52b0312ac8bdd9cdc500dbed0260dfcef8ee43a6
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
23 class Smb1PosixTests(samba.tests.libsmb.LibsmbTests):
25 def test_directory_case_sensivity(self):
26 """Test that in smb1 posix dirs are case sensitive"""
27 conn = libsmb.Conn(
28 self.server_ip,
29 "posix_share",
30 self.lp,
31 self.creds,
32 force_smb1=True)
33 conn.smb1_posix()
35 try:
36 conn.mkdir("lower")
37 except NTSTATUSError as e:
38 if e.args[0] != ntstatus.NT_STATUS_OBJECT_NAME_COLLISION:
39 raise
40 try:
41 conn.mkdir("lower/second")
42 except NTSTATUSError as e:
43 if e.args[0] != ntstatus.NT_STATUS_OBJECT_NAME_COLLISION:
44 raise
46 self.assertFalse(conn.chkpath("Lower/second"))
47 conn.rmdir("lower/second")
48 conn.rmdir("lower")
50 if __name__ == '__main__':
51 import unittest
52 unittest.main()