1
0
mirror of https://github.com/samba-team/samba.git synced 2025-01-11 05:18:09 +03:00

selftest: Avoid a build started just before midnight failing

By allowing 41 or 42 days, we still test the expiry but are less sensitive to the
current time.

Signed-off-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
This commit is contained in:
Andrew Bartlett 2017-09-02 14:07:11 +12:00
parent 1e4c32e3ff
commit 070f24bc9d

View File

@ -36,6 +36,9 @@ class PasswordExpirePamTests(samba.tests.TestCase):
if warn_pwd_expire == 0:
self.assertTrue(res.info == ())
elif warn_pwd_expire == 50:
self.assertEqual(res.info[0], u"Your password will expire in 42 days.\n")
# This is needed as otherwise a build started just before
# midnight can fail
if (res.info[0] != u"Your password will expire in 41 days"):
self.assertEqual(res.info[0], u"Your password will expire in 42 days.\n")
else:
self.assertEqual(warn_pwd_expire, 0)