From: Ralph Boehme Date: Tue, 26 Nov 2024 13:52:52 +0000 (+0100) Subject: tests: move wire_mode_to_unix() to libsmb.py X-Git-Tag: tdb-1.4.13~464 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=d46bfc5d50e3d382eec28d09ca92d0b107c0e2db;p=thirdparty%2Fsamba.git tests: move wire_mode_to_unix() to libsmb.py Signed-off-by: Ralph Boehme Reviewed-by: Volker Lendecke --- diff --git a/python/samba/tests/libsmb.py b/python/samba/tests/libsmb.py index cb632d0e3a7..3ac1b68a59b 100644 --- a/python/samba/tests/libsmb.py +++ b/python/samba/tests/libsmb.py @@ -24,6 +24,7 @@ from samba import credentials from samba import (ntstatus,NTSTATUSError) import samba.tests import os +import stat class LibsmbTests(samba.tests.TestCase): @@ -53,3 +54,10 @@ class LibsmbTests(samba.tests.TestCase): elif not (e.args[0] == ntstatus.NT_STATUS_OBJECT_NAME_NOT_FOUND or e.args[0] == ntstatus.NT_STATUS_OBJECT_PATH_NOT_FOUND): raise + + def wire_mode_to_unix(self, wire): + mode = libsmb.wire_mode_to_unix(wire) + type = stat.S_IFMT(mode) + perms = mode & (stat.S_IRWXU|stat.S_IRWXG|stat.S_IRWXO| + stat.S_ISUID|stat.S_ISGID|stat.S_ISVTX) + return (type, perms) diff --git a/python/samba/tests/smb3unix.py b/python/samba/tests/smb3unix.py index df845d9e0c0..7d2529ad747 100644 --- a/python/samba/tests/smb3unix.py +++ b/python/samba/tests/smb3unix.py @@ -70,13 +70,6 @@ class Smb3UnixTests(samba.tests.libsmb.LibsmbTests): return (conn1, conn2) - def wire_mode_to_unix(self, wire): - mode = libsmb.wire_mode_to_unix(wire) - type = stat.S_IFMT(mode) - perms = mode & (stat.S_IRWXU|stat.S_IRWXG|stat.S_IRWXO| - stat.S_ISUID|stat.S_ISGID|stat.S_ISVTX) - return (type, perms) - def test_negotiate_context_posix(self): c = libsmb.Conn( self.server_ip,