mirror of
https://github.com/samba-team/samba.git
synced 2024-12-23 17:34:34 +03:00
selftest: close connections after tests in samba4.ldap.rodc_rwdc.python
This test suite had a memory impact of around 2.5GB, from built-up LDAP connection handlers under the standard process model. Signed-off-by: Jamie McClymont <jamiemcclymont@catalyst.net.nz> Reviewed-by: Andrew Bartlett <abartlet@samba.org> Reviewed-by: Garming Sam <garming@catalyst.net.nz> Autobuild-User(master): Andrew Bartlett <abartlet@samba.org> Autobuild-Date(master): Tue Jan 9 08:22:27 CET 2018 on sn-devel-144
This commit is contained in:
parent
c5fb65121d
commit
7901f7c3ba
@ -351,6 +351,8 @@ lockoutThreshold: """ + str(lockoutThreshold) + """
|
||||
self.samr_handle = self.samr.Connect2(None, security.SEC_FLAG_MAXIMUM_ALLOWED)
|
||||
self.samr_domain = self.samr.OpenDomain(self.samr_handle, security.SEC_FLAG_MAXIMUM_ALLOWED, self.domain_sid)
|
||||
|
||||
self.addCleanup(self.delete_ldb_connections)
|
||||
|
||||
# (Re)adds the test user accounts
|
||||
self.lockout1krb5_creds = self.insta_creds(self.template_creds,
|
||||
username="lockout1krb5",
|
||||
@ -363,6 +365,11 @@ lockoutThreshold: """ + str(lockoutThreshold) + """
|
||||
kerberos_state=DONT_USE_KERBEROS)
|
||||
self.lockout1ntlm_ldb = self._readd_user(self.lockout1ntlm_creds)
|
||||
|
||||
def delete_ldb_connections(self):
|
||||
del self.lockout1krb5_ldb
|
||||
del self.lockout1ntlm_ldb
|
||||
del self.ldb
|
||||
|
||||
def tearDown(self):
|
||||
super(BasePasswordTestCase, self).tearDown()
|
||||
|
||||
|
@ -224,6 +224,11 @@ class RodcRwdcCachedTests(password_lockout_base.BasePasswordTestCase):
|
||||
# make sure DCs are synchronized before the test
|
||||
self.force_replication()
|
||||
|
||||
def delete_ldb_connections(self):
|
||||
super(RodcRwdcCachedTests, self).delete_ldb_connections()
|
||||
del self.rwdc_db
|
||||
del self.rodc_db
|
||||
|
||||
def test_cache_and_flush_password(self):
|
||||
username = self.lockout1krb5_creds.get_username()
|
||||
userpass = self.lockout1krb5_creds.get_password()
|
||||
@ -767,6 +772,11 @@ class RodcRwdcTests(password_lockout_base.BasePasswordTestCase):
|
||||
self.rwdc_dn = get_server_ref_from_samdb(self.rwdc_db)
|
||||
self.rodc_dn = get_server_ref_from_samdb(self.rodc_db)
|
||||
|
||||
def delete_ldb_connections(self):
|
||||
super(RodcRwdcTests, self).delete_ldb_connections()
|
||||
del self.rwdc_db
|
||||
del self.rodc_db
|
||||
|
||||
def assertReferral(self, fn, *args, **kwargs):
|
||||
try:
|
||||
fn(*args, **kwargs)
|
||||
|
Loading…
Reference in New Issue
Block a user