selftest: Avoid a build started around midnight failing (again)
authorAndrew Bartlett <abartlet@samba.org>
Tue, 13 Feb 2018 22:29:54 +0000 (11:29 +1300)
committerAndrew Bartlett <abartlet@samba.org>
Wed, 14 Feb 2018 23:18:29 +0000 (00:18 +0100)
This case most likely relates to Daylight Saving changes creating
a 23 hour day.

Signed-off-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
python/samba/tests/pam_winbind_warn_pwd_expire.py

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