]> git.ipfire.org Git - thirdparty/samba.git/commitdiff
tests: move wire_mode_to_unix() to libsmb.py
authorRalph Boehme <slow@samba.org>
Tue, 26 Nov 2024 13:52:52 +0000 (14:52 +0100)
committerRalph Boehme <slow@samba.org>
Wed, 27 Nov 2024 18:22:28 +0000 (18:22 +0000)
Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Volker Lendecke <vl@samba.org>
python/samba/tests/libsmb.py
python/samba/tests/smb3unix.py

index cb632d0e3a71a36cc9abdad98301599b1cc68516..3ac1b68a59b4f97f4d2a457548b8ec6a2a1844bb 100644 (file)
@@ -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)
index df845d9e0c0993b6832cc2f6e38e08fac714aad3..7d2529ad74705c0891fb166eb1f0cedfe918b187 100644 (file)
@@ -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,