From da4e419adf50080e3a1f4f5bbcb462fcf7133fa1 Mon Sep 17 00:00:00 2001 From: Stefan Metzmacher Date: Fri, 5 Feb 2016 08:37:53 +0100 Subject: [PATCH] s4:dsdb/tests: let password_lockout.py make use of self.addCleanup() to cleanup objects This is easier than doing it by hand... Signed-off-by: Stefan Metzmacher Reviewed-by: Andrew Bartlett --- source4/dsdb/tests/python/password_lockout.py | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/source4/dsdb/tests/python/password_lockout.py b/source4/dsdb/tests/python/password_lockout.py index f76843844bf..a71c70b1115 100755 --- a/source4/dsdb/tests/python/password_lockout.py +++ b/source4/dsdb/tests/python/password_lockout.py @@ -289,6 +289,8 @@ userAccountControl: %d "objectclass": "user", "sAMAccountName": username}) + self.addCleanup(delete_force, self.ldb, userdn) + res = self._check_account(userdn, badPwdCount=0, badPasswordTime=0, @@ -1635,11 +1637,6 @@ unicodePwd:: """ + base64.b64encode("\"thatsAcomplPASS2\"".encode('utf-16-le')) def tearDown(self): super(PasswordTests, self).tearDown() - delete_force(self.ldb, "cn=testuser,cn=users," + self.base_dn) - delete_force(self.ldb, "cn=testuser2,cn=users," + self.base_dn) - delete_force(self.ldb, "cn=testuser3,cn=users," + self.base_dn) - # Close the second LDB connection (with the user credentials) - self.ldb2 = None host_url = "ldap://%s" % host -- 2.47.3