From e8fda61a57fbec996aa05eff8e696057237c7be0 Mon Sep 17 00:00:00 2001 From: Rob van der Linde Date: Tue, 28 Nov 2023 15:59:41 +1300 Subject: [PATCH] python: get rid of pointless empty overridden methods Signed-off-by: Rob van der Linde Reviewed-by: Douglas Bagnall Reviewed-by: Andrew Bartlett --- python/samba/tests/audit_log_pass_change.py | 3 --- python/samba/tests/auth_log.py | 3 --- python/samba/tests/auth_log_ncalrpc.py | 3 --- python/samba/tests/auth_log_pass_change.py | 3 --- python/samba/tests/blackbox/netads_json.py | 3 --- python/samba/tests/blackbox/smbcacls_basic.py | 3 --- .../samba/tests/blackbox/smbcacls_dfs_propagate_inherit.py | 3 --- python/samba/tests/dcerpc/binding.py | 2 -- python/samba/tests/dcerpc/createtrustrelax.py | 2 -- python/samba/tests/dns.py | 3 --- python/samba/tests/dsdb_schema_attributes.py | 3 --- python/samba/tests/glue.py | 3 --- python/samba/tests/gpo.py | 3 --- python/samba/tests/gpo_member.py | 3 --- python/samba/tests/ldap_referrals.py | 3 --- python/samba/tests/net_join.py | 3 --- python/samba/tests/net_join_no_spnego.py | 3 --- python/samba/tests/netbios.py | 3 --- python/samba/tests/netlogonsvc.py | 3 --- python/samba/tests/ntlmdisabled.py | 3 --- python/samba/tests/password_hash_fl2003.py | 3 --- python/samba/tests/password_hash_fl2008.py | 3 --- python/samba/tests/password_hash_gpgme.py | 3 --- python/samba/tests/password_hash_ldap.py | 3 --- python/samba/tests/prefork_restart.py | 3 --- python/samba/tests/process_limits.py | 6 ------ python/samba/tests/s3_net_join.py | 3 --- python/samba/tests/samba_tool/schema.py | 3 --- python/samba/tests/samba_tool/user_virtualCryptSHA.py | 3 --- python/samba/tests/samba_tool/user_virtualCryptSHA_base.py | 3 --- python/samba/tests/samba_tool/visualize_drs.py | 2 -- python/samba/tests/samdb_api.py | 3 --- python/samba/tests/tdb_util.py | 3 --- 33 files changed, 99 deletions(-) diff --git a/python/samba/tests/audit_log_pass_change.py b/python/samba/tests/audit_log_pass_change.py index f7229a670d7..25fe2b5664a 100644 --- a/python/samba/tests/audit_log_pass_change.py +++ b/python/samba/tests/audit_log_pass_change.py @@ -98,9 +98,6 @@ class AuditLogPassChangeTests(AuditLogTestBase): self.waitForMessages(1, dn=dn) self.discardMessages() - def tearDown(self): - super(AuditLogPassChangeTests, self).tearDown() - def test_net_change_password(self): dn = "CN=" + USER_NAME + ",CN=Users," + self.base_dn diff --git a/python/samba/tests/auth_log.py b/python/samba/tests/auth_log.py index 98ab4603f98..41e7767b75c 100755 --- a/python/samba/tests/auth_log.py +++ b/python/samba/tests/auth_log.py @@ -50,9 +50,6 @@ class AuthLogTests(samba.tests.auth_log_base.AuthLogTestBase): super(AuthLogTests, self).setUp() self.remoteAddress = os.environ["CLIENT_IP"] - def tearDown(self): - super(AuthLogTests, self).tearDown() - def smb_connection(self, creds, use_spnego="yes", ntlmv2_auth="yes", force_smb1=False): # the SMB bindings rely on having a s3 loadparm diff --git a/python/samba/tests/auth_log_ncalrpc.py b/python/samba/tests/auth_log_ncalrpc.py index 511e575d9bd..0941a64571b 100644 --- a/python/samba/tests/auth_log_ncalrpc.py +++ b/python/samba/tests/auth_log_ncalrpc.py @@ -35,9 +35,6 @@ class AuthLogTestsNcalrpc(samba.tests.auth_log_base.AuthLogTestBase): super(AuthLogTestsNcalrpc, self).setUp() self.remoteAddress = AS_SYSTEM_MAGIC_PATH_TOKEN - def tearDown(self): - super(AuthLogTestsNcalrpc, self).tearDown() - def _test_rpc_ncaclrpc(self, authTypes, binding, creds, protection, checkFunction): diff --git a/python/samba/tests/auth_log_pass_change.py b/python/samba/tests/auth_log_pass_change.py index b8737effca6..a9dc2b328d4 100644 --- a/python/samba/tests/auth_log_pass_change.py +++ b/python/samba/tests/auth_log_pass_change.py @@ -71,9 +71,6 @@ class AuthLogPassChangeTests(samba.tests.auth_log_base.AuthLogTestBase): def _authDescription(self): return "samr_ChangePasswordUser4" - def tearDown(self): - super(AuthLogPassChangeTests, self).tearDown() - def test_admin_change_password(self): def isLastExpectedMessage(msg): return ((msg["type"] == "Authentication") and diff --git a/python/samba/tests/blackbox/netads_json.py b/python/samba/tests/blackbox/netads_json.py index bcae96259c9..706ec3fba52 100644 --- a/python/samba/tests/blackbox/netads_json.py +++ b/python/samba/tests/blackbox/netads_json.py @@ -35,9 +35,6 @@ class BaseWrapper (object): """Blackbox tests for JSON output of the net ads suite of commands.""" subcmd = None - def setUp(self): - super(BaseWrapper.NetAdsJSONTests_Base, self).setUp() - def test_json_wellformed (self): """The output of ``--json`` commands must parse as JSON.""" argv = "%s %s --json" % (COMMAND, self.subcmd) diff --git a/python/samba/tests/blackbox/smbcacls_basic.py b/python/samba/tests/blackbox/smbcacls_basic.py index 7d313639863..766069255d4 100644 --- a/python/samba/tests/blackbox/smbcacls_basic.py +++ b/python/samba/tests/blackbox/smbcacls_basic.py @@ -20,9 +20,6 @@ from samba.tests import BlackboxProcessError class BasicSmbCaclsTests(SmbCaclsBlockboxTestBase): - def setUp(self): - super(BasicSmbCaclsTests, self).setUp() - def test_simple_single_set(self): """test smbcacls '--set' attempts to overwrite the ACL for the file diff --git a/python/samba/tests/blackbox/smbcacls_dfs_propagate_inherit.py b/python/samba/tests/blackbox/smbcacls_dfs_propagate_inherit.py index bdb00e9dc95..eed96d3ecf4 100644 --- a/python/samba/tests/blackbox/smbcacls_dfs_propagate_inherit.py +++ b/python/samba/tests/blackbox/smbcacls_dfs_propagate_inherit.py @@ -82,6 +82,3 @@ class DfsInheritanceSmbCaclsTests(InheritanceSmbCaclsTests): self.smb_cacls(["--modify", file_acl_str, self.f1]) self.smb_cacls(["--modify", file_acl_str, self.f2]) self.smb_cacls(["--modify", file_acl_str, self.f3]) - - def tearDown(self): - super(DfsInheritanceSmbCaclsTests, self).tearDown() diff --git a/python/samba/tests/dcerpc/binding.py b/python/samba/tests/dcerpc/binding.py index 24e4ac77d89..1ad1f2964c6 100644 --- a/python/samba/tests/dcerpc/binding.py +++ b/python/samba/tests/dcerpc/binding.py @@ -26,8 +26,6 @@ from samba.credentials import Credentials, SMB_ENCRYPTION_REQUIRED, SMB_ENCRYPTI from samba import NTSTATUSError class RpcBindingTests(RpcInterfaceTestCase): - def setUp(self): - super(RpcBindingTests, self).setUp() def get_user_creds(self): c = Credentials() diff --git a/python/samba/tests/dcerpc/createtrustrelax.py b/python/samba/tests/dcerpc/createtrustrelax.py index 48beb0f9680..5dcb9374bce 100644 --- a/python/samba/tests/dcerpc/createtrustrelax.py +++ b/python/samba/tests/dcerpc/createtrustrelax.py @@ -27,8 +27,6 @@ from samba.credentials import Credentials, SMB_ENCRYPTION_REQUIRED, SMB_ENCRYPTI from samba.trust_utils import CreateTrustedDomainRelax class CreateTrustedDomainRelaxTest(TestCase): - def setUp(self): - super(CreateTrustedDomainRelaxTest, self).setUp() def get_user_creds(self): c = Credentials() diff --git a/python/samba/tests/dns.py b/python/samba/tests/dns.py index 62929289b08..8888790378d 100644 --- a/python/samba/tests/dns.py +++ b/python/samba/tests/dns.py @@ -1772,9 +1772,6 @@ class TestRPCRoundtrip(DNSTest): self.lp, self.creds) - def tearDown(self): - super(TestRPCRoundtrip, self).tearDown() - def rpc_update(self, fqn=None, data=None, wType=None, delete=False): fqn = fqn or ("rpctestrec." + self.get_dns_domain()) diff --git a/python/samba/tests/dsdb_schema_attributes.py b/python/samba/tests/dsdb_schema_attributes.py index d9b538d4af4..37b44c6d3ad 100644 --- a/python/samba/tests/dsdb_schema_attributes.py +++ b/python/samba/tests/dsdb_schema_attributes.py @@ -46,9 +46,6 @@ class SchemaAttributesTestCase(samba.tests.TestCase): self.base_dn = res[0]["defaultNamingContext"][0] self.forest_level = int(res[0]["forestFunctionality"][0]) - def tearDown(self): - super(SchemaAttributesTestCase, self).tearDown() - def _ldap_schemaUpdateNow(self): ldif = """ dn: diff --git a/python/samba/tests/glue.py b/python/samba/tests/glue.py index e5d76c5a02a..ac504b3f366 100644 --- a/python/samba/tests/glue.py +++ b/python/samba/tests/glue.py @@ -24,9 +24,6 @@ import samba.tests class GlueTests(samba.tests.TestCase): - def setUp(self): - super(GlueTests, self).setUp() - def test_generate_random_str(self): string = _glue.generate_random_str(10) self.assertEqual(type(string), str) diff --git a/python/samba/tests/gpo.py b/python/samba/tests/gpo.py index f85780685d6..86ffdf26a28 100644 --- a/python/samba/tests/gpo.py +++ b/python/samba/tests/gpo.py @@ -5098,9 +5098,6 @@ class GPOTests(tests.TestCase): self.lp.load_default() self.creds = self.insta_creds(template=self.get_credentials()) - def tearDown(self): - super(GPOTests, self).tearDown() - def test_gpo_list(self): global poldir, dspath gpos = get_gpo_list(self.server, self.creds, self.lp, diff --git a/python/samba/tests/gpo_member.py b/python/samba/tests/gpo_member.py index 1b8779b1ace..047471f0e28 100644 --- a/python/samba/tests/gpo_member.py +++ b/python/samba/tests/gpo_member.py @@ -29,9 +29,6 @@ class GPOTests(tests.TestCase): self.lp.load_default() self.creds = self.insta_creds(template=self.get_credentials()) - def tearDown(self): - super(GPOTests, self).tearDown() - def test_sec_ext_load_on_member(self): cache_dir = self.lp.get('cache directory') store = GPOStorage(os.path.join(cache_dir, 'gpo.tdb')) diff --git a/python/samba/tests/ldap_referrals.py b/python/samba/tests/ldap_referrals.py index eade5ef6682..406b1965fdd 100644 --- a/python/samba/tests/ldap_referrals.py +++ b/python/samba/tests/ldap_referrals.py @@ -48,9 +48,6 @@ creds = credopts.get_credentials(lp) class LdapReferralTest(samba.tests.TestCase): - def setUp(self): - super(LdapReferralTest, self).setUp() - # The referral entries for an ldap request should have the ldap scheme # i.e. then should all start with "ldap://" def test_ldap_search(self): diff --git a/python/samba/tests/net_join.py b/python/samba/tests/net_join.py index 640e96d56f5..20f0e57e874 100644 --- a/python/samba/tests/net_join.py +++ b/python/samba/tests/net_join.py @@ -39,9 +39,6 @@ class NetJoinTests(samba.tests.TestCaseInTempDir): self.lp.set("lock dir", self.tempdir) self.lp.set("state directory", self.tempdir) - def tearDown(self): - super(NetJoinTests, self).tearDown() - def test_net_join(self): netbios_name = "NetJoinTest" machinepass = "abcdefghij" diff --git a/python/samba/tests/net_join_no_spnego.py b/python/samba/tests/net_join_no_spnego.py index 70a9007324f..747f3c55b99 100644 --- a/python/samba/tests/net_join_no_spnego.py +++ b/python/samba/tests/net_join_no_spnego.py @@ -39,9 +39,6 @@ class NetJoinNoSpnegoTests(samba.tests.TestCaseInTempDir): self.lp.set("lock dir", self.tempdir) self.lp.set("state directory", self.tempdir) - def tearDown(self): - super(NetJoinNoSpnegoTests, self).tearDown() - def test_net_join_no_spnego(self): self.lp.set("client ipc max protocol", "NT1") self.lp.set("client use spnego", "no") diff --git a/python/samba/tests/netbios.py b/python/samba/tests/netbios.py index f28b789bab7..9a0807215a3 100644 --- a/python/samba/tests/netbios.py +++ b/python/samba/tests/netbios.py @@ -27,9 +27,6 @@ class NetBiosTests(samba.tests.TestCase): self.ifc = os.environ["SERVER_IP"] self.dc = os.environ["DC_NETBIOSNAME"] - def tearDown(self): - super(NetBiosTests, self).tearDown() - def test_query_name(self): (reply_from, names, addresses) = self.n.query_name(self.dc, self.ifc, timeout=4) assert reply_from == self.ifc diff --git a/python/samba/tests/netlogonsvc.py b/python/samba/tests/netlogonsvc.py index 86ac22de5a3..70efd6d2b06 100644 --- a/python/samba/tests/netlogonsvc.py +++ b/python/samba/tests/netlogonsvc.py @@ -47,9 +47,6 @@ class NetlogonServiceTests(TestCase): self.creds.guess(self.lp) - def tearDown(self): - super(NetlogonServiceTests, self).tearDown() - def test_have_netlogon_connection(self): try: c = self.get_netlogon_connection() diff --git a/python/samba/tests/ntlmdisabled.py b/python/samba/tests/ntlmdisabled.py index 523ff792a7a..0365694cab0 100644 --- a/python/samba/tests/ntlmdisabled.py +++ b/python/samba/tests/ntlmdisabled.py @@ -46,9 +46,6 @@ class NtlmDisabledTests(TestCase): self.creds.set_password(os.getenv("PASSWORD")) self.creds.set_kerberos_state(DONT_USE_KERBEROS) - def tearDown(self): - super(NtlmDisabledTests, self).tearDown() - def test_ntlm_connection(self): try: conn = srvsvc.srvsvc("ncacn_np:%s[smb2,ntlm]" % self.server, self.lp, self.creds) diff --git a/python/samba/tests/password_hash_fl2003.py b/python/samba/tests/password_hash_fl2003.py index c412a0676e6..ff9b237b844 100644 --- a/python/samba/tests/password_hash_fl2003.py +++ b/python/samba/tests/password_hash_fl2003.py @@ -38,9 +38,6 @@ import binascii class PassWordHashFl2003Tests(PassWordHashTests): - def setUp(self): - super(PassWordHashFl2003Tests, self).setUp() - def test_default_supplementalCredentials(self): self.add_user(options=[("password hash userPassword schemes", "")]) diff --git a/python/samba/tests/password_hash_fl2008.py b/python/samba/tests/password_hash_fl2008.py index a43ac3f815b..c1ceeb7b36d 100644 --- a/python/samba/tests/password_hash_fl2008.py +++ b/python/samba/tests/password_hash_fl2008.py @@ -37,9 +37,6 @@ import binascii class PassWordHashFl2008Tests(PassWordHashTests): - def setUp(self): - super(PassWordHashFl2008Tests, self).setUp() - def test_default_supplementalCredentials(self): self.add_user() diff --git a/python/samba/tests/password_hash_gpgme.py b/python/samba/tests/password_hash_gpgme.py index 16247bc3451..9c0a511e1b6 100644 --- a/python/samba/tests/password_hash_gpgme.py +++ b/python/samba/tests/password_hash_gpgme.py @@ -40,9 +40,6 @@ import samba class PassWordHashGpgmeTests(PassWordHashTests): - def setUp(self): - super(PassWordHashGpgmeTests, self).setUp() - def test_default_supplementalCredentials(self): self.add_user() if not self.lp.get("password hash gpg key ids"): diff --git a/python/samba/tests/password_hash_ldap.py b/python/samba/tests/password_hash_ldap.py index 7e685dd2c05..2657e759ec4 100644 --- a/python/samba/tests/password_hash_ldap.py +++ b/python/samba/tests/password_hash_ldap.py @@ -55,9 +55,6 @@ def attid_equal(a1, a2): class PassWordHashLDAPTests(PassWordHashTests): - def setUp(self): - super(PassWordHashLDAPTests, self).setUp() - # Get the supplemental credentials for the user under test def get_supplemental_creds_drs(self): binding_str = "ncacn_ip_tcp:%s[seal]" % os.environ["SERVER"] diff --git a/python/samba/tests/prefork_restart.py b/python/samba/tests/prefork_restart.py index 9e35bd68a17..ef601dd5d7d 100644 --- a/python/samba/tests/prefork_restart.py +++ b/python/samba/tests/prefork_restart.py @@ -49,9 +49,6 @@ class PreforkProcessRestartTests(TestCase): lp_ctx = self.get_loadparm() self.msg_ctx = Messaging(lp_ctx=lp_ctx) - def tearDown(self): - super(PreforkProcessRestartTests, self).tearDown() - def get_process_data(self): services = self.msg_ctx.irpc_all_servers() diff --git a/python/samba/tests/process_limits.py b/python/samba/tests/process_limits.py index b1997acad67..e9800053b87 100644 --- a/python/samba/tests/process_limits.py +++ b/python/samba/tests/process_limits.py @@ -30,12 +30,6 @@ from ldb import LdbError, ERR_OPERATIONS_ERROR class StandardModelProcessLimitTests(TestCase): - def setUp(self): - super(StandardModelProcessLimitTests, self).setUp() - - def tearDown(self): - super(StandardModelProcessLimitTests, self).tearDown() - def simple_bind(self): creds = self.insta_creds(template=self.get_credentials()) creds.set_bind_dn("%s\\%s" % (creds.get_domain(), diff --git a/python/samba/tests/s3_net_join.py b/python/samba/tests/s3_net_join.py index cdb414c75dc..2150e4e25b7 100644 --- a/python/samba/tests/s3_net_join.py +++ b/python/samba/tests/s3_net_join.py @@ -45,9 +45,6 @@ class NetS3JoinTests(samba.tests.TestCaseInTempDir): self.server = os.environ["SERVER"] self.lp = self.get_loadparm() - def tearDown(self): - super(NetS3JoinTests, self).tearDown() - def test_net_join(self): netbios_name = "S3NetJoinTest" machinepass = "abcdefghij" diff --git a/python/samba/tests/samba_tool/schema.py b/python/samba/tests/samba_tool/schema.py index 6f899ef4b68..31f71559b92 100644 --- a/python/samba/tests/samba_tool/schema.py +++ b/python/samba/tests/samba_tool/schema.py @@ -29,9 +29,6 @@ class SchemaCmdTestCase(SambaToolCmdTest): self.samdb = self.getSamDB("-H", "ldap://%s" % os.environ["DC_SERVER"], "-U%s%%%s" % (os.environ["DC_USERNAME"], os.environ["DC_PASSWORD"])) - def tearDown(self): - super(SchemaCmdTestCase, self).tearDown() - def test_display_attribute(self): """Tests that we can display schema attributes""" (result, out, err) = self.runsublevelcmd("schema", ("attribute", diff --git a/python/samba/tests/samba_tool/user_virtualCryptSHA.py b/python/samba/tests/samba_tool/user_virtualCryptSHA.py index 7b8e0cea2c5..1a757e3816b 100644 --- a/python/samba/tests/samba_tool/user_virtualCryptSHA.py +++ b/python/samba/tests/samba_tool/user_virtualCryptSHA.py @@ -55,9 +55,6 @@ class UserCmdCryptShaTestCase(SambaToolCmdTest): users = [] samdb = None - def setUp(self): - super(UserCmdCryptShaTestCase, self).setUp() - def add_user(self, hashes=""): self.lp = samba.tests.env_loadparm() diff --git a/python/samba/tests/samba_tool/user_virtualCryptSHA_base.py b/python/samba/tests/samba_tool/user_virtualCryptSHA_base.py index d4897ec5a52..7eb91db5e32 100644 --- a/python/samba/tests/samba_tool/user_virtualCryptSHA_base.py +++ b/python/samba/tests/samba_tool/user_virtualCryptSHA_base.py @@ -55,9 +55,6 @@ class UserCmdCryptShaTestCase(SambaToolCmdTest): users = [] samdb = None - def setUp(self): - super(UserCmdCryptShaTestCase, self).setUp() - def add_user(self, hashes=""): self.lp = samba.tests.env_loadparm() diff --git a/python/samba/tests/samba_tool/visualize_drs.py b/python/samba/tests/samba_tool/visualize_drs.py index 9a2ca25039b..64b2cdbe740 100644 --- a/python/samba/tests/samba_tool/visualize_drs.py +++ b/python/samba/tests/samba_tool/visualize_drs.py @@ -107,8 +107,6 @@ def get_utf8_matrix(s): class SambaToolVisualizeDrsTest(SambaToolCmdTest): - def setUp(self): - super(SambaToolVisualizeDrsTest, self).setUp() def test_ntdsconn(self): server = "ldap://%s" % os.environ["SERVER"] diff --git a/python/samba/tests/samdb_api.py b/python/samba/tests/samdb_api.py index a653ca089a2..49e39a9546a 100644 --- a/python/samba/tests/samdb_api.py +++ b/python/samba/tests/samdb_api.py @@ -24,9 +24,6 @@ import errno class SamDBApiTestCase(TestCaseInTempDir): - def setUp(self): - super(SamDBApiTestCase, self).setUp() - def tearDown(self): self.rm_files("test.db", "existing.db", allow_missing=True) diff --git a/python/samba/tests/tdb_util.py b/python/samba/tests/tdb_util.py index 93c83a87910..e8e5d727245 100644 --- a/python/samba/tests/tdb_util.py +++ b/python/samba/tests/tdb_util.py @@ -23,9 +23,6 @@ import os class TDBUtilTests(samba.tests.TestCaseInTempDir): - def setUp(self): - super(TDBUtilTests, self).setUp() - def test_tdb_copy(self): src_ldb_file = os.path.join(self.tempdir, "source.ldb") dst_ldb_file = os.path.join(self.tempdir, "destination.ldb")