From: Tim Beale Date: Sun, 17 Jun 2018 21:03:40 +0000 (+1200) Subject: tests: Increase minPwdAge used for PSO tests X-Git-Tag: tevent-0.9.37~261 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=016fc48a30900237205cb60ac9ed5d81c4737cbe;p=thirdparty%2Fsamba.git tests: Increase minPwdAge used for PSO tests The PSO minPwdAge test was using a 1 second timeout. While this seemed to work fine most of the time, we did see a rackspace failure that was presumably due to the test taking longer than 1-second to execute (which resulted in the password not being correctly rejected). This patch increases the minPwdAge used, to try to avoid this problem happening. Signed-off-by: Tim Beale Reviewed-by: Andreas Schneider Reviewed-by: Andrew Bartlett --- diff --git a/source4/dsdb/tests/python/password_settings.py b/source4/dsdb/tests/python/password_settings.py index d072a8fa165..12779a033c6 100644 --- a/source4/dsdb/tests/python/password_settings.py +++ b/source4/dsdb/tests/python/password_settings.py @@ -451,7 +451,7 @@ class PasswordSettingsTestCase(PasswordTestCase): def test_pso_min_age(self): """Tests that a PSO's min-age is enforced""" pso = PasswordSettings("min-age-PSO", self.ldb, password_len=10, - password_age_min=1, complexity=False) + password_age_min=2, complexity=False) self.add_obj_cleanup([pso.dn]) # create a user and apply the PSO @@ -462,8 +462,8 @@ class PasswordSettingsTestCase(PasswordTestCase): # changing the password immediately should fail, even if password is valid valid_password = "min-age-passwd" self.assert_password_invalid(user, valid_password) - # then trying the same password later (min-age=1sec) should succeed - time.sleep(1.5) + # then trying the same password later should succeed + time.sleep(pso.password_age_min + 0.5) self.assert_password_valid(user, valid_password) def test_pso_max_age(self):