From: Rob van der Linde Date: Tue, 28 Nov 2023 03:38:22 +0000 (+1300) Subject: python: tests: update all super calls to python 3 style in tests X-Git-Tag: talloc-2.4.2~438 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=6ac48336780813cd5cb0cd9e5b5f1355aa342096;p=thirdparty%2Fsamba.git python: tests: update all super calls to python 3 style in tests Signed-off-by: Rob van der Linde Reviewed-by: Douglas Bagnall Reviewed-by: Andrew Bartlett [abartlet@samba.org Some python2 style super() calls remain due to being an actual, even if reasonable, behaviour change] --- diff --git a/python/samba/tests/__init__.py b/python/samba/tests/__init__.py index 9981e1390a2..c55525b2902 100644 --- a/python/samba/tests/__init__.py +++ b/python/samba/tests/__init__.py @@ -185,7 +185,7 @@ class TestCase(unittest.TestCase): return "".join([name[0].lower(), name[1:]]) def setUp(self): - super(TestCase, self).setUp() + super().setUp() test_debug_level = os.getenv("TEST_DEBUG_LEVEL") if test_debug_level is not None: test_debug_level = int(test_debug_level) @@ -326,7 +326,7 @@ class LdbTestCase(TestCase): """Trivial test case for running tests against a LDB.""" def setUp(self): - super(LdbTestCase, self).setUp() + super().setUp() self.tempfile = tempfile.NamedTemporaryFile(delete=False) self.filename = self.tempfile.name self.ldb = samba.Ldb(self.filename) @@ -345,7 +345,7 @@ class LdbTestCase(TestCase): class TestCaseInTempDir(TestCase): def setUp(self): - super(TestCaseInTempDir, self).setUp() + super().setUp() self.tempdir = tempfile.mkdtemp() self.addCleanup(self._remove_tempdir) diff --git a/python/samba/tests/audit_log_base.py b/python/samba/tests/audit_log_base.py index 73d0d8e306c..fa5ecc7cace 100644 --- a/python/samba/tests/audit_log_base.py +++ b/python/samba/tests/audit_log_base.py @@ -39,7 +39,7 @@ def getAudit(message): class AuditLogTestBase(samba.tests.TestCase): def setUp(self): - super(AuditLogTestBase, self).setUp() + super().setUp() # connect to the server's messaging bus (we need to explicitly load a # different smb.conf here, because in all other respects this test diff --git a/python/samba/tests/audit_log_dsdb.py b/python/samba/tests/audit_log_dsdb.py index 09850961731..af623376cd1 100644 --- a/python/samba/tests/audit_log_dsdb.py +++ b/python/samba/tests/audit_log_dsdb.py @@ -40,7 +40,7 @@ class AuditLogDsdbTests(AuditLogTestBase): def setUp(self): self.message_type = MSG_DSDB_LOG self.event_type = DSDB_EVENT_NAME - super(AuditLogDsdbTests, self).setUp() + super().setUp() self.server_ip = os.environ["SERVER_IP"] @@ -92,7 +92,7 @@ class AuditLogDsdbTests(AuditLogTestBase): def tearDown(self): self.discardMessages() - super(AuditLogDsdbTests, self).tearDown() + super().tearDown() def haveExpectedTxn(self, expected): if self.context["txnMessage"] is not None: diff --git a/python/samba/tests/audit_log_pass_change.py b/python/samba/tests/audit_log_pass_change.py index 25fe2b5664a..1039e17a180 100644 --- a/python/samba/tests/audit_log_pass_change.py +++ b/python/samba/tests/audit_log_pass_change.py @@ -45,7 +45,7 @@ class AuditLogPassChangeTests(AuditLogTestBase): def setUp(self): self.message_type = MSG_DSDB_PWD_LOG self.event_type = DSDB_PWD_EVENT_NAME - super(AuditLogPassChangeTests, self).setUp() + super().setUp() self.server_ip = os.environ["SERVER_IP"] diff --git a/python/samba/tests/auth.py b/python/samba/tests/auth.py index 099826e0c62..3fedd5ec37f 100644 --- a/python/samba/tests/auth.py +++ b/python/samba/tests/auth.py @@ -28,7 +28,7 @@ import samba.tests class AuthSystemSessionTests(samba.tests.TestCase): def setUp(self): - super(AuthSystemSessionTests, self).setUp() + super().setUp() self.system_session = auth.system_session() self.lp = samba.tests.env_loadparm() @@ -62,7 +62,7 @@ class AuthSystemSessionTests(samba.tests.TestCase): class AuthAdminSessionTests(samba.tests.TestCase): def setUp(self): - super(AuthAdminSessionTests, self).setUp() + super().setUp() self.lp = samba.tests.env_loadparm() self.admin_session = auth.admin_session(self.lp, "S-1-5-21-2212615479-2695158682-2101375467") diff --git a/python/samba/tests/auth_log.py b/python/samba/tests/auth_log.py index 41e7767b75c..0307ed0d86d 100755 --- a/python/samba/tests/auth_log.py +++ b/python/samba/tests/auth_log.py @@ -47,7 +47,7 @@ import re class AuthLogTests(samba.tests.auth_log_base.AuthLogTestBase): def setUp(self): - super(AuthLogTests, self).setUp() + super().setUp() self.remoteAddress = os.environ["CLIENT_IP"] def smb_connection(self, creds, use_spnego="yes", ntlmv2_auth="yes", diff --git a/python/samba/tests/auth_log_base.py b/python/samba/tests/auth_log_base.py index 36304ecf796..131f019de43 100644 --- a/python/samba/tests/auth_log_base.py +++ b/python/samba/tests/auth_log_base.py @@ -100,7 +100,7 @@ class AuthLogTestBase(samba.tests.TestCase): super().tearDownClass() def setUp(self): - super(AuthLogTestBase, self).setUp() + super().setUp() type(self).discardMessages() def isRemote(self, message): diff --git a/python/samba/tests/auth_log_ncalrpc.py b/python/samba/tests/auth_log_ncalrpc.py index 0941a64571b..c671556afe2 100644 --- a/python/samba/tests/auth_log_ncalrpc.py +++ b/python/samba/tests/auth_log_ncalrpc.py @@ -32,7 +32,7 @@ from samba.dcerpc.windows_event_ids import ( class AuthLogTestsNcalrpc(samba.tests.auth_log_base.AuthLogTestBase): def setUp(self): - super(AuthLogTestsNcalrpc, self).setUp() + super().setUp() self.remoteAddress = AS_SYSTEM_MAGIC_PATH_TOKEN def _test_rpc_ncaclrpc(self, authTypes, binding, creds, diff --git a/python/samba/tests/auth_log_netlogon.py b/python/samba/tests/auth_log_netlogon.py index eabc4239a42..ac7e284b4fc 100644 --- a/python/samba/tests/auth_log_netlogon.py +++ b/python/samba/tests/auth_log_netlogon.py @@ -44,7 +44,7 @@ from samba.dcerpc.windows_event_ids import ( class AuthLogTestsNetLogon(samba.tests.auth_log_base.AuthLogTestBase): def setUp(self): - super(AuthLogTestsNetLogon, self).setUp() + super().setUp() self.lp = samba.tests.env_loadparm() self.session = system_session() self.ldb = SamDB( @@ -68,7 +68,7 @@ class AuthLogTestsNetLogon(samba.tests.auth_log_base.AuthLogTestBase): "unicodePwd": utf16pw}) def tearDown(self): - super(AuthLogTestsNetLogon, self).tearDown() + super().tearDown() delete_force(self.ldb, self.dn) def _test_netlogon(self, binding, checkFunction): diff --git a/python/samba/tests/auth_log_netlogon_bad_creds.py b/python/samba/tests/auth_log_netlogon_bad_creds.py index a74ea5c706d..e97ca851d11 100644 --- a/python/samba/tests/auth_log_netlogon_bad_creds.py +++ b/python/samba/tests/auth_log_netlogon_bad_creds.py @@ -47,7 +47,7 @@ from samba.dcerpc.windows_event_ids import ( class AuthLogTestsNetLogonBadCreds(samba.tests.auth_log_base.AuthLogTestBase): def setUp(self): - super(AuthLogTestsNetLogonBadCreds, self).setUp() + super().setUp() self.lp = samba.tests.env_loadparm() self.session = system_session() self.ldb = SamDB( @@ -71,7 +71,7 @@ class AuthLogTestsNetLogonBadCreds(samba.tests.auth_log_base.AuthLogTestBase): "unicodePwd": utf16pw}) def tearDown(self): - super(AuthLogTestsNetLogonBadCreds, self).tearDown() + super().tearDown() delete_force(self.ldb, self.dn) def _test_netlogon(self, name, pwd, status, checkFunction, event_id): diff --git a/python/samba/tests/auth_log_pass_change.py b/python/samba/tests/auth_log_pass_change.py index a9dc2b328d4..29a9e38db1d 100644 --- a/python/samba/tests/auth_log_pass_change.py +++ b/python/samba/tests/auth_log_pass_change.py @@ -41,7 +41,7 @@ USER_PASS = samba.generate_random_password(32, 32) class AuthLogPassChangeTests(samba.tests.auth_log_base.AuthLogTestBase): def setUp(self): - super(AuthLogPassChangeTests, self).setUp() + super().setUp() self.server_ip = os.environ["SERVER_IP"] diff --git a/python/samba/tests/auth_log_samlogon.py b/python/samba/tests/auth_log_samlogon.py index 8e86c646a00..f3dfebab0cc 100644 --- a/python/samba/tests/auth_log_samlogon.py +++ b/python/samba/tests/auth_log_samlogon.py @@ -44,7 +44,7 @@ from samba.dcerpc.windows_event_ids import ( class AuthLogTestsSamLogon(samba.tests.auth_log_base.AuthLogTestBase): def setUp(self): - super(AuthLogTestsSamLogon, self).setUp() + super().setUp() self.lp = samba.tests.env_loadparm() self.session = system_session() self.ldb = SamDB( @@ -60,7 +60,7 @@ class AuthLogTestsSamLogon(samba.tests.auth_log_base.AuthLogTestBase): (self.netbios_name, self.base_dn)) def tearDown(self): - super(AuthLogTestsSamLogon, self).tearDown() + super().tearDown() delete_force(self.ldb, self.samlogon_dn) def _test_samlogon(self, binding, creds, checkFunction): diff --git a/python/samba/tests/auth_log_winbind.py b/python/samba/tests/auth_log_winbind.py index 555d5348303..1445eff6984 100644 --- a/python/samba/tests/auth_log_winbind.py +++ b/python/samba/tests/auth_log_winbind.py @@ -120,7 +120,7 @@ class AuthLogTestsWinbind(AuthLogTestBase, BlackboxTestCase): return list(filter(keep, messages)) def setUp(self): - super(AuthLogTestsWinbind, self).setUp() + super().setUp() self.domain = os.environ["DOMAIN"] self.host = os.environ["SERVER"] self.dc = os.environ["DC_SERVER"] @@ -138,7 +138,7 @@ class AuthLogTestsWinbind(AuthLogTestBase, BlackboxTestCase): self.remoteAddress = '' def tearDown(self): - super(AuthLogTestsWinbind, self).tearDown() + super().tearDown() delete_force(self.ldb, self.user_dn) # diff --git a/python/samba/tests/blackbox/bug13653.py b/python/samba/tests/blackbox/bug13653.py index 79b0af85ca1..215b9fcc378 100644 --- a/python/samba/tests/blackbox/bug13653.py +++ b/python/samba/tests/blackbox/bug13653.py @@ -128,7 +128,7 @@ class Bug13653Tests(BlackboxTestCase): # Open a local connection to the SamDB # and load configuration from the OS environment. def setUp(self): - super(Bug13653Tests, self).setUp() + super().setUp() self.env = os.environ["TEST_ENV"] self.server = os.environ["SERVER"] self.prefix = os.environ["PREFIX_ABS"] @@ -143,7 +143,7 @@ class Bug13653Tests(BlackboxTestCase): # Delete the user account created by the test case. # The user name is in self.user def tearDown(self): - super(Bug13653Tests, self).tearDown() + super().tearDown() try: dn = "CN=%s,CN=Users,%s" % (self.user, self.ldb.domain_dn()) delete_force(self.ldb, dn) diff --git a/python/samba/tests/blackbox/downgradedatabase.py b/python/samba/tests/blackbox/downgradedatabase.py index e4d772be83e..d850d1b5527 100644 --- a/python/samba/tests/blackbox/downgradedatabase.py +++ b/python/samba/tests/blackbox/downgradedatabase.py @@ -29,7 +29,7 @@ class DowngradeTestBase(BlackboxTestCase): """Test that sambadowngradedatabase downgrades the samba database""" def setUp(self): - super(DowngradeTestBase, self).setUp() + super().setUp() if not hasattr(self, "backend"): self.fail("Subclass this class and set 'backend'") @@ -62,7 +62,7 @@ class DowngradeTestBase(BlackboxTestCase): "bind-dns", "msg.lock") self.rm_files("names.tdb", "gencache.tdb") - super(DowngradeTestBase, self).tearDown() + super().tearDown() # Parse out the comments above each record that ldbdump produces # containing pack format version and KV level key for each record. diff --git a/python/samba/tests/blackbox/mdsearch.py b/python/samba/tests/blackbox/mdsearch.py index 46af6f94624..1f72c4e3948 100644 --- a/python/samba/tests/blackbox/mdsearch.py +++ b/python/samba/tests/blackbox/mdsearch.py @@ -65,7 +65,7 @@ class MdssvcHTTPRequestHandler(BaseHTTPRequestHandler): class MdfindBlackboxTests(BlackboxTestCase): def setUp(self): - super(MdfindBlackboxTests, self).setUp() + super().setUp() self.server = HTTPServer(('10.53.57.35', 8080), MdssvcHTTPRequestHandler, diff --git a/python/samba/tests/blackbox/netads_dns.py b/python/samba/tests/blackbox/netads_dns.py index e9f945eaef9..3466344ef4a 100644 --- a/python/samba/tests/blackbox/netads_dns.py +++ b/python/samba/tests/blackbox/netads_dns.py @@ -28,7 +28,7 @@ COMMAND = "bin/net ads" class NetAdsDnsTests(BlackboxTestCase): def setUp(self): - super(NetAdsDnsTests, self).setUp() + super().setUp() nameserver = os.environ["DC_SERVER_IP"] # filename=None will disable reading /etc/resolv.conf. The file might # not exist e.g. on build or CI systems. diff --git a/python/samba/tests/blackbox/samba_dnsupdate.py b/python/samba/tests/blackbox/samba_dnsupdate.py index 8fcdd207f73..e326fbb592b 100644 --- a/python/samba/tests/blackbox/samba_dnsupdate.py +++ b/python/samba/tests/blackbox/samba_dnsupdate.py @@ -32,7 +32,7 @@ class SambaDnsUpdateTests(samba.tests.BlackboxTestCase): def setUp(self): self.server_ip = samba.tests.env_get_var_value("DNS_SERVER_IP") - super(SambaDnsUpdateTests, self).setUp() + super().setUp() try: out = self.check_output("samba_dnsupdate --verbose") self.assertTrue(b"Looking for DNS entry" in out, out) diff --git a/python/samba/tests/blackbox/smbcacls.py b/python/samba/tests/blackbox/smbcacls.py index 219ddc243cf..dd84f52a9bb 100644 --- a/python/samba/tests/blackbox/smbcacls.py +++ b/python/samba/tests/blackbox/smbcacls.py @@ -25,7 +25,7 @@ import os class SmbCaclsBlockboxTestBase(BlackboxTestCase): def setUp(self): - super(SmbCaclsBlockboxTestBase, self).setUp() + super().setUp() self.lp = s3param.get_context() self.server = os.environ["SERVER"] self.user = os.environ["USER"] diff --git a/python/samba/tests/blackbox/smbcacls_propagate_inhertance.py b/python/samba/tests/blackbox/smbcacls_propagate_inhertance.py index 87f4c4f43f5..cc13727b8fb 100644 --- a/python/samba/tests/blackbox/smbcacls_propagate_inhertance.py +++ b/python/samba/tests/blackbox/smbcacls_propagate_inhertance.py @@ -22,7 +22,7 @@ import os class InheritanceSmbCaclsTests(SmbCaclsBlockboxTestBase): def setUp(self): - super(InheritanceSmbCaclsTests, self).setUp() + super().setUp() # create toplevel testdir structure with desired ACL(s) # @@ -62,7 +62,7 @@ class InheritanceSmbCaclsTests(SmbCaclsBlockboxTestBase): if self.share != "tmp": self.dirpath = os.path.join(os.environ["LOCAL_PATH"],self.share) self.dirpath = os.path.join(self.dirpath,self.testdir) - super(InheritanceSmbCaclsTests, self).tearDown() + super().tearDown() def test_simple_oi_add(self): """test smbcacls '--propagate-inheritance --add' which attempts to add the ACL diff --git a/python/samba/tests/blackbox/smbcacls_save_restore.py b/python/samba/tests/blackbox/smbcacls_save_restore.py index 896e337b711..b3995310f7c 100644 --- a/python/samba/tests/blackbox/smbcacls_save_restore.py +++ b/python/samba/tests/blackbox/smbcacls_save_restore.py @@ -22,7 +22,7 @@ import os class SaveRestoreSmbCaclsTests(SmbCaclsBlockboxTestBase): def setUp(self): - super(SaveRestoreSmbCaclsTests, self).setUp() + super().setUp() # create toplevel testdir structure with desired ACL(s) # @@ -62,7 +62,7 @@ class SaveRestoreSmbCaclsTests(SmbCaclsBlockboxTestBase): if self.share != "tmp": self.dirpath = os.path.join(os.environ["LOCAL_PATH"],self.share) self.dirpath = os.path.join(self.dirpath,self.testdir) - super(SaveRestoreSmbCaclsTests, self).tearDown() + super().tearDown() def test_simple_save_dir(self): try: diff --git a/python/samba/tests/blackbox/smbcontrol.py b/python/samba/tests/blackbox/smbcontrol.py index cfd9d4d77e2..95e21230dd9 100644 --- a/python/samba/tests/blackbox/smbcontrol.py +++ b/python/samba/tests/blackbox/smbcontrol.py @@ -26,7 +26,7 @@ USAGE = "pool-usage" class SmbcontrolBlackboxTests(BlackboxTestCase): def setUp(self): - super(SmbcontrolBlackboxTests, self).setUp() + super().setUp() lp_ctx = self.get_loadparm() self.msg_ctx = Messaging(lp_ctx=lp_ctx) diff --git a/python/samba/tests/blackbox/smbcontrol_process.py b/python/samba/tests/blackbox/smbcontrol_process.py index bff2e06adba..1ff7720b079 100644 --- a/python/samba/tests/blackbox/smbcontrol_process.py +++ b/python/samba/tests/blackbox/smbcontrol_process.py @@ -30,7 +30,7 @@ PING = "ping" class SmbcontrolProcessBlockboxTests(BlackboxTestCase): def setUp(self): - super(SmbcontrolProcessBlockboxTests, self).setUp() + super().setUp() lp_ctx = self.get_loadparm() self.msg_ctx = Messaging(lp_ctx=lp_ctx) diff --git a/python/samba/tests/complex_expressions.py b/python/samba/tests/complex_expressions.py index d2927194902..4cb6330c895 100644 --- a/python/samba/tests/complex_expressions.py +++ b/python/samba/tests/complex_expressions.py @@ -60,7 +60,7 @@ class ComplexExpressionTests(TestCase): # records in the tests @classmethod def setUpClass(cls): - super(ComplexExpressionTests, cls).setUpClass() + super().setUpClass() cls.samdb = samba.samdb.SamDB(host, lp=lp, session_info=system_session(), credentials=creds) diff --git a/python/samba/tests/cred_opt.py b/python/samba/tests/cred_opt.py index 02019b5022a..5bc7a831da7 100644 --- a/python/samba/tests/cred_opt.py +++ b/python/samba/tests/cred_opt.py @@ -73,7 +73,7 @@ class CredentialsOptionsTests(samba.tests.TestCase): class AuthenticationFileTests(samba.tests.TestCaseInTempDir): def setUp(self): - super(AuthenticationFileTests, self).setUp() + super().setUp() self.parser = optparse.OptionParser() self.credopts = CredentialsOptions(self.parser) @@ -94,7 +94,7 @@ class AuthenticationFileTests(samba.tests.TestCaseInTempDir): auth_file_fd.close() def tearDown(self): - super(AuthenticationFileTests, self).tearDown() + super().tearDown() os.unlink(self.auth_file_name) diff --git a/python/samba/tests/credentials.py b/python/samba/tests/credentials.py index bcd15b1130f..f9781f8ba03 100644 --- a/python/samba/tests/credentials.py +++ b/python/samba/tests/credentials.py @@ -31,7 +31,7 @@ from samba.dcerpc import misc class CredentialsTests(samba.tests.TestCaseInTempDir): def setUp(self): - super(CredentialsTests, self).setUp() + super().setUp() self.creds = credentials.Credentials() def test_set_username(self): diff --git a/python/samba/tests/dcerpc/array.py b/python/samba/tests/dcerpc/array.py index 6f31546c4db..073d2c26fa8 100644 --- a/python/samba/tests/dcerpc/array.py +++ b/python/samba/tests/dcerpc/array.py @@ -27,12 +27,12 @@ import gc class ArrayTests(samba.tests.TestCase): def setUp(self): - super(ArrayTests, self).setUp() + super().setUp() talloc.enable_null_tracking() self.startup_blocks = talloc.total_blocks() def tearDown(self): - super(ArrayTests, self).tearDown() + super().tearDown() gc.collect() if talloc.total_blocks() != self.startup_blocks: talloc.report_full() diff --git a/python/samba/tests/dcerpc/dnsserver.py b/python/samba/tests/dcerpc/dnsserver.py index 6e7c6389bec..13c9af81820 100644 --- a/python/samba/tests/dcerpc/dnsserver.py +++ b/python/samba/tests/dcerpc/dnsserver.py @@ -116,7 +116,7 @@ class DnsserverTests(RpcInterfaceTestCase): } def setUp(self): - super(DnsserverTests, self).setUp() + super().setUp() self.server = os.environ["DC_SERVER"] self.zone = env_get_var_value("REALM").lower() self.conn = dnsserver.dnsserver("ncacn_ip_tcp:%s[sign]" % (self.server), @@ -155,7 +155,7 @@ class DnsserverTests(RpcInterfaceTestCase): 'DeleteZoneFromDs', dnsserver.DNSSRV_TYPEID_NULL, None) - super(DnsserverTests, self).tearDown() + super().tearDown() def test_enum_is_sorted(self): """ diff --git a/python/samba/tests/dcerpc/mdssvc.py b/python/samba/tests/dcerpc/mdssvc.py index 7d09a555936..31c3ba9ae52 100644 --- a/python/samba/tests/dcerpc/mdssvc.py +++ b/python/samba/tests/dcerpc/mdssvc.py @@ -73,7 +73,7 @@ class MdssvcHTTPRequestHandler(BaseHTTPRequestHandler): class MdssvcTests(RpcInterfaceTestCase): def setUp(self): - super(MdssvcTests, self).setUp() + super().setUp() self.pipe = mdssvc.mdssvc('ncacn_np:fileserver[/pipe/mdssvc]', self.get_loadparm()) diff --git a/python/samba/tests/dcerpc/raw_protocol.py b/python/samba/tests/dcerpc/raw_protocol.py index 3c9d0b136a5..fa5a042b851 100755 --- a/python/samba/tests/dcerpc/raw_protocol.py +++ b/python/samba/tests/dcerpc/raw_protocol.py @@ -44,7 +44,7 @@ global_hexdump = False class TestDCERPC_BIND(RawDCERPCTest): def setUp(self): - super(TestDCERPC_BIND, self).setUp() + super().setUp() self.do_ndr_print = global_ndr_print self.do_hexdump = global_hexdump diff --git a/python/samba/tests/dcerpc/raw_testcase.py b/python/samba/tests/dcerpc/raw_testcase.py index 61aa044fd5b..81ca9b1c6ce 100644 --- a/python/samba/tests/dcerpc/raw_testcase.py +++ b/python/samba/tests/dcerpc/raw_testcase.py @@ -146,7 +146,7 @@ class RawDCERPCTest(TestCase): return def setUp(self): - super(RawDCERPCTest, self).setUp() + super().setUp() self.do_ndr_print = False self.do_hexdump = False diff --git a/python/samba/tests/dcerpc/registry.py b/python/samba/tests/dcerpc/registry.py index 04838ff6f1b..be9e4842622 100644 --- a/python/samba/tests/dcerpc/registry.py +++ b/python/samba/tests/dcerpc/registry.py @@ -24,7 +24,7 @@ from samba.tests import RpcInterfaceTestCase class WinregTests(RpcInterfaceTestCase): def setUp(self): - super(WinregTests, self).setUp() + super().setUp() self.conn = winreg.winreg("ncalrpc:", self.get_loadparm(), self.get_credentials()) diff --git a/python/samba/tests/dcerpc/rpcecho.py b/python/samba/tests/dcerpc/rpcecho.py index 0ae86c56350..949e4e230b6 100644 --- a/python/samba/tests/dcerpc/rpcecho.py +++ b/python/samba/tests/dcerpc/rpcecho.py @@ -25,7 +25,7 @@ from samba.tests import RpcInterfaceTestCase, TestCase class RpcEchoTests(RpcInterfaceTestCase): def setUp(self): - super(RpcEchoTests, self).setUp() + super().setUp() self.conn = echo.rpcecho("ncalrpc:", self.get_loadparm()) def test_two_contexts(self): diff --git a/python/samba/tests/dcerpc/sam.py b/python/samba/tests/dcerpc/sam.py index 32b9faec881..9029cce127b 100644 --- a/python/samba/tests/dcerpc/sam.py +++ b/python/samba/tests/dcerpc/sam.py @@ -63,7 +63,7 @@ def calc_max_size(num_entries): class SamrTests(RpcInterfaceTestCase): def setUp(self): - super(SamrTests, self).setUp() + super().setUp() self.conn = samr.samr("ncalrpc:", self.get_loadparm()) self.open_samdb() self.open_domain_handle() diff --git a/python/samba/tests/dcerpc/samr_change_password.py b/python/samba/tests/dcerpc/samr_change_password.py index 89cf8ca403e..f872bba128c 100644 --- a/python/samba/tests/dcerpc/samr_change_password.py +++ b/python/samba/tests/dcerpc/samr_change_password.py @@ -32,7 +32,7 @@ from samba.tests import RpcInterfaceTestCase class SamrPasswordTests(RpcInterfaceTestCase): def setUp(self): - super(SamrPasswordTests, self).setUp() + super().setUp() self.open_samdb() self.create_user_account(10000) @@ -49,7 +49,7 @@ class SamrPasswordTests(RpcInterfaceTestCase): self.remote_creds.set_password(self.remote_password) def tearDown(self): - super(SamrPasswordTests, self).tearDown() + super().tearDown() samr.Close(self.user_handle) samr.Close(self.domain_handle) diff --git a/python/samba/tests/dcerpc/srvsvc.py b/python/samba/tests/dcerpc/srvsvc.py index ddd9661f343..4baaec346ef 100644 --- a/python/samba/tests/dcerpc/srvsvc.py +++ b/python/samba/tests/dcerpc/srvsvc.py @@ -27,7 +27,7 @@ from samba.tests import RpcInterfaceTestCase class SrvsvcTests(RpcInterfaceTestCase): def setUp(self): - super(SrvsvcTests, self).setUp() + super().setUp() self.conn = srvsvc.srvsvc("ncalrpc:", self.get_loadparm()) self.server_unc = "\\\\." diff --git a/python/samba/tests/dcerpc/string_tests.py b/python/samba/tests/dcerpc/string_tests.py index 4dbbd3eed5c..a3426bb61a8 100644 --- a/python/samba/tests/dcerpc/string_tests.py +++ b/python/samba/tests/dcerpc/string_tests.py @@ -32,12 +32,12 @@ class TestException(Exception): class StringTests(samba.tests.TestCase): def setUp(self): - super(StringTests, self).setUp() + super().setUp() talloc.enable_null_tracking() self.startup_blocks = talloc.total_blocks() def tearDown(self): - super(StringTests, self).tearDown() + super().tearDown() gc.collect() if talloc.total_blocks() != self.startup_blocks: talloc.report_full() diff --git a/python/samba/tests/dcerpc/unix.py b/python/samba/tests/dcerpc/unix.py index d26107393f2..b7fa1f3c4fb 100644 --- a/python/samba/tests/dcerpc/unix.py +++ b/python/samba/tests/dcerpc/unix.py @@ -24,7 +24,7 @@ from samba.tests import RpcInterfaceTestCase class UnixinfoTests(RpcInterfaceTestCase): def setUp(self): - super(UnixinfoTests, self).setUp() + super().setUp() self.conn = unixinfo.unixinfo("ncalrpc:", self.get_loadparm()) def test_getpwuid_int(self): diff --git a/python/samba/tests/dckeytab.py b/python/samba/tests/dckeytab.py index 5d975f53500..28ab18614d3 100644 --- a/python/samba/tests/dckeytab.py +++ b/python/samba/tests/dckeytab.py @@ -38,7 +38,7 @@ def open_bytes(filename): class DCKeytabTests(tests.TestCase): def setUp(self): - super(DCKeytabTests, self).setUp() + super().setUp() self.lp = LoadParm() self.lp.load_default() self.creds = self.insta_creds(template=self.get_credentials()) @@ -46,7 +46,7 @@ class DCKeytabTests(tests.TestCase): self.principal = self.creds.get_principal() def tearDown(self): - super(DCKeytabTests, self).tearDown() + super().tearDown() os.remove(self.ktfile) def test_export_keytab(self): diff --git a/python/samba/tests/dns.py b/python/samba/tests/dns.py index 8888790378d..a331e26209d 100644 --- a/python/samba/tests/dns.py +++ b/python/samba/tests/dns.py @@ -70,7 +70,7 @@ creds.set_krb_forwardable(credentials.NO_KRB_FORWARDABLE) class TestSimpleQueries(DNSTest): def setUp(self): - super(TestSimpleQueries, self).setUp() + super().setUp() global server, server_ip, lp, creds, timeout self.server = server_name self.server_ip = server_ip @@ -302,7 +302,7 @@ class TestSimpleQueries(DNSTest): class TestDNSUpdates(DNSTest): def setUp(self): - super(TestDNSUpdates, self).setUp() + super().setUp() global server, server_ip, lp, creds, timeout self.server = server_name self.server_ip = server_ip @@ -718,7 +718,7 @@ class TestComplexQueries(DNSTest): self.assert_dns_rcode_equals(response, dns.DNS_RCODE_OK) def setUp(self): - super(TestComplexQueries, self).setUp() + super().setUp() global server, server_ip, lp, creds, timeout self.server = server_name @@ -990,7 +990,7 @@ class TestComplexQueries(DNSTest): class TestInvalidQueries(DNSTest): def setUp(self): - super(TestInvalidQueries, self).setUp() + super().setUp() global server, server_ip, lp, creds, timeout self.server = server_name self.server_ip = server_ip @@ -1067,7 +1067,7 @@ class TestInvalidQueries(DNSTest): class TestZones(DNSTest): def setUp(self): - super(TestZones, self).setUp() + super().setUp() global server, server_ip, lp, creds, timeout self.server = server_name self.server_ip = server_ip @@ -1089,7 +1089,7 @@ class TestZones(DNSTest): str(self.samdb.get_default_basedn()) def tearDown(self): - super(TestZones, self).tearDown() + super().tearDown() try: self.delete_zone(self.zone) @@ -1761,7 +1761,7 @@ class TestZones(DNSTest): class TestRPCRoundtrip(DNSTest): def setUp(self): - super(TestRPCRoundtrip, self).setUp() + super().setUp() global server, server_ip, lp, creds self.server = server_name self.server_ip = server_ip diff --git a/python/samba/tests/dns_base.py b/python/samba/tests/dns_base.py index ab00e631772..d320a0e9183 100644 --- a/python/samba/tests/dns_base.py +++ b/python/samba/tests/dns_base.py @@ -31,7 +31,7 @@ import time class DNSTest(TestCaseInTempDir): def setUp(self): - super(DNSTest, self).setUp() + super().setUp() self.timeout = None def errstr(self, errcode): @@ -207,7 +207,7 @@ class DNSTest(TestCaseInTempDir): class DNSTKeyTest(DNSTest): def setUp(self): - super(DNSTKeyTest, self).setUp() + super().setUp() self.settings = {} self.settings["lp_ctx"] = self.lp_ctx = tests.env_loadparm() self.settings["target_hostname"] = self.server diff --git a/python/samba/tests/dns_forwarder.py b/python/samba/tests/dns_forwarder.py index cd27790c0af..86b553e53e4 100644 --- a/python/samba/tests/dns_forwarder.py +++ b/python/samba/tests/dns_forwarder.py @@ -157,11 +157,11 @@ def contact_real_server(host, port): class TestDnsForwarding(DNSTest): def __init__(self, *args, **kwargs): - super(TestDnsForwarding, self).__init__(*args, **kwargs) + super().__init__(*args, **kwargs) self.subprocesses = [] def setUp(self): - super(TestDnsForwarding, self).setUp() + super().setUp() self.server = server_name self.server_ip = server_ip self.lp = lp @@ -194,7 +194,7 @@ class TestDnsForwarding(DNSTest): return s def tearDown(self): - super(TestDnsForwarding, self).tearDown() + super().tearDown() for p in self.subprocesses: p.kill() diff --git a/python/samba/tests/dns_forwarder_helpers/server.py b/python/samba/tests/dns_forwarder_helpers/server.py index c4c82dc5121..d947d2c115e 100644 --- a/python/samba/tests/dns_forwarder_helpers/server.py +++ b/python/samba/tests/dns_forwarder_helpers/server.py @@ -92,7 +92,7 @@ class TestUDPServer(SocketServer.UDPServer): self.address_family = socket.AF_INET6 else: self.address_family = socket.AF_INET - super(SocketServer.UDPServer, self).__init__(server_address, RequestHandlerClass) + super().__init__(server_address, RequestHandlerClass) def main(): global SERVER_ID diff --git a/python/samba/tests/dns_invalid.py b/python/samba/tests/dns_invalid.py index 0234798091d..7415cef969b 100644 --- a/python/samba/tests/dns_invalid.py +++ b/python/samba/tests/dns_invalid.py @@ -55,7 +55,7 @@ creds.set_krb_forwardable(credentials.NO_KRB_FORWARDABLE) class TestBrokenQueries(DNSTest): def setUp(self): - super(TestBrokenQueries, self).setUp() + super().setUp() global server, server_ip, lp, creds, timeout self.server_ip = server_ip self.lp = lp diff --git a/python/samba/tests/dns_tkey.py b/python/samba/tests/dns_tkey.py index 42f73ba2921..69af14d6f10 100644 --- a/python/samba/tests/dns_tkey.py +++ b/python/samba/tests/dns_tkey.py @@ -53,7 +53,7 @@ class TestDNSUpdates(DNSTKeyTest): def setUp(self): self.server = server_name self.server_ip = server_ip - super(TestDNSUpdates, self).setUp() + super().setUp() def test_tkey(self): "test DNS TKEY handshake" diff --git a/python/samba/tests/dns_wildcard.py b/python/samba/tests/dns_wildcard.py index b8b544eb26e..d65a53729e3 100644 --- a/python/samba/tests/dns_wildcard.py +++ b/python/samba/tests/dns_wildcard.py @@ -76,7 +76,7 @@ LEVEL2_EXACT = "exact.level2.wildcardtest" class TestWildCardQueries(DNSTest): def setUp(self): - super(TestWildCardQueries, self).setUp() + super().setUp() global server, server_ip, lp, creds, timeout self.server = server_name self.server_ip = server_ip diff --git a/python/samba/tests/docs.py b/python/samba/tests/docs.py index f143f923d64..df20b04bc7e 100644 --- a/python/samba/tests/docs.py +++ b/python/samba/tests/docs.py @@ -220,7 +220,7 @@ class SmbDotConfTests(TestCase): ]) def setUp(self): - super(SmbDotConfTests, self).setUp() + super().setUp() # create a minimal smb.conf file for testparm self.smbconf = os.path.join(self.tempdir, "paramtestsmb.conf") f = open(self.smbconf, 'w') @@ -257,7 +257,7 @@ class SmbDotConfTests(TestCase): self.fail("Unable to load parameters") def tearDown(self): - super(SmbDotConfTests, self).tearDown() + super().tearDown() os.unlink(self.smbconf) os.unlink(self.blankconf) diff --git a/python/samba/tests/domain_backup.py b/python/samba/tests/domain_backup.py index 433905e5a57..12b99728161 100644 --- a/python/samba/tests/domain_backup.py +++ b/python/samba/tests/domain_backup.py @@ -48,7 +48,7 @@ def get_prim_dom(secrets_path, lp): class DomainBackupBase(BlackboxTestCase): def setUp(self): - super(DomainBackupBase, self).setUp() + super().setUp() server = os.environ["DC_SERVER"] self.user_auth = "-U%s%%%s" % (os.environ["DC_USERNAME"], @@ -432,7 +432,7 @@ class DomainBackupBase(BlackboxTestCase): class DomainBackupOnline(DomainBackupBase): def setUp(self): - super(DomainBackupOnline, self).setUp() + super().setUp() self.base_cmd = ["domain", "backup", "online", "--server=" + self.server, self.user_auth] @@ -461,7 +461,7 @@ class DomainBackupRename(DomainBackupBase): # run the above test cases using a rename backup def setUp(self): - super(DomainBackupRename, self).setUp() + super().setUp() self.new_server = "RENAMESERV" self.restore_domain = "NEWDOMAIN" self.restore_realm = "rename.test.net" @@ -563,7 +563,7 @@ class DomainBackupRename(DomainBackupBase): # extra checks we run on the restored DB in the rename case def check_restored_database(self, lp, expect_secrets=True): # run the common checks over the restored DB - common_test = super(DomainBackupRename, self) + common_test = super() samdb = common_test.check_restored_database(lp, expect_secrets) # check we have actually renamed the DNs @@ -608,7 +608,7 @@ class DomainBackupRename(DomainBackupBase): class DomainBackupOffline(DomainBackupBase): def setUp(self): - super(DomainBackupOffline, self).setUp() + super().setUp() self.base_cmd = ["domain", "backup", "offline"] def test_backup_untar(self): diff --git a/python/samba/tests/dsdb.py b/python/samba/tests/dsdb.py index 37c36d6ab02..4d5b620401d 100644 --- a/python/samba/tests/dsdb.py +++ b/python/samba/tests/dsdb.py @@ -1167,7 +1167,7 @@ class DsdbRemoteNCRootTests(DsdbNCRootTests): class DsdbFullScanTests(TestCase): def setUp(self): - super(DsdbFullScanTests, self).setUp() + super().setUp() self.lp = samba.tests.env_loadparm() self.creds = Credentials() self.creds.guess(self.lp) diff --git a/python/samba/tests/dsdb_schema_attributes.py b/python/samba/tests/dsdb_schema_attributes.py index 37b44c6d3ad..7d5c7f926e1 100644 --- a/python/samba/tests/dsdb_schema_attributes.py +++ b/python/samba/tests/dsdb_schema_attributes.py @@ -34,7 +34,7 @@ from ldb import SCOPE_BASE, LdbError class SchemaAttributesTestCase(samba.tests.TestCase): def setUp(self): - super(SchemaAttributesTestCase, self).setUp() + super().setUp() self.lp = samba.tests.env_loadparm() self.samdb = samba.tests.connect_samdb(self.lp.samdb_url()) diff --git a/python/samba/tests/emulate/traffic_packet.py b/python/samba/tests/emulate/traffic_packet.py index 6533c679ea4..73ecd245217 100644 --- a/python/samba/tests/emulate/traffic_packet.py +++ b/python/samba/tests/emulate/traffic_packet.py @@ -34,7 +34,7 @@ from samba import sd_utils class TrafficEmulatorPacketTests(samba.tests.TestCase): def setUp(self): - super(TrafficEmulatorPacketTests, self).setUp() + super().setUp() self.server = os.environ["SERVER"] self.domain = os.environ["DOMAIN"] self.host = os.environ["SERVER_IP"] @@ -89,7 +89,7 @@ class TrafficEmulatorPacketTests(samba.tests.TestCase): sdutils.dacl_add_ace(self.context.user_dn, mod) def tearDown(self): - super(TrafficEmulatorPacketTests, self).tearDown() + super().tearDown() traffic.clean_up_accounts(self.ldb, 1) del self.ldb shutil.rmtree(self.tempdir) diff --git a/python/samba/tests/encrypted_secrets.py b/python/samba/tests/encrypted_secrets.py index 96da7048a77..e251a3cd71b 100644 --- a/python/samba/tests/encrypted_secrets.py +++ b/python/samba/tests/encrypted_secrets.py @@ -37,7 +37,7 @@ from samba.dcerpc import drsblobs class EncryptedSecretsTests(TestCase): def setUp(self): - super(EncryptedSecretsTests, self).setUp() + super().setUp() self.lp = samba.tests.env_loadparm() self.creds = Credentials() self.session = system_session() diff --git a/python/samba/tests/gensec.py b/python/samba/tests/gensec.py index fbe5995e70b..8f9c88d170c 100644 --- a/python/samba/tests/gensec.py +++ b/python/samba/tests/gensec.py @@ -29,7 +29,7 @@ import samba.tests class GensecTests(samba.tests.TestCase): def setUp(self): - super(GensecTests, self).setUp() + super().setUp() self.settings = {} self.settings["lp_ctx"] = self.lp_ctx = samba.tests.env_loadparm() self.settings["target_hostname"] = self.lp_ctx.get("netbios name") diff --git a/python/samba/tests/gpo.py b/python/samba/tests/gpo.py index 86ffdf26a28..81bf3b8c03b 100644 --- a/python/samba/tests/gpo.py +++ b/python/samba/tests/gpo.py @@ -5091,7 +5091,7 @@ def unstage_file(path): class GPOTests(tests.TestCase): def setUp(self): - super(GPOTests, self).setUp() + super().setUp() self.server = os.environ["SERVER"] self.dc_account = self.server.upper() + '$' self.lp = s3param.get_context() diff --git a/python/samba/tests/gpo_member.py b/python/samba/tests/gpo_member.py index 047471f0e28..dda0c3bb438 100644 --- a/python/samba/tests/gpo_member.py +++ b/python/samba/tests/gpo_member.py @@ -22,7 +22,7 @@ from samba.gp.gp_sec_ext import gp_access_ext class GPOTests(tests.TestCase): def setUp(self): - super(GPOTests, self).setUp() + super().setUp() self.server = os.environ["SERVER"] self.dc_account = self.server.upper() + '$' self.lp = LoadParm() diff --git a/python/samba/tests/graph.py b/python/samba/tests/graph.py index be1bf58e3c0..4edd6824f9f 100644 --- a/python/samba/tests/graph.py +++ b/python/samba/tests/graph.py @@ -101,7 +101,7 @@ class DotFileTests(samba.tests.TestCaseInTempDir): class DistanceTests(samba.tests.TestCase): def setUp(self): - super(DistanceTests, self).setUp() + super().setUp() # a sorted list of colour set names. self.sorted_colour_sets = sorted( graph.COLOUR_SETS, diff --git a/python/samba/tests/group_audit.py b/python/samba/tests/group_audit.py index 12efef2c046..4c83ae81205 100644 --- a/python/samba/tests/group_audit.py +++ b/python/samba/tests/group_audit.py @@ -46,7 +46,7 @@ class GroupAuditTests(AuditLogTestBase): def setUp(self): self.message_type = MSG_GROUP_LOG self.event_type = DSDB_GROUP_EVENT_NAME - super(GroupAuditTests, self).setUp() + super().setUp() self.server_ip = os.environ["SERVER_IP"] @@ -91,7 +91,7 @@ class GroupAuditTests(AuditLogTestBase): self.ldb.newgroup(GROUP_NAME_02) def tearDown(self): - super(GroupAuditTests, self).tearDown() + super().tearDown() delete_force(self.ldb, "cn=" + USER_NAME + ",cn=users," + self.base_dn) self.ldb.deletegroup(GROUP_NAME_01) self.ldb.deletegroup(GROUP_NAME_02) diff --git a/python/samba/tests/join.py b/python/samba/tests/join.py index da34171da28..b47bc70e1fd 100644 --- a/python/samba/tests/join.py +++ b/python/samba/tests/join.py @@ -39,7 +39,7 @@ class JoinTestCase(DNSTKeyTest): def setUp(self): self.server = samba.tests.env_get_var_value("SERVER") self.server_ip = samba.tests.env_get_var_value("SERVER_IP") - super(JoinTestCase, self).setUp() + super().setUp() self.lp = samba.tests.env_loadparm() self.creds = self.get_credentials() self.netbios_name = "jointest1" @@ -79,7 +79,7 @@ class JoinTestCase(DNSTKeyTest): self.join_ctx.cleanup_old_join(force=True) - super(JoinTestCase, self).tearDown() + super().tearDown() def test_join_makes_records(self): "create a query packet containing one query record via TCP" diff --git a/python/samba/tests/kcc/__init__.py b/python/samba/tests/kcc/__init__.py index 3ca20845c58..31354f0f12b 100644 --- a/python/samba/tests/kcc/__init__.py +++ b/python/samba/tests/kcc/__init__.py @@ -51,7 +51,7 @@ ENV_DSAS = { class KCCTests(samba.tests.TestCase): def setUp(self): - super(KCCTests, self).setUp() + super().setUp() self.lp = LoadParm() self.creds = Credentials() self.creds.guess(self.lp) diff --git a/python/samba/tests/kcc/graph_utils.py b/python/samba/tests/kcc/graph_utils.py index 3cbcb1b9df3..3eaa1c706da 100644 --- a/python/samba/tests/kcc/graph_utils.py +++ b/python/samba/tests/kcc/graph_utils.py @@ -55,7 +55,7 @@ def make_tree(vertices): class UndirectedGraphTests(samba.tests.TestCase): def setUp(self): - super(UndirectedGraphTests, self).setUp() + super().setUp() vertices = tuple('abcdefgh') vertices2 = tuple('ijk') edges = tuple(itertools.combinations(vertices, 2)) diff --git a/python/samba/tests/kcc/ldif_import_export.py b/python/samba/tests/kcc/ldif_import_export.py index 5534de32f64..9e573bf942d 100644 --- a/python/samba/tests/kcc/ldif_import_export.py +++ b/python/samba/tests/kcc/ldif_import_export.py @@ -71,7 +71,7 @@ MULTISITE_LDIF_DSAS = ( class LdifImportExportTests(samba.tests.TestCaseInTempDir): def setUp(self): - super(LdifImportExportTests, self).setUp() + super().setUp() self.lp = LoadParm() self.creds = Credentials() self.creds.guess(self.lp) @@ -156,7 +156,7 @@ class LdifImportExportTests(samba.tests.TestCaseInTempDir): class KCCMultisiteLdifTests(samba.tests.TestCaseInTempDir): def setUp(self): - super(KCCMultisiteLdifTests, self).setUp() + super().setUp() self.lp = LoadParm() self.creds = Credentials() self.creds.guess(self.lp) diff --git a/python/samba/tests/krb5/as_req_tests.py b/python/samba/tests/krb5/as_req_tests.py index 12634012d8b..4d0940caa46 100755 --- a/python/samba/tests/krb5/as_req_tests.py +++ b/python/samba/tests/krb5/as_req_tests.py @@ -174,7 +174,7 @@ class AsReqKerberosTests(AsReqBaseTest): cls.generate_dynamic_test("test_as_req_no_preauth", tname, *targs) def setUp(self): - super(AsReqKerberosTests, self).setUp() + super().setUp() self.do_asn1_print = global_asn1_print self.do_hexdump = global_hexdump diff --git a/python/samba/tests/krb5/kdc_tests.py b/python/samba/tests/krb5/kdc_tests.py index bd1b0069917..b4be6f8e1d5 100755 --- a/python/samba/tests/krb5/kdc_tests.py +++ b/python/samba/tests/krb5/kdc_tests.py @@ -50,7 +50,7 @@ class KdcTests(RawKerberosTest): """ def setUp(self): - super(KdcTests, self).setUp() + super().setUp() self.do_asn1_print = global_asn1_print self.do_hexdump = global_hexdump diff --git a/python/samba/tests/krb5/raw_testcase.py b/python/samba/tests/krb5/raw_testcase.py index f77dd582949..409d86dce25 100644 --- a/python/samba/tests/krb5/raw_testcase.py +++ b/python/samba/tests/krb5/raw_testcase.py @@ -417,7 +417,7 @@ class KerberosCredentials(Credentials): security.KERB_ENCTYPE_AES256_CTS_HMAC_SHA1_96_SK) def __init__(self): - super(KerberosCredentials, self).__init__() + super().__init__() all_enc_types = 0 all_enc_types |= security.KERB_ENCTYPE_RC4_HMAC_MD5 all_enc_types |= security.KERB_ENCTYPE_AES128_CTS_HMAC_SHA1_96 diff --git a/python/samba/tests/krb5/s4u_tests.py b/python/samba/tests/krb5/s4u_tests.py index a0d20db9f6c..b91c41251d7 100755 --- a/python/samba/tests/krb5/s4u_tests.py +++ b/python/samba/tests/krb5/s4u_tests.py @@ -68,7 +68,7 @@ class S4UKerberosTests(KDCBaseTest): default_attrs = security.SE_GROUP_DEFAULT_FLAGS def setUp(self): - super(S4UKerberosTests, self).setUp() + super().setUp() self.do_asn1_print = global_asn1_print self.do_hexdump = global_hexdump diff --git a/python/samba/tests/krb5/simple_tests.py b/python/samba/tests/krb5/simple_tests.py index 3cd3b17bb31..81587bb13cd 100755 --- a/python/samba/tests/krb5/simple_tests.py +++ b/python/samba/tests/krb5/simple_tests.py @@ -37,7 +37,7 @@ global_hexdump = False class SimpleKerberosTests(RawKerberosTest): def setUp(self): - super(SimpleKerberosTests, self).setUp() + super().setUp() self.do_asn1_print = global_asn1_print self.do_hexdump = global_hexdump diff --git a/python/samba/tests/krb5/xrealm_tests.py b/python/samba/tests/krb5/xrealm_tests.py index 73a6b3cf52d..70e06f87db3 100755 --- a/python/samba/tests/krb5/xrealm_tests.py +++ b/python/samba/tests/krb5/xrealm_tests.py @@ -38,7 +38,7 @@ global_hexdump = False class XrealmKerberosTests(RawKerberosTest): def setUp(self): - super(XrealmKerberosTests, self).setUp() + super().setUp() self.do_asn1_print = global_asn1_print self.do_hexdump = global_hexdump diff --git a/python/samba/tests/krb5_credentials.py b/python/samba/tests/krb5_credentials.py index 178cc48aa6c..192d787decb 100644 --- a/python/samba/tests/krb5_credentials.py +++ b/python/samba/tests/krb5_credentials.py @@ -43,7 +43,7 @@ MACHINE_NAME = "krb5credstest" class PyKrb5CredentialsTests(TestCase): def setUp(self): - super(PyKrb5CredentialsTests, self).setUp() + super().setUp() self.server = os.environ["SERVER"] self.domain = os.environ["DOMAIN"] @@ -61,7 +61,7 @@ class PyKrb5CredentialsTests(TestCase): self.create_machine_account() def tearDown(self): - super(PyKrb5CredentialsTests, self).tearDown() + super().tearDown() delete_force(self.ldb, self.machine_dn) def test_get_named_ccache(self): diff --git a/python/samba/tests/ldap_raw.py b/python/samba/tests/ldap_raw.py index 09b61b2dc55..548039f120c 100644 --- a/python/samba/tests/ldap_raw.py +++ b/python/samba/tests/ldap_raw.py @@ -154,7 +154,7 @@ class RawLdapTest(TestCase): """ def setUp(self): - super(RawLdapTest, self).setUp() + super().setUp() self.host = samba.tests.env_get_var_value('SERVER') self.port = 636 @@ -166,7 +166,7 @@ class RawLdapTest(TestCase): def tearDown(self): self.disconnect() - super(RawLdapTest, self).tearDown() + super().tearDown() def disconnect(self): """ Disconnect from and clean up the connection to the server """ @@ -751,7 +751,7 @@ class RawCldapTest(TestCase): """ def setUp(self): - super(RawCldapTest, self).setUp() + super().setUp() self.host = samba.tests.env_get_var_value('SERVER') self.port = 389 @@ -760,7 +760,7 @@ class RawCldapTest(TestCase): def tearDown(self): self.disconnect() - super(RawCldapTest, self).tearDown() + super().tearDown() def disconnect(self): """ Disconnect from and clean up the connection to the server """ diff --git a/python/samba/tests/net_join.py b/python/samba/tests/net_join.py index 20f0e57e874..5bc3a1aab3d 100644 --- a/python/samba/tests/net_join.py +++ b/python/samba/tests/net_join.py @@ -31,7 +31,7 @@ import ctypes class NetJoinTests(samba.tests.TestCaseInTempDir): def setUp(self): - super(NetJoinTests, self).setUp() + super().setUp() self.domain = os.environ["DOMAIN"] self.server = os.environ["SERVER"] self.lp = self.get_loadparm() diff --git a/python/samba/tests/net_join_no_spnego.py b/python/samba/tests/net_join_no_spnego.py index 747f3c55b99..d0da28f1e2f 100644 --- a/python/samba/tests/net_join_no_spnego.py +++ b/python/samba/tests/net_join_no_spnego.py @@ -31,7 +31,7 @@ import ctypes class NetJoinNoSpnegoTests(samba.tests.TestCaseInTempDir): def setUp(self): - super(NetJoinNoSpnegoTests, self).setUp() + super().setUp() self.domain = os.environ["DOMAIN"] self.server = os.environ["SERVER"] self.lp = self.get_loadparm() diff --git a/python/samba/tests/netbios.py b/python/samba/tests/netbios.py index 9a0807215a3..0358b0b8ed9 100644 --- a/python/samba/tests/netbios.py +++ b/python/samba/tests/netbios.py @@ -22,7 +22,7 @@ from samba import netbios class NetBiosTests(samba.tests.TestCase): def setUp(self): - super(NetBiosTests, self).setUp() + super().setUp() self.n = netbios.Node() self.ifc = os.environ["SERVER_IP"] self.dc = os.environ["DC_NETBIOSNAME"] diff --git a/python/samba/tests/netlogonsvc.py b/python/samba/tests/netlogonsvc.py index 70efd6d2b06..a509930103a 100644 --- a/python/samba/tests/netlogonsvc.py +++ b/python/samba/tests/netlogonsvc.py @@ -31,7 +31,7 @@ Tests whether the netlogon service is running class NetlogonServiceTests(TestCase): def setUp(self): - super(NetlogonServiceTests, self).setUp() + super().setUp() self.server = os.environ["SERVER"] self.lp = self.get_loadparm() diff --git a/python/samba/tests/ntacls.py b/python/samba/tests/ntacls.py index 4d625768d91..0b7963d902e 100644 --- a/python/samba/tests/ntacls.py +++ b/python/samba/tests/ntacls.py @@ -33,14 +33,14 @@ DOMAIN_SID = "S-1-5-21-2212615479-2695158682-2101375467" class NtaclsTests(TestCaseInTempDir): def setUp(self): - super(NtaclsTests, self).setUp() + super().setUp() self.tempf = os.path.join(self.tempdir, "test") open(self.tempf, 'w').write("empty") self.session_info = system_session_unix() def tearDown(self): os.unlink(self.tempf) - super(NtaclsTests, self).tearDown() + super().tearDown() def test_setntacl(self): lp = LoadParm() diff --git a/python/samba/tests/ntacls_backup.py b/python/samba/tests/ntacls_backup.py index 03a9c0b22d8..d4e42940d4f 100644 --- a/python/samba/tests/ntacls_backup.py +++ b/python/samba/tests/ntacls_backup.py @@ -37,7 +37,7 @@ class NtaclsBackupRestoreTests(SmbdBaseTests): """ def setUp(self): - super(NtaclsBackupRestoreTests, self).setUp() + super().setUp() self.server = os.environ["SERVER"] # addc samdb_url = 'ldap://' + self.server @@ -90,7 +90,7 @@ class NtaclsBackupRestoreTests(SmbdBaseTests): def tearDown(self): self._delete_tarfile() self.smb_helper.delete_tree() - super(NtaclsBackupRestoreTests, self).tearDown() + super().tearDown() def _delete_tarfile(self): try: diff --git a/python/samba/tests/ntlm_auth.py b/python/samba/tests/ntlm_auth.py index 8a43d6e1209..fc5fa206f5c 100644 --- a/python/samba/tests/ntlm_auth.py +++ b/python/samba/tests/ntlm_auth.py @@ -25,7 +25,7 @@ from samba.common import get_string class NTLMAuthHelpersTests(NTLMAuthTestCase): def setUp(self): - super(NTLMAuthHelpersTests, self).setUp() + super().setUp() self.username = os.environ["DC_USERNAME"] self.password = os.environ["DC_PASSWORD"] self.domain = os.environ["DOMAIN"] diff --git a/python/samba/tests/ntlm_auth_base.py b/python/samba/tests/ntlm_auth_base.py index 546c89762cc..993ac12ca03 100644 --- a/python/samba/tests/ntlm_auth_base.py +++ b/python/samba/tests/ntlm_auth_base.py @@ -29,7 +29,7 @@ from samba.tests import BlackboxTestCase class NTLMAuthTestCase(BlackboxTestCase): def setUp(self): - super(NTLMAuthTestCase, self).setUp() + super().setUp() bindir = os.path.normpath(os.getenv("BINDIR", "./bin")) self.ntlm_auth_path = os.path.join(bindir, 'ntlm_auth') self.lp = samba.tests.env_loadparm() diff --git a/python/samba/tests/ntlm_auth_krb5.py b/python/samba/tests/ntlm_auth_krb5.py index d1957d68a0b..db57400dda5 100644 --- a/python/samba/tests/ntlm_auth_krb5.py +++ b/python/samba/tests/ntlm_auth_krb5.py @@ -24,7 +24,7 @@ from samba.tests.ntlm_auth_base import NTLMAuthTestCase class NTLMAuthKerberosTests(NTLMAuthTestCase): def setUp(self): - super(NTLMAuthKerberosTests, self).setUp() + super().setUp() self.old_ccache = os.path.join(os.environ["SELFTEST_PREFIX"], "ktest", "krb5_ccache-2") self.ccache = os.path.join(os.environ["SELFTEST_PREFIX"], diff --git a/python/samba/tests/ntlmdisabled.py b/python/samba/tests/ntlmdisabled.py index 0365694cab0..405f47db620 100644 --- a/python/samba/tests/ntlmdisabled.py +++ b/python/samba/tests/ntlmdisabled.py @@ -34,7 +34,7 @@ Tests behaviour when NTLM is disabled class NtlmDisabledTests(TestCase): def setUp(self): - super(NtlmDisabledTests, self).setUp() + super().setUp() self.lp = self.get_loadparm() self.server = os.getenv("SERVER") diff --git a/python/samba/tests/param.py b/python/samba/tests/param.py index f201ef9e213..7c45d91c1e6 100644 --- a/python/samba/tests/param.py +++ b/python/samba/tests/param.py @@ -25,13 +25,13 @@ import os class LoadParmTestCase(samba.tests.TestCaseInTempDir): def setUp(self): - super(LoadParmTestCase, self).setUp() + super().setUp() self.tempf = os.path.join(self.tempdir, "test") open(self.tempf, 'w').write("empty") def tearDown(self): os.unlink(self.tempf) - super(LoadParmTestCase, self).tearDown() + super().tearDown() def test_init(self): file = param.LoadParm() diff --git a/python/samba/tests/password_hash.py b/python/samba/tests/password_hash.py index 35983cfd5cd..1b7af7de7b8 100644 --- a/python/samba/tests/password_hash.py +++ b/python/samba/tests/password_hash.py @@ -75,7 +75,7 @@ class PassWordHashTests(TestCase): def setUp(self): self.lp = samba.tests.env_loadparm() - super(PassWordHashTests, self).setUp() + super().setUp() def set_store_cleartext(self, cleartext): # get the current pwdProperties diff --git a/python/samba/tests/posixacl.py b/python/samba/tests/posixacl.py index 0ef689d5cf3..a82fa768988 100644 --- a/python/samba/tests/posixacl.py +++ b/python/samba/tests/posixacl.py @@ -37,7 +37,7 @@ ACL = "O:S-1-5-21-2212615479-2695158682-2101375467-512G:S-1-5-21-2212615479-2695 class PosixAclMappingTests(SmbdBaseTests): def setUp(self): - super(PosixAclMappingTests, self).setUp() + super().setUp() s3conf = s3param.get_context() s3conf.load(self.get_loadparm().configfile) s3conf.set("xattr_tdb:file", os.path.join(self.tempdir, "xattr.tdb")) @@ -49,7 +49,7 @@ class PosixAclMappingTests(SmbdBaseTests): def tearDown(self): smbd.unlink(self.tempf, self.get_session_info()) os.unlink(os.path.join(self.tempdir, "xattr.tdb")) - super(PosixAclMappingTests, self).tearDown() + super().tearDown() def get_session_info(self, domsid=DOM_SID): """ diff --git a/python/samba/tests/prefork_restart.py b/python/samba/tests/prefork_restart.py index ef601dd5d7d..6c11200b39e 100644 --- a/python/samba/tests/prefork_restart.py +++ b/python/samba/tests/prefork_restart.py @@ -45,7 +45,7 @@ MACHINE_NAME = "PFRS" class PreforkProcessRestartTests(TestCase): def setUp(self): - super(PreforkProcessRestartTests, self).setUp() + super().setUp() lp_ctx = self.get_loadparm() self.msg_ctx = Messaging(lp_ctx=lp_ctx) diff --git a/python/samba/tests/py_credentials.py b/python/samba/tests/py_credentials.py index 0c442b81f3f..3db72822c93 100644 --- a/python/samba/tests/py_credentials.py +++ b/python/samba/tests/py_credentials.py @@ -57,7 +57,7 @@ USER_NAME = "PCTU" class PyCredentialsTests(TestCase): def setUp(self): - super(PyCredentialsTests, self).setUp() + super().setUp() self.server = os.environ["SERVER"] self.domain = os.environ["DOMAIN"] @@ -76,7 +76,7 @@ class PyCredentialsTests(TestCase): self.create_user_account() def tearDown(self): - super(PyCredentialsTests, self).tearDown() + super().tearDown() delete_force(self.ldb, self.machine_dn) delete_force(self.ldb, self.user_dn) diff --git a/python/samba/tests/registry.py b/python/samba/tests/registry.py index 51b280a6348..8154ae3dd18 100644 --- a/python/samba/tests/registry.py +++ b/python/samba/tests/registry.py @@ -37,14 +37,14 @@ class HelperTests(samba.tests.TestCase): class HiveTests(samba.tests.TestCaseInTempDir): def setUp(self): - super(HiveTests, self).setUp() + super().setUp() self.hive_path = os.path.join(self.tempdir, "ldb_new.ldb") self.hive = registry.open_ldb(self.hive_path) def tearDown(self): del self.hive os.unlink(self.hive_path) - super(HiveTests, self).tearDown() + super().tearDown() def test_ldb_new(self): self.assertTrue(self.hive is not None) diff --git a/python/samba/tests/s3_net_join.py b/python/samba/tests/s3_net_join.py index 2150e4e25b7..101f4b1b664 100644 --- a/python/samba/tests/s3_net_join.py +++ b/python/samba/tests/s3_net_join.py @@ -39,7 +39,7 @@ def rm(rmdir): class NetS3JoinTests(samba.tests.TestCaseInTempDir): def setUp(self): - super(NetS3JoinTests, self).setUp() + super().setUp() self.realm = os.environ["REALM"] self.domain = os.environ["DOMAIN"] self.server = os.environ["SERVER"] diff --git a/python/samba/tests/s3idmapdb.py b/python/samba/tests/s3idmapdb.py index b8d936f056f..ca16786b9f1 100644 --- a/python/samba/tests/s3idmapdb.py +++ b/python/samba/tests/s3idmapdb.py @@ -30,7 +30,7 @@ for p in ["../../../../../testdata/samba3", "../../../../testdata/samba3"]: class IdmapDbTestCase(TestCase): def setUp(self): - super(IdmapDbTestCase, self).setUp() + super().setUp() self.idmapdb = IdmapDatabase(os.path.join(DATADIR, "winbindd_idmap")) @@ -54,4 +54,4 @@ class IdmapDbTestCase(TestCase): def tearDown(self): self.idmapdb.close() - super(IdmapDbTestCase, self).tearDown() + super().tearDown() diff --git a/python/samba/tests/s3param.py b/python/samba/tests/s3param.py index 232e79bbd5f..263ea212263 100644 --- a/python/samba/tests/s3param.py +++ b/python/samba/tests/s3param.py @@ -31,7 +31,7 @@ for p in ["../../../../../testdata/samba3", "../../../../testdata/samba3"]: class ParamTestCase(TestCaseInTempDir): def setUp(self): - super(ParamTestCase, self).setUp() + super().setUp() os.system("cp -r %s %s" % (DATADIR, self.tempdir)) datadir = os.path.join(self.tempdir, "samba3") @@ -41,7 +41,7 @@ class ParamTestCase(TestCaseInTempDir): def tearDown(self): self.lp = [] os.system("rm -rf %s" % os.path.join(self.tempdir, "samba3")) - super(ParamTestCase, self).tearDown() + super().tearDown() def test_param(self): self.assertEqual("BEDWYR", self.lp.get("netbios name")) diff --git a/python/samba/tests/s3passdb.py b/python/samba/tests/s3passdb.py index 734ca96110a..b584e07fc98 100644 --- a/python/samba/tests/s3passdb.py +++ b/python/samba/tests/s3passdb.py @@ -33,7 +33,7 @@ for p in ["../../../../../testdata/samba3", "../../../../testdata/samba3"]: class PassdbTestCase(TestCaseInTempDir): def setUp(self): - super(PassdbTestCase, self).setUp() + super().setUp() os.system("cp -r %s %s" % (DATADIR, self.tempdir)) datadir = os.path.join(self.tempdir, "samba3") @@ -50,7 +50,7 @@ class PassdbTestCase(TestCaseInTempDir): self.lp = [] self.pdb = [] os.system("rm -rf %s" % os.path.join(self.tempdir, "samba3")) - super(PassdbTestCase, self).tearDown() + super().tearDown() def test_policy(self): policy = self.pdb.get_account_policy() diff --git a/python/samba/tests/s3registry.py b/python/samba/tests/s3registry.py index 5e9004e4e1d..1932d064af9 100644 --- a/python/samba/tests/s3registry.py +++ b/python/samba/tests/s3registry.py @@ -31,12 +31,12 @@ for p in ["../../../../../testdata/samba3", "../../../../testdata/samba3"]: class RegistryTestCase(TestCase): def setUp(self): - super(RegistryTestCase, self).setUp() + super().setUp() self.registry = Registry(os.path.join(DATADIR, "registry")) def tearDown(self): self.registry.close() - super(RegistryTestCase, self).tearDown() + super().tearDown() def test_length(self): self.assertEqual(28, len(self.registry)) diff --git a/python/samba/tests/s3windb.py b/python/samba/tests/s3windb.py index b92105c46b4..62f429cd126 100644 --- a/python/samba/tests/s3windb.py +++ b/python/samba/tests/s3windb.py @@ -31,7 +31,7 @@ for p in ["../../../../../testdata/samba3", "../../../../testdata/samba3"]: class WinsDatabaseTestCase(TestCase): def setUp(self): - super(WinsDatabaseTestCase, self).setUp() + super().setUp() self.winsdb = WinsDatabase(os.path.join(DATADIR, "wins.dat")) def test_length(self): @@ -42,4 +42,4 @@ class WinsDatabaseTestCase(TestCase): def tearDown(self): self.winsdb.close() - super(WinsDatabaseTestCase, self).tearDown() + super().tearDown() diff --git a/python/samba/tests/samba3sam.py b/python/samba/tests/samba3sam.py index 01d274da7be..1f88602364a 100644 --- a/python/samba/tests/samba3sam.py +++ b/python/samba/tests/samba3sam.py @@ -65,7 +65,7 @@ class MapBaseTestCase(TestCaseInTempDir): self.lp = env_loadparm() self.lp.set("workgroup", "TESTS") self.lp.set("netbios name", "TESTS") - super(MapBaseTestCase, self).setUp() + super().setUp() def make_dn(basedn, rdn): return "%s,sambaDomainName=TESTS,%s" % (rdn, basedn) @@ -125,7 +125,7 @@ class MapBaseTestCase(TestCaseInTempDir): if os.path.exists(mdata): os.unlink(mdata) os.rmdir(pdir) - super(MapBaseTestCase, self).tearDown() + super().tearDown() def assertSidEquals(self, text, ndr_sid): sid_obj1 = samba.ndr.ndr_unpack(samba.dcerpc.security.dom_sid, @@ -137,7 +137,7 @@ class MapBaseTestCase(TestCaseInTempDir): class Samba3SamTestCase(MapBaseTestCase): def setUp(self): - super(Samba3SamTestCase, self).setUp() + super().setUp() ldb = Ldb(self.ldburl, lp=self.lp, session_info=system_session()) ldb.set_opaque("skip_allocate_sids", "true") self.samba3.setup_data("samba3.ldif") @@ -306,7 +306,7 @@ delete: description class MapTestCase(MapBaseTestCase): def setUp(self): - super(MapTestCase, self).setUp() + super().setUp() ldb = Ldb(self.ldburl, lp=self.lp, session_info=system_session()) ldb.set_opaque("skip_allocate_sids", "true") ldif = read_datafile("provision_samba3sam.ldif") diff --git a/python/samba/tests/samba_tool/computer.py b/python/samba/tests/samba_tool/computer.py index 740aaf0d48a..b60e7561cdd 100644 --- a/python/samba/tests/samba_tool/computer.py +++ b/python/samba/tests/samba_tool/computer.py @@ -33,7 +33,7 @@ class ComputerCmdTestCase(SambaToolCmdTest): samdb = None def setUp(self): - super(ComputerCmdTestCase, self).setUp() + super().setUp() self.creds = "-U%s%%%s" % (os.environ["DC_USERNAME"], os.environ["DC_PASSWORD"]) self.samdb = self.getSamDB("-H", "ldap://%s" % os.environ["DC_SERVER"], self.creds) # ips used to test --ip-address option @@ -91,7 +91,7 @@ class ComputerCmdTestCase(SambaToolCmdTest): computer["description"]) def tearDown(self): - super(ComputerCmdTestCase, self).tearDown() + super().tearDown() # clean up all the left over computers, just in case for computer in self.computers: if self._find_computer(computer["name"]): diff --git a/python/samba/tests/samba_tool/contact.py b/python/samba/tests/samba_tool/contact.py index 00050120bfc..2bec8135f87 100644 --- a/python/samba/tests/samba_tool/contact.py +++ b/python/samba/tests/samba_tool/contact.py @@ -28,7 +28,7 @@ class ContactCmdTestCase(SambaToolCmdTest): samdb = None def setUp(self): - super(ContactCmdTestCase, self).setUp() + super().setUp() self.creds = "-U%s%%%s" % (os.environ["DC_USERNAME"], os.environ["DC_PASSWORD"]) self.samdb = self.getSamDB("-H", @@ -83,7 +83,7 @@ class ContactCmdTestCase(SambaToolCmdTest): contact["description"]) def tearDown(self): - super(ContactCmdTestCase, self).tearDown() + super().tearDown() # clean up all the left over contacts, just in case for contact in self.contacts: if self._find_contact(contact["expectedname"]): diff --git a/python/samba/tests/samba_tool/demote.py b/python/samba/tests/samba_tool/demote.py index ce57ad16c41..2c63ccaaf53 100644 --- a/python/samba/tests/samba_tool/demote.py +++ b/python/samba/tests/samba_tool/demote.py @@ -24,7 +24,7 @@ class DemoteCmdTestCase(SambaToolCmdTest): """Test for samba-tool domain demote subcommand""" def setUp(self): - super(DemoteCmdTestCase, self).setUp() + super().setUp() self.creds_string = "-U{0}%{1}".format( os.environ["DC_USERNAME"], os.environ["DC_PASSWORD"]) diff --git a/python/samba/tests/samba_tool/dnscmd.py b/python/samba/tests/samba_tool/dnscmd.py index da8ff9a76b6..d372bc5851e 100644 --- a/python/samba/tests/samba_tool/dnscmd.py +++ b/python/samba/tests/samba_tool/dnscmd.py @@ -28,7 +28,7 @@ from samba import dsdb_dns class DnsCmdTestCase(SambaToolCmdTest): def setUp(self): - super(DnsCmdTestCase, self).setUp() + super().setUp() self.dburl = "ldap://%s" % os.environ["SERVER"] self.creds_string = "-U%s%%%s" % (os.environ["DC_USERNAME"], diff --git a/python/samba/tests/samba_tool/drs_clone_dc_data_lmdb_size.py b/python/samba/tests/samba_tool/drs_clone_dc_data_lmdb_size.py index efb9ed9536a..1cb88d38a18 100644 --- a/python/samba/tests/samba_tool/drs_clone_dc_data_lmdb_size.py +++ b/python/samba/tests/samba_tool/drs_clone_dc_data_lmdb_size.py @@ -24,7 +24,7 @@ class DrsCloneDcDataLmdbSizeTestCase(SambaToolCmdTest): """Test setting of the lmdb map size during drs clone-dc-data""" def setUp(self): - super(DrsCloneDcDataLmdbSizeTestCase, self).setUp() + super().setUp() self.tempsambadir = os.path.join(self.tempdir, "samba") os.mkdir(self.tempsambadir) @@ -115,5 +115,5 @@ class DrsCloneDcDataLmdbSizeTestCase(SambaToolCmdTest): " optional unit suffix") def tearDown(self): - super(DrsCloneDcDataLmdbSizeTestCase, self).tearDown() + super().tearDown() shutil.rmtree(self.tempsambadir) diff --git a/python/samba/tests/samba_tool/dsacl.py b/python/samba/tests/samba_tool/dsacl.py index 85c08d4932d..8ddf37e5c7f 100644 --- a/python/samba/tests/samba_tool/dsacl.py +++ b/python/samba/tests/samba_tool/dsacl.py @@ -28,13 +28,13 @@ class DSaclSetSddlTestCase(SambaToolCmdTest): sddl_multi = "(OA;CIIO;RPWP;aaaaaaaa-1111-bbbb-2222-dddddddddddd;33333333-eeee-4444-ffff-555555555555;PS)(OA;CIIO;RPWP;cccccccc-9999-ffff-8888-eeeeeeeeeeee;77777777-dddd-6666-bbbb-555555555555;PS)" def setUp(self): - super(DSaclSetSddlTestCase, self).setUp() + super().setUp() self.samdb = self.getSamDB("-H", "ldap://%s" % os.environ["DC_SERVER"],"-U%s%%%s" % (os.environ["DC_USERNAME"], os.environ["DC_PASSWORD"])) self.dn="OU=DSaclSetSddlTestCase,%s" % self.samdb.domain_dn() self.samdb.create_ou(self.dn) def tearDown(self): - super(DSaclSetSddlTestCase, self).tearDown() + super().tearDown() # clean-up the created test ou self.samdb.delete(self.dn) diff --git a/python/samba/tests/samba_tool/forest.py b/python/samba/tests/samba_tool/forest.py index 25eeb4ccedb..23291ca83a3 100644 --- a/python/samba/tests/samba_tool/forest.py +++ b/python/samba/tests/samba_tool/forest.py @@ -25,13 +25,13 @@ class ForestCmdTestCase(SambaToolCmdTest): samdb = None def setUp(self): - super(ForestCmdTestCase, self).setUp() + super().setUp() self.samdb = self.getSamDB("-H", "ldap://%s" % os.environ["DC_SERVER"], "-U%s%%%s" % (os.environ["DC_USERNAME"], os.environ["DC_PASSWORD"])) self.domain_dn = self.samdb.domain_dn() def tearDown(self): - super(ForestCmdTestCase, self).tearDown() + super().tearDown() # Reset the values we might have changed. ds_dn = "CN=Directory Service,CN=Windows NT,CN=Services,CN=Configuration" m = ldb.Message() diff --git a/python/samba/tests/samba_tool/gpo.py b/python/samba/tests/samba_tool/gpo.py index 39363bc4f75..851c70efecf 100644 --- a/python/samba/tests/samba_tool/gpo.py +++ b/python/samba/tests/samba_tool/gpo.py @@ -1822,7 +1822,7 @@ class GpoCmdTestCase(SambaToolCmdTest): def setUp(self): """set up a temporary GPO to work with""" - super(GpoCmdTestCase, self).setUp() + super().setUp() (result, out, err) = self.runsubcmd("gpo", "create", self.gpo_name, "-H", "ldap://%s" % os.environ["SERVER"], "-U%s%%%s" % (os.environ["USERNAME"], os.environ["PASSWORD"]), @@ -1844,4 +1844,4 @@ class GpoCmdTestCase(SambaToolCmdTest): """remove the temporary GPO to work with""" (result, out, err) = self.runsubcmd("gpo", "del", self.gpo_guid, "-H", "ldap://%s" % os.environ["SERVER"], "-U%s%%%s" % (os.environ["USERNAME"], os.environ["PASSWORD"])) self.assertCmdSuccess(result, out, err, "Ensuring gpo deleted successfully") - super(GpoCmdTestCase, self).tearDown() + super().tearDown() diff --git a/python/samba/tests/samba_tool/gpo_exts.py b/python/samba/tests/samba_tool/gpo_exts.py index 8ee14d1bfae..e7a24b0aa4f 100644 --- a/python/samba/tests/samba_tool/gpo_exts.py +++ b/python/samba/tests/samba_tool/gpo_exts.py @@ -171,7 +171,7 @@ class GpoCmdTestCase(SambaToolCmdTest): def setUp(self): """set up a temporary GPO to work with""" - super(GpoCmdTestCase, self).setUp() + super().setUp() (result, out, err) = self.runsubcmd("gpo", "create", self.gpo_name, "-H", "ldap://%s" % os.environ["SERVER"], "-U%s%%%s" % (os.environ["USERNAME"], os.environ["PASSWORD"]), @@ -199,4 +199,4 @@ class GpoCmdTestCase(SambaToolCmdTest): self.assertCmdSuccess(result, out, err, 'User delete failed') (result, out, err) = self.runsubcmd("group", "delete", self.test_group) self.assertCmdSuccess(result, out, err, 'Group delete failed') - super(GpoCmdTestCase, self).tearDown() + super().tearDown() diff --git a/python/samba/tests/samba_tool/group.py b/python/samba/tests/samba_tool/group.py index ed95ef6c5b1..e7a660c75e1 100644 --- a/python/samba/tests/samba_tool/group.py +++ b/python/samba/tests/samba_tool/group.py @@ -31,7 +31,7 @@ class GroupCmdTestCase(SambaToolCmdTest): samdb = None def setUp(self): - super(GroupCmdTestCase, self).setUp() + super().setUp() self.samdb = self.getSamDB("-H", "ldap://%s" % os.environ["DC_SERVER"], "-U%s%%%s" % (os.environ["DC_USERNAME"], os.environ["DC_PASSWORD"])) self.groups = [] @@ -74,7 +74,7 @@ class GroupCmdTestCase(SambaToolCmdTest): self.assertEqual("%s" % found.get("description"), group["description"]) def tearDown(self): - super(GroupCmdTestCase, self).tearDown() + super().tearDown() # clean up all the left over groups, just in case for group in self.groups: if self._find_group(group["name"]): diff --git a/python/samba/tests/samba_tool/join_lmdb_size.py b/python/samba/tests/samba_tool/join_lmdb_size.py index db166690bd9..7b43c45ce78 100644 --- a/python/samba/tests/samba_tool/join_lmdb_size.py +++ b/python/samba/tests/samba_tool/join_lmdb_size.py @@ -24,7 +24,7 @@ class JoinLmdbSizeTestCase(SambaToolCmdTest): """Test setting of the lmdb map size during join""" def setUp(self): - super(JoinLmdbSizeTestCase, self).setUp() + super().setUp() self.tempsambadir = os.path.join(self.tempdir, "samba") os.mkdir(self.tempsambadir) (_, name) = os.path.split(self.tempdir) @@ -148,5 +148,5 @@ class JoinLmdbSizeTestCase(SambaToolCmdTest): " optional unit suffix") def tearDown(self): - super(JoinLmdbSizeTestCase, self).tearDown() + super().tearDown() shutil.rmtree(self.tempsambadir) diff --git a/python/samba/tests/samba_tool/ou.py b/python/samba/tests/samba_tool/ou.py index dd5fc672c2b..7a848766e0b 100644 --- a/python/samba/tests/samba_tool/ou.py +++ b/python/samba/tests/samba_tool/ou.py @@ -30,7 +30,7 @@ class OUCmdTestCase(SambaToolCmdTest): samdb = None def setUp(self): - super(OUCmdTestCase, self).setUp() + super().setUp() self.samdb = self.getSamDB("-H", "ldap://%s" % os.environ["DC_SERVER"], "-U%s%%%s" % (os.environ["DC_USERNAME"], os.environ["DC_PASSWORD"])) self.ous = [] @@ -57,7 +57,7 @@ class OUCmdTestCase(SambaToolCmdTest): ou["description"]) def tearDown(self): - super(OUCmdTestCase, self).tearDown() + super().tearDown() # clean up all the left over ous, just in case for ou in self.ous: if self._find_ou(ou["name"]): diff --git a/python/samba/tests/samba_tool/passwordsettings.py b/python/samba/tests/samba_tool/passwordsettings.py index e9e995389bd..6db7a585b82 100644 --- a/python/samba/tests/samba_tool/passwordsettings.py +++ b/python/samba/tests/samba_tool/passwordsettings.py @@ -26,7 +26,7 @@ class PwdSettingsCmdTestCase(SambaToolCmdTest): """Tests for 'samba-tool domain passwordsettings' subcommands""" def setUp(self): - super(PwdSettingsCmdTestCase, self).setUp() + super().setUp() self.server = "ldap://%s" % os.environ["DC_SERVER"] self.user_auth = "-U%s%%%s" % (os.environ["DC_USERNAME"], os.environ["DC_PASSWORD"]) @@ -36,7 +36,7 @@ class PwdSettingsCmdTestCase(SambaToolCmdTest): self.obj_cleanup = [] def tearDown(self): - super(PwdSettingsCmdTestCase, self).tearDown() + super().tearDown() # clean-up any objects the test has created for dn in self.obj_cleanup: self.ldb.delete(dn) diff --git a/python/samba/tests/samba_tool/promote_dc_lmdb_size.py b/python/samba/tests/samba_tool/promote_dc_lmdb_size.py index fbb0bfdeeff..88e9d7cac63 100644 --- a/python/samba/tests/samba_tool/promote_dc_lmdb_size.py +++ b/python/samba/tests/samba_tool/promote_dc_lmdb_size.py @@ -24,7 +24,7 @@ class PromoteDcLmdbSizeTestCase(SambaToolCmdTest): """Test setting of the lmdb map size during a promote dc""" def setUp(self): - super(PromoteDcLmdbSizeTestCase, self).setUp() + super().setUp() self.tempsambadir = os.path.join(self.tempdir, "samba") os.mkdir(self.tempsambadir) (_, name) = os.path.split(self.tempdir) @@ -170,5 +170,5 @@ class PromoteDcLmdbSizeTestCase(SambaToolCmdTest): " optional unit suffix") def tearDown(self): - super(PromoteDcLmdbSizeTestCase, self).tearDown() + super().tearDown() shutil.rmtree(self.tempsambadir) diff --git a/python/samba/tests/samba_tool/provision_lmdb_size.py b/python/samba/tests/samba_tool/provision_lmdb_size.py index 2435e120e07..3514edf854b 100644 --- a/python/samba/tests/samba_tool/provision_lmdb_size.py +++ b/python/samba/tests/samba_tool/provision_lmdb_size.py @@ -24,7 +24,7 @@ class ProvisionLmdbSizeTestCase(SambaToolCmdTest): """Test setting of the lmdb map size during provision""" def setUp(self): - super(ProvisionLmdbSizeTestCase, self).setUp() + super().setUp() self.tempsambadir = os.path.join(self.tempdir, "samba") os.mkdir(self.tempsambadir) @@ -128,5 +128,5 @@ class ProvisionLmdbSizeTestCase(SambaToolCmdTest): " optional unit suffix") def tearDown(self): - super(ProvisionLmdbSizeTestCase, self).tearDown() + super().tearDown() shutil.rmtree(self.tempsambadir) diff --git a/python/samba/tests/samba_tool/provision_password_check.py b/python/samba/tests/samba_tool/provision_password_check.py index 83304292568..51b4a4d3cfd 100644 --- a/python/samba/tests/samba_tool/provision_password_check.py +++ b/python/samba/tests/samba_tool/provision_password_check.py @@ -24,7 +24,7 @@ class ProvisionPasswordTestCase(SambaToolCmdTest): """Test for password validation in domain provision subcommand""" def setUp(self): - super(ProvisionPasswordTestCase, self).setUp() + super().setUp() self.tempsambadir = os.path.join(self.tempdir, "samba") os.mkdir(self.tempsambadir) @@ -53,5 +53,5 @@ class ProvisionPasswordTestCase(SambaToolCmdTest): self.assertCmdSuccess(result, out, err) def tearDown(self): - super(ProvisionPasswordTestCase, self).tearDown() + super().tearDown() shutil.rmtree(self.tempsambadir) diff --git a/python/samba/tests/samba_tool/provision_userPassword_crypt.py b/python/samba/tests/samba_tool/provision_userPassword_crypt.py index 07752e16c30..2de8cdd2b0e 100644 --- a/python/samba/tests/samba_tool/provision_userPassword_crypt.py +++ b/python/samba/tests/samba_tool/provision_userPassword_crypt.py @@ -27,7 +27,7 @@ class ProvisionUserPasswordTestCase(SambaToolCmdTest): """Test for crypt() hashed passwords""" def setUp(self): - super(ProvisionUserPasswordTestCase, self).setUp() + super().setUp() self.tempsambadir = os.path.join(self.tempdir, "samba") os.mkdir(self.tempsambadir) @@ -63,5 +63,5 @@ class ProvisionUserPasswordTestCase(SambaToolCmdTest): self.assertNotEqual(0, result) def tearDown(self): - super(ProvisionUserPasswordTestCase, self).tearDown() + super().tearDown() shutil.rmtree(self.tempsambadir) diff --git a/python/samba/tests/samba_tool/rodc.py b/python/samba/tests/samba_tool/rodc.py index 3a835dc0b02..94e84d6a677 100644 --- a/python/samba/tests/samba_tool/rodc.py +++ b/python/samba/tests/samba_tool/rodc.py @@ -27,7 +27,7 @@ from samba.auth import system_session class RodcCmdTestCase(SambaToolCmdTest): def setUp(self): - super(RodcCmdTestCase, self).setUp() + super().setUp() self.lp = samba.param.LoadParm() self.lp.load(os.environ["SMB_CONF_PATH"]) self.creds = Credentials() @@ -53,7 +53,7 @@ class RodcCmdTestCase(SambaToolCmdTest): add_members_operation=True) def tearDown(self): - super(RodcCmdTestCase, self).tearDown() + super().tearDown() self.ldb.deleteuser("sambatool1") self.ldb.deleteuser("sambatool2") self.ldb.deleteuser("sambatool3") diff --git a/python/samba/tests/samba_tool/schema.py b/python/samba/tests/samba_tool/schema.py index 31f71559b92..5c4ac78ef53 100644 --- a/python/samba/tests/samba_tool/schema.py +++ b/python/samba/tests/samba_tool/schema.py @@ -25,7 +25,7 @@ class SchemaCmdTestCase(SambaToolCmdTest): samdb = None def setUp(self): - super(SchemaCmdTestCase, self).setUp() + super().setUp() self.samdb = self.getSamDB("-H", "ldap://%s" % os.environ["DC_SERVER"], "-U%s%%%s" % (os.environ["DC_USERNAME"], os.environ["DC_PASSWORD"])) diff --git a/python/samba/tests/samba_tool/sites.py b/python/samba/tests/samba_tool/sites.py index a9515b4b896..4288f35bc94 100644 --- a/python/samba/tests/samba_tool/sites.py +++ b/python/samba/tests/samba_tool/sites.py @@ -29,7 +29,7 @@ from samba import sites, subnets class BaseSitesCmdTestCase(SambaToolCmdTest): """Tests for samba-tool sites subnets""" def setUp(self): - super(BaseSitesCmdTestCase, self).setUp() + super().setUp() self.dburl = "ldap://%s" % os.environ["DC_SERVER"] self.creds_string = "-U%s%%%s" % (os.environ["DC_USERNAME"], os.environ["DC_PASSWORD"]) @@ -87,7 +87,7 @@ class SitesCmdTestCase(BaseSitesCmdTestCase): class SitesSubnetCmdTestCase(BaseSitesCmdTestCase): def setUp(self): - super(SitesSubnetCmdTestCase, self).setUp() + super().setUp() self.sitename = "testsite" self.sitename2 = "testsite2" self.samdb.transaction_start() @@ -100,7 +100,7 @@ class SitesSubnetCmdTestCase(BaseSitesCmdTestCase): sites.delete_site(self.samdb, self.config_dn, self.sitename) sites.delete_site(self.samdb, self.config_dn, self.sitename2) self.samdb.transaction_commit() - super(SitesSubnetCmdTestCase, self).tearDown() + super().tearDown() def test_site_subnet_create(self): cidrs = (("10.9.8.0/24", self.sitename), diff --git a/python/samba/tests/samba_tool/user.py b/python/samba/tests/samba_tool/user.py index 99fb6d9b2f3..e43a00c472e 100644 --- a/python/samba/tests/samba_tool/user.py +++ b/python/samba/tests/samba_tool/user.py @@ -39,7 +39,7 @@ class UserCmdTestCase(SambaToolCmdTest): samdb = None def setUp(self): - super(UserCmdTestCase, self).setUp() + super().setUp() self.samdb = self.getSamDB("-H", "ldap://%s" % os.environ["DC_SERVER"], "-U%s%%%s" % (os.environ["DC_USERNAME"], os.environ["DC_PASSWORD"])) @@ -83,7 +83,7 @@ class UserCmdTestCase(SambaToolCmdTest): user["checkUserFn"](user) def tearDown(self): - super(UserCmdTestCase, self).tearDown() + super().tearDown() # clean up all the left over users, just in case for user in self.users: if self._find_user(user["name"]): diff --git a/python/samba/tests/samba_tool/user_check_password_script.py b/python/samba/tests/samba_tool/user_check_password_script.py index 9dcb52199e1..183b77bde81 100644 --- a/python/samba/tests/samba_tool/user_check_password_script.py +++ b/python/samba/tests/samba_tool/user_check_password_script.py @@ -26,14 +26,14 @@ class UserCheckPwdTestCase(SambaToolCmdTest): samdb = None def setUp(self): - super(UserCheckPwdTestCase, self).setUp() + super().setUp() self.samdb = self.getSamDB("-H", "ldap://%s" % os.environ["DC_SERVER"], "-U%s%%%s" % (os.environ["DC_USERNAME"], os.environ["DC_PASSWORD"])) self.old_min_pwd_age = self.samdb.get_minPwdAge() self.samdb.set_minPwdAge("0") def tearDown(self): - super(UserCheckPwdTestCase, self).tearDown() + super().tearDown() self.samdb.set_minPwdAge(self.old_min_pwd_age) def _test_checkpassword(self, user, bad_password, good_password, desc): diff --git a/python/samba/tests/samba_tool/user_virtualCryptSHA.py b/python/samba/tests/samba_tool/user_virtualCryptSHA.py index 1a757e3816b..38b1c9375b8 100644 --- a/python/samba/tests/samba_tool/user_virtualCryptSHA.py +++ b/python/samba/tests/samba_tool/user_virtualCryptSHA.py @@ -75,7 +75,7 @@ class UserCmdCryptShaTestCase(SambaToolCmdTest): password) def tearDown(self): - super(UserCmdCryptShaTestCase, self).tearDown() + super().tearDown() self.runsubcmd("user", "delete", USER_NAME) def _get_password(self, attributes, decrypt=False): diff --git a/python/samba/tests/samba_tool/user_virtualCryptSHA_base.py b/python/samba/tests/samba_tool/user_virtualCryptSHA_base.py index 7eb91db5e32..d5f7b83da32 100644 --- a/python/samba/tests/samba_tool/user_virtualCryptSHA_base.py +++ b/python/samba/tests/samba_tool/user_virtualCryptSHA_base.py @@ -75,7 +75,7 @@ class UserCmdCryptShaTestCase(SambaToolCmdTest): password) def tearDown(self): - super(UserCmdCryptShaTestCase, self).tearDown() + super().tearDown() self.runsubcmd("user", "delete", USER_NAME) def _get_password(self, attributes, decrypt=False): diff --git a/python/samba/tests/samba_tool/user_wdigest.py b/python/samba/tests/samba_tool/user_wdigest.py index 874de0d3814..d1153120599 100644 --- a/python/samba/tests/samba_tool/user_wdigest.py +++ b/python/samba/tests/samba_tool/user_wdigest.py @@ -48,7 +48,7 @@ class UserCmdWdigestTestCase(SambaToolCmdTest): samdb = None def setUp(self): - super(UserCmdWdigestTestCase, self).setUp() + super().setUp() self.lp = samba.tests.env_loadparm() self.samdb = self.getSamDB( "-H", "ldap://%s" % os.environ["DC_SERVER"], @@ -71,7 +71,7 @@ class UserCmdWdigestTestCase(SambaToolCmdTest): "Ensure user is created") def tearDown(self): - super(UserCmdWdigestTestCase, self).tearDown() + super().tearDown() result, out, err = self.runsubcmd("user", "delete", USER_NAME) self.assertCmdSuccess(result, out, diff --git a/python/samba/tests/samba_tool/visualize.py b/python/samba/tests/samba_tool/visualize.py index 41d318beb46..f736129db8c 100644 --- a/python/samba/tests/samba_tool/visualize.py +++ b/python/samba/tests/samba_tool/visualize.py @@ -89,7 +89,7 @@ def collapse_space(s, keep_empty_lines=False): class SambaToolVisualizeLdif(SambaToolCmdTest): def setUp(self): - super(SambaToolVisualizeLdif, self).setUp() + super().setUp() self.lp = LoadParm() self.samdb, self.dbfile = samdb_from_ldif(MULTISITE_LDIF, self.tempdir, @@ -98,7 +98,7 @@ class SambaToolVisualizeLdif(SambaToolCmdTest): def tearDown(self): self.remove_files(self.dbfile) - super(SambaToolVisualizeLdif, self).tearDown() + super().tearDown() def remove_files(self, *files): for f in files: diff --git a/python/samba/tests/samba_upgradedns_lmdb.py b/python/samba/tests/samba_upgradedns_lmdb.py index 048993152e2..a2029a07d24 100644 --- a/python/samba/tests/samba_upgradedns_lmdb.py +++ b/python/samba/tests/samba_upgradedns_lmdb.py @@ -26,7 +26,7 @@ class UpgradeDnsLmdbTestCase(SambaToolCmdTest): """ def setUp(self): - super(UpgradeDnsLmdbTestCase, self).setUp() + super().setUp() self.tempsambadir = os.path.join(self.tempdir, "samba") os.mkdir(self.tempsambadir) @@ -55,7 +55,7 @@ class UpgradeDnsLmdbTestCase(SambaToolCmdTest): return self.run_command(command) def tearDown(self): - super(UpgradeDnsLmdbTestCase, self).tearDown() + super().tearDown() shutil.rmtree(self.tempsambadir) def test_lmdb_lock_files_linked_on_upgrade_to_bind9_dlz(self): diff --git a/python/samba/tests/samdb.py b/python/samba/tests/samdb.py index f7697f83fdc..e8b632bc9e2 100644 --- a/python/samba/tests/samdb.py +++ b/python/samba/tests/samdb.py @@ -34,7 +34,7 @@ class SamDBTestCase(TestCaseInTempDir): """ def setUp(self): - super(SamDBTestCase, self).setUp() + super().setUp() self.session = system_session() logger = logging.getLogger("selftest") self.domain = "dsdb" @@ -56,7 +56,7 @@ class SamDBTestCase(TestCaseInTempDir): self.rm_files('names.tdb') self.rm_dirs('etc', 'msg.lock', 'private', 'state', 'bind-dns') - super(SamDBTestCase, self).tearDown() + super().tearDown() class SamDBTests(SamDBTestCase): diff --git a/python/samba/tests/samdb_api.py b/python/samba/tests/samdb_api.py index 49e39a9546a..5a720aa2399 100644 --- a/python/samba/tests/samdb_api.py +++ b/python/samba/tests/samdb_api.py @@ -27,7 +27,7 @@ class SamDBApiTestCase(TestCaseInTempDir): def tearDown(self): self.rm_files("test.db", "existing.db", allow_missing=True) - super(SamDBApiTestCase, self).tearDown() + super().tearDown() # Attempt to open and existing non tdb file as a tdb file. # Don't create new db is set, the default diff --git a/python/samba/tests/security.py b/python/samba/tests/security.py index fb2897e4dfc..68df3dd7f42 100644 --- a/python/samba/tests/security.py +++ b/python/samba/tests/security.py @@ -27,7 +27,7 @@ from samba import NTSTATUSError class SecurityTokenTests(samba.tests.TestCase): def setUp(self): - super(SecurityTokenTests, self).setUp() + super().setUp() self.token = security.token() def test_is_system(self): @@ -54,7 +54,7 @@ class SecurityTokenTests(samba.tests.TestCase): class SecurityDescriptorTests(samba.tests.TestCase): def setUp(self): - super(SecurityDescriptorTests, self).setUp() + super().setUp() self.descriptor = security.descriptor() def test_from_sddl(self): @@ -183,7 +183,7 @@ class SecurityAceTests(samba.tests.TestCase): sddl_sid = "(OA;CIIO;RPWP;aaaaaaaa-1111-bbbb-2222-dddddddddddd;33333333-eeee-4444-ffff-555555555555;S-1-5-10)" def setUp(self): - super(SecurityAceTests, self).setUp() + super().setUp() self.dom = security.dom_sid("S-1-2-3") def test_equality(self): diff --git a/python/samba/tests/smb-notify.py b/python/samba/tests/smb-notify.py index 8c7dad0b762..4587a006420 100755 --- a/python/samba/tests/smb-notify.py +++ b/python/samba/tests/smb-notify.py @@ -36,7 +36,7 @@ test_dir = os.path.join('notify_test_%d' % random.randint(0, 0xFFFF)) class SMBNotifyTests(TestCase): def setUp(self): - super(SMBNotifyTests, self).setUp() + super().setUp() self.server = samba.tests.env_get_var_value("SERVER") # create an SMB connection to the server @@ -73,7 +73,7 @@ class SMBNotifyTests(TestCase): self.smb_conn_unpriv = libsmb.Conn(self.server, self.share, self.lp, creds_unpriv) def tearDown(self): - super(SMBNotifyTests, self).tearDown() + super().tearDown() try: self.smb_conn.deltree(test_dir) except: diff --git a/python/samba/tests/smb.py b/python/samba/tests/smb.py index 61c1719b330..89b0acac618 100644 --- a/python/samba/tests/smb.py +++ b/python/samba/tests/smb.py @@ -39,7 +39,7 @@ test_file = os.path.join(test_dir, 'testing').replace('/', '\\') class SMBTests(samba.tests.TestCase): def setUp(self): - super(SMBTests, self).setUp() + super().setUp() self.server = os.environ["SERVER"] creds = self.insta_creds(template=self.get_credentials()) @@ -51,7 +51,7 @@ class SMBTests(samba.tests.TestCase): self.smb_conn.mkdir(test_dir) def tearDown(self): - super(SMBTests, self).tearDown() + super().tearDown() try: self.smb_conn.deltree(test_dir) except: diff --git a/python/samba/tests/smb3unix.py b/python/samba/tests/smb3unix.py index 6246e81d72a..d88bd432239 100644 --- a/python/samba/tests/smb3unix.py +++ b/python/samba/tests/smb3unix.py @@ -31,7 +31,7 @@ def posix_context(mode): class Smb3UnixTests(samba.tests.libsmb.LibsmbTests): def setUp(self): - super(Smb3UnixTests, self).setUp() + super().setUp() self.samsid = os.environ["SAMSID"] diff --git a/python/samba/tests/smbd_base.py b/python/samba/tests/smbd_base.py index ede1818bf89..b67ba7e5e41 100644 --- a/python/samba/tests/smbd_base.py +++ b/python/samba/tests/smbd_base.py @@ -29,7 +29,7 @@ class SmbdBaseTests(TestCaseInTempDir): return curr_umask def setUp(self): - super(SmbdBaseTests, self).setUp() + super().setUp() self.orig_umask = self.get_umask() # set an arbitrary umask - the underlying smbd code should override @@ -45,4 +45,4 @@ class SmbdBaseTests(TestCaseInTempDir): # restore the original umask value (before we interfered with it) os.umask(self.orig_umask) - super(SmbdBaseTests, self).tearDown() + super().tearDown() diff --git a/python/samba/tests/subunitrun.py b/python/samba/tests/subunitrun.py index 88d68faa65c..26d3300760c 100644 --- a/python/samba/tests/subunitrun.py +++ b/python/samba/tests/subunitrun.py @@ -60,4 +60,4 @@ class TestProgram(BaseTestProgram): if getattr(opts, 'load_list', None): args.insert(0, "--load-list=%s" % opts.load_list) argv = [sys.argv[0]] + args - super(TestProgram, self).__init__(module=module, argv=argv) + super().__init__(module=module, argv=argv) diff --git a/python/samba/tests/upgradeprovision.py b/python/samba/tests/upgradeprovision.py index f1024776186..ba097fa92db 100644 --- a/python/samba/tests/upgradeprovision.py +++ b/python/samba/tests/upgradeprovision.py @@ -123,7 +123,7 @@ class UpgradeProvisionTestCase(TestCaseInTempDir): class UpdateSecretsTests(samba.tests.TestCaseInTempDir): def setUp(self): - super(UpdateSecretsTests, self).setUp() + super().setUp() self.referencedb = create_dummy_secretsdb( os.path.join(self.tempdir, "ref.ldb")) @@ -152,4 +152,4 @@ class UpdateSecretsTests(samba.tests.TestCaseInTempDir): path = os.path.join(self.tempdir, name) if os.path.exists(path): os.unlink(path) - super(UpdateSecretsTests, self).tearDown() + super().tearDown() diff --git a/python/samba/tests/upgradeprovisionneeddc.py b/python/samba/tests/upgradeprovisionneeddc.py index d3f7b19dfd9..432ca2ef55e 100644 --- a/python/samba/tests/upgradeprovisionneeddc.py +++ b/python/samba/tests/upgradeprovisionneeddc.py @@ -76,7 +76,7 @@ class UpgradeProvisionWithLdbTestCase(TestCaseInTempDir): return os.path.join(self.tempdir, "sam.ldb") def setUp(self): - super(UpgradeProvisionWithLdbTestCase, self).setUp() + super().setUp() paths = get_paths(param, None, smb_conf_path) self.creds = Credentials() self.lp = env_loadparm() @@ -178,4 +178,4 @@ class UpgradeProvisionWithLdbTestCase(TestCaseInTempDir): path = os.path.join(self.tempdir, name) if os.path.exists(path): os.unlink(path) - super(UpgradeProvisionWithLdbTestCase, self).tearDown() + super().tearDown()