diff options
| author | Andrew Bartlett <abartlet@samba.org> | 2024-05-17 12:17:40 +1200 |
|---|---|---|
| committer | Andrew Bartlett <abartlet@samba.org> | 2024-06-10 04:27:30 +0000 |
| commit | 044cc5386058e61cf2ec6842010dfb41e50495d1 (patch) | |
| tree | 404d6bb826908c12f9770de666517031c9e08d9e /python | |
| parent | 68fa90754fd0cee62af636ce37c212da07cd8c46 (diff) | |
| download | samba-044cc5386058e61cf2ec6842010dfb41e50495d1.tar.gz samba-044cc5386058e61cf2ec6842010dfb41e50495d1.tar.bz2 samba-044cc5386058e61cf2ec6842010dfb41e50495d1.zip | |
python/test/krb5: Use assertAlmostEqual in check_ticket_times()
This allows Windows behaviour with clock skew to be allowed for.
Signed-off-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Jo Sutton <josutton@catalyst.net.nz>
Diffstat (limited to 'python')
| -rw-r--r-- | python/samba/tests/krb5/kdc_base_test.py | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/python/samba/tests/krb5/kdc_base_test.py b/python/samba/tests/krb5/kdc_base_test.py index a12acad7060..eb3497c554e 100644 --- a/python/samba/tests/krb5/kdc_base_test.py +++ b/python/samba/tests/krb5/kdc_base_test.py @@ -3789,7 +3789,8 @@ class KDCBaseTest(TestCaseInTempDir, RawKerberosTest): def check_ticket_times(self, ticket_creds, expected_life=None, - expected_renew_life=None): + expected_renew_life=None, + delta=0): ticket = ticket_creds.ticket_private authtime = ticket['authtime'] @@ -3804,7 +3805,7 @@ class KDCBaseTest(TestCaseInTempDir, RawKerberosTest): endtime.decode('ascii')) actual_lifetime = actual_end - starttime - self.assertEqual(expected_life, actual_lifetime) + self.assertAlmostEqual(expected_life, actual_lifetime, delta=delta) if renew_till is None: self.assertIsNone(expected_renew_life) @@ -3814,4 +3815,4 @@ class KDCBaseTest(TestCaseInTempDir, RawKerberosTest): renew_till.decode('ascii')) actual_renew_life = actual_renew_till - starttime - self.assertEqual(expected_renew_life, actual_renew_life) + self.assertAlmostEqual(expected_renew_life, actual_renew_life, delta=delta) |
