From: Joseph Sutton Date: Thu, 24 Aug 2023 23:12:34 +0000 (+1200) Subject: s4:dsdb:tests: Remove unused imports X-Git-Tag: tevent-0.16.0~754 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=fec8d228ad1ad3215a125ba0719d503f89a9f35f;p=thirdparty%2Fsamba.git s4:dsdb:tests: Remove unused imports Signed-off-by: Joseph Sutton Reviewed-by: Andrew Bartlett --- diff --git a/source4/dsdb/tests/python/ad_dc_multi_bind.py b/source4/dsdb/tests/python/ad_dc_multi_bind.py index 564fb9e0a85..62ae9bcf47c 100644 --- a/source4/dsdb/tests/python/ad_dc_multi_bind.py +++ b/source4/dsdb/tests/python/ad_dc_multi_bind.py @@ -7,12 +7,6 @@ sys.path.insert(0, 'bin/python') import os import samba import samba.getopt as options -import random -import tempfile -import shutil -import time - -from samba.netcmd.main import cmd_sambatool # We try to use the test infrastructure of Samba 4.3+, but if it # doesn't work, we are probably in a back-ported patch and trying to @@ -32,9 +26,7 @@ except ImportError: from samba.samdb import SamDB from samba.auth import system_session -from ldb import Message, MessageElement, Dn, LdbError -from ldb import FLAG_MOD_ADD, FLAG_MOD_REPLACE, FLAG_MOD_DELETE -from ldb import SCOPE_BASE, SCOPE_SUBTREE, SCOPE_ONELEVEL +from ldb import SCOPE_BASE parser = optparse.OptionParser("ad_dc_multi_bind.py [options] ") sambaopts = options.SambaOptions(parser) diff --git a/source4/dsdb/tests/python/deletetest.py b/source4/dsdb/tests/python/deletetest.py index 7375f26e895..118e6b5b558 100755 --- a/source4/dsdb/tests/python/deletetest.py +++ b/source4/dsdb/tests/python/deletetest.py @@ -13,9 +13,9 @@ from samba.tests.subunitrun import SubunitOptions, TestProgram import samba.getopt as options from samba.auth import system_session -from ldb import SCOPE_BASE, LdbError, Message, MessageElement, Dn, FLAG_MOD_ADD, FLAG_MOD_DELETE, FLAG_MOD_REPLACE -from ldb import ERR_NO_SUCH_OBJECT, ERR_NOT_ALLOWED_ON_NON_LEAF, ERR_ENTRY_ALREADY_EXISTS, ERR_ATTRIBUTE_OR_VALUE_EXISTS -from ldb import ERR_UNWILLING_TO_PERFORM, ERR_OPERATIONS_ERROR +from ldb import SCOPE_BASE, LdbError +from ldb import ERR_NO_SUCH_OBJECT, ERR_NOT_ALLOWED_ON_NON_LEAF +from ldb import ERR_UNWILLING_TO_PERFORM from samba.samdb import SamDB from samba.tests import delete_force from samba import dsdb diff --git a/source4/dsdb/tests/python/ndr_pack_performance.py b/source4/dsdb/tests/python/ndr_pack_performance.py index 3b31a3a29a7..a608d1af1b8 100644 --- a/source4/dsdb/tests/python/ndr_pack_performance.py +++ b/source4/dsdb/tests/python/ndr_pack_performance.py @@ -8,13 +8,8 @@ import os import samba import samba.getopt as options import random -import tempfile -import shutil -import time import gzip -from samba.netcmd.main import cmd_sambatool - # We try to use the test infrastructure of Samba 4.3+, but if it # doesn't work, we are probably in a back-ported patch and trying to # run on 4.1 or something. @@ -31,9 +26,6 @@ except ImportError: from subunit.run import SubunitTestRunner import unittest -from samba.samdb import SamDB -from samba.auth import system_session - from samba.ndr import ndr_pack, ndr_unpack from samba.dcerpc import security from samba.dcerpc import drsuapi diff --git a/source4/dsdb/tests/python/notification.py b/source4/dsdb/tests/python/notification.py index a82b69afcfe..1124af1b4b0 100755 --- a/source4/dsdb/tests/python/notification.py +++ b/source4/dsdb/tests/python/notification.py @@ -31,15 +31,10 @@ from samba.auth import system_session from samba import ldb from samba.samdb import SamDB from samba.ndr import ndr_unpack -from samba import gensec -from samba.credentials import Credentials import samba.tests -from samba.auth import AUTH_SESSION_INFO_DEFAULT_GROUPS, AUTH_SESSION_INFO_AUTHENTICATED, AUTH_SESSION_INFO_SIMPLE_PRIVILEGES - -from ldb import SCOPE_SUBTREE, SCOPE_ONELEVEL, SCOPE_BASE, LdbError +from ldb import LdbError from ldb import ERR_TIME_LIMIT_EXCEEDED, ERR_ADMIN_LIMIT_EXCEEDED, ERR_UNWILLING_TO_PERFORM -from ldb import Message parser = optparse.OptionParser("notification.py [options] ") sambaopts = options.SambaOptions(parser) diff --git a/source4/dsdb/tests/python/priv_attrs.py b/source4/dsdb/tests/python/priv_attrs.py index 0450cc561db..74b3d1ef530 100644 --- a/source4/dsdb/tests/python/priv_attrs.py +++ b/source4/dsdb/tests/python/priv_attrs.py @@ -15,31 +15,27 @@ import samba import samba.getopt as options import samba.tests import ldb -import base64 sys.path.insert(0, "bin/python") -from samba.tests.subunitrun import TestProgram, SubunitOptions from samba.tests import DynamicTestCase from samba.subunit.run import SubunitTestRunner -from samba.auth import system_session from samba.samdb import SamDB -from samba.dcerpc import samr, security, lsa +from samba.dcerpc import security from samba.credentials import Credentials -from samba.ndr import ndr_unpack, ndr_pack +from samba.ndr import ndr_pack from samba.tests import delete_force from samba import gensec, sd_utils from samba.credentials import DONT_USE_KERBEROS -from ldb import SCOPE_SUBTREE, SCOPE_BASE, LdbError -from ldb import Message, MessageElement, Dn -from ldb import FLAG_MOD_ADD, FLAG_MOD_REPLACE, FLAG_MOD_DELETE -from samba.dsdb import UF_SCRIPT, UF_ACCOUNTDISABLE, UF_00000004, UF_HOMEDIR_REQUIRED, \ - UF_LOCKOUT, UF_PASSWD_NOTREQD, UF_PASSWD_CANT_CHANGE, UF_ENCRYPTED_TEXT_PASSWORD_ALLOWED,\ - UF_TEMP_DUPLICATE_ACCOUNT, UF_NORMAL_ACCOUNT, UF_00000400, UF_INTERDOMAIN_TRUST_ACCOUNT, \ - UF_WORKSTATION_TRUST_ACCOUNT, UF_SERVER_TRUST_ACCOUNT, UF_00004000, \ - UF_00008000, UF_DONT_EXPIRE_PASSWD, UF_MNS_LOGON_ACCOUNT, UF_SMARTCARD_REQUIRED, \ - UF_TRUSTED_FOR_DELEGATION, UF_NOT_DELEGATED, UF_USE_DES_KEY_ONLY, UF_DONT_REQUIRE_PREAUTH, \ - UF_PASSWORD_EXPIRED, UF_TRUSTED_TO_AUTHENTICATE_FOR_DELEGATION, UF_NO_AUTH_DATA_REQUIRED, \ - UF_PARTIAL_SECRETS_ACCOUNT, UF_USE_AES_KEYS +from ldb import SCOPE_BASE, LdbError +from samba.dsdb import ( + UF_NORMAL_ACCOUNT, + UF_PARTIAL_SECRETS_ACCOUNT, + UF_PASSWD_NOTREQD, + UF_SERVER_TRUST_ACCOUNT, + UF_TRUSTED_FOR_DELEGATION, + UF_TRUSTED_TO_AUTHENTICATE_FOR_DELEGATION, + UF_WORKSTATION_TRUST_ACCOUNT, +) parser = optparse.OptionParser("user_account_control.py [options] ") diff --git a/source4/dsdb/tests/python/rodc.py b/source4/dsdb/tests/python/rodc.py index 1a4b0f9b7ee..b089a2707ff 100755 --- a/source4/dsdb/tests/python/rodc.py +++ b/source4/dsdb/tests/python/rodc.py @@ -4,8 +4,6 @@ import optparse import sys import os -import base64 -import random import re import uuid @@ -21,8 +19,6 @@ from samba.samdb import SamDB from samba.ndr import ndr_pack, ndr_unpack from samba.dcerpc import drsblobs -import time - class RodcTestException(Exception): pass diff --git a/source4/dsdb/tests/python/rodc_rwdc.py b/source4/dsdb/tests/python/rodc_rwdc.py index 53d54807a3d..b2e8c732ed0 100644 --- a/source4/dsdb/tests/python/rodc_rwdc.py +++ b/source4/dsdb/tests/python/rodc_rwdc.py @@ -14,7 +14,6 @@ import itertools import time sys.path.insert(0, "bin/python") -import samba import ldb from samba.tests.subunitrun import SubunitOptions, TestProgram @@ -24,7 +23,7 @@ from samba.auth import system_session from samba.samdb import SamDB from samba.credentials import Credentials, DONT_USE_KERBEROS, MUST_USE_KERBEROS from samba import gensec, dsdb -from ldb import SCOPE_BASE, LdbError, ERR_INVALID_CREDENTIALS +from ldb import LdbError, ERR_INVALID_CREDENTIALS from samba.dcerpc import security, samr import os diff --git a/source4/dsdb/tests/python/sort.py b/source4/dsdb/tests/python/sort.py index a4d7b72f744..8c5ba4e5523 100644 --- a/source4/dsdb/tests/python/sort.py +++ b/source4/dsdb/tests/python/sort.py @@ -12,7 +12,7 @@ import re sys.path.insert(0, "bin/python") import samba -from samba.tests.subunitrun import SubunitOptions, TestProgram +from samba.tests.subunitrun import SubunitOptions from samba.common import cmp from functools import cmp_to_key import samba.getopt as options diff --git a/source4/dsdb/tests/python/subtree_rename.py b/source4/dsdb/tests/python/subtree_rename.py index ad5a5b88202..2828fe5ee4b 100644 --- a/source4/dsdb/tests/python/subtree_rename.py +++ b/source4/dsdb/tests/python/subtree_rename.py @@ -4,7 +4,6 @@ import optparse import sys import os -import itertools from time import time from binascii import hexlify diff --git a/source4/dsdb/tests/python/tombstone_reanimation.py b/source4/dsdb/tests/python/tombstone_reanimation.py index 787ed999c4b..88aebd6a605 100755 --- a/source4/dsdb/tests/python/tombstone_reanimation.py +++ b/source4/dsdb/tests/python/tombstone_reanimation.py @@ -26,7 +26,6 @@ import samba from samba.ndr import ndr_unpack, ndr_print from samba.dcerpc import misc -from samba.dcerpc import security from samba.dcerpc import drsblobs from samba.dcerpc.drsuapi import * from samba.tests.password_test import PasswordCommon diff --git a/source4/dsdb/tests/python/user_account_control.py b/source4/dsdb/tests/python/user_account_control.py index 04e61e9e791..1506dcd37f8 100755 --- a/source4/dsdb/tests/python/user_account_control.py +++ b/source4/dsdb/tests/python/user_account_control.py @@ -15,23 +15,19 @@ import samba import samba.getopt as options import samba.tests import ldb -import base64 sys.path.insert(0, "bin/python") -from samba.tests.subunitrun import TestProgram, SubunitOptions from samba.subunit.run import SubunitTestRunner from samba.auth import system_session from samba.samdb import SamDB -from samba.dcerpc import samr, security, lsa +from samba.dcerpc import samr, security from samba.credentials import Credentials from samba.ndr import ndr_unpack, ndr_pack from samba.tests import delete_force, DynamicTestCase from samba import gensec, sd_utils from samba.credentials import DONT_USE_KERBEROS from ldb import SCOPE_SUBTREE, SCOPE_BASE, LdbError -from ldb import Message, MessageElement, Dn -from ldb import FLAG_MOD_ADD, FLAG_MOD_REPLACE, FLAG_MOD_DELETE from samba.dsdb import UF_SCRIPT, UF_ACCOUNTDISABLE, UF_00000004, UF_HOMEDIR_REQUIRED, \ UF_LOCKOUT, UF_PASSWD_NOTREQD, UF_PASSWD_CANT_CHANGE, UF_ENCRYPTED_TEXT_PASSWORD_ALLOWED,\ UF_TEMP_DUPLICATE_ACCOUNT, UF_NORMAL_ACCOUNT, UF_00000400, UF_INTERDOMAIN_TRUST_ACCOUNT, \