diff --git a/python/samba/tests/smb1posix.py b/python/samba/tests/smb1posix.py index 52b0312ac8b..d77c49d0664 100644 --- a/python/samba/tests/smb1posix.py +++ b/python/samba/tests/smb1posix.py @@ -19,6 +19,7 @@ from samba.samba3 import libsmb_samba_internal as libsmb from samba import (ntstatus,NTSTATUSError) from samba.dcerpc import security as sec import samba.tests.libsmb +import stat class Smb1PosixTests(samba.tests.libsmb.LibsmbTests): @@ -47,6 +48,25 @@ class Smb1PosixTests(samba.tests.libsmb.LibsmbTests): conn.rmdir("lower/second") conn.rmdir("lower") + def test_mknod(self): + """Test SMB1 posix mknod""" + conn = libsmb.Conn( + self.server_ip, + "posix_share", + self.lp, + self.creds, + force_smb1=True) + conn.smb1_posix() + + def do_test(name, filetype): + conn.mknod(name, filetype | 0o755) + st = conn.smb1_stat(name) + self.assertEqual(st["mode"], filetype | 0o755) + conn.unlink(name) + + do_test("fifo", stat.S_IFIFO) + do_test("sock", stat.S_IFSOCK) + if __name__ == '__main__': import unittest unittest.main() diff --git a/selftest/skip.opath-required b/selftest/skip.opath-required index 0faf0c4bd6c..c3a13f5ec6e 100644 --- a/selftest/skip.opath-required +++ b/selftest/skip.opath-required @@ -7,3 +7,10 @@ # These fail because become_root() doesn't work in make test ^samba3.blackbox.dropbox.* ^samba3.raw.samba3hide.* + +# samba.tests.smb1posix.samba.tests.smb1posix.Smb1PosixTests.test_mknod +# creates a socket and posix stat() gives an error because opening the +# socket from filename_covert_dirfsp() returns ENXIO. With O_PATH +# available this works fine. So for now restrict testing posix +# extensions to environments where we have O_PATH around +^samba.tests.smb1posix