aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGreg Hudson <ghudson@mit.edu>2017-08-31 14:11:43 -0400
committerGreg Hudson <ghudson@mit.edu>2017-09-06 16:40:19 -0400
commit4cfb64e362443be36a4cb92fb8f5d1d93280fb3f (patch)
tree576232d591a98a0405e237c4e51c8a7f938d6d46
parent626279c8c77e2af8bab4d145eb63e9c9947fb6e3 (diff)
downloadkrb5-4cfb64e362443be36a4cb92fb8f5d1d93280fb3f.zip
krb5-4cfb64e362443be36a4cb92fb8f5d1d93280fb3f.tar.gz
krb5-4cfb64e362443be36a4cb92fb8f5d1d93280fb3f.tar.bz2
Allow small errors in t_renew.py tests
ticket: 8609
-rwxr-xr-xsrc/tests/t_renew.py8
1 files changed, 5 insertions, 3 deletions
diff --git a/src/tests/t_renew.py b/src/tests/t_renew.py
index aa58ece..034190c 100755
--- a/src/tests/t_renew.py
+++ b/src/tests/t_renew.py
@@ -31,9 +31,11 @@ def test(testname, life, rlife, exp_life, exp_rlife, env=None):
endtime = times[1]
rtime = times[2] if len(times) >= 3 else None
- # Check the ticket lifetime against expectations.
+ # Check the ticket lifetime against expectations. If the lifetime
+ # was determined by the request, there may be a small error
+ # because KDC requests contain an end time rather than a lifetime.
life = (endtime - starttime).seconds
- if life != exp_life:
+ if abs(life - exp_life) > 5:
fail('%s: expected life %d, got %d' % (testname, exp_life, life))
# Check the ticket renewable lifetime against expectations.
@@ -43,7 +45,7 @@ def test(testname, life, rlife, exp_life, exp_rlife, env=None):
fail('%s: ticket is renewable but has no renew_till' % testname)
if rtime is not None:
rlife = (rtime - starttime).seconds
- if rlife != exp_rlife:
+ if abs(rlife - exp_rlife) > 5:
fail('%s: expected rlife %d, got %d' (testname, exp_rlife, rlife))
# Get renewable tickets.