1
0
mirror of https://github.com/samba-team/samba.git synced 2025-12-17 04:23:50 +03:00

tests: move wire_mode_to_unix() to libsmb.py

Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Volker Lendecke <vl@samba.org>
This commit is contained in:
Ralph Boehme
2024-11-26 14:52:52 +01:00
parent 02cc280710
commit d46bfc5d50
2 changed files with 8 additions and 7 deletions

View 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)

View 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,