[30034] in CVS-changelog-for-Kerberos-V5

home help back first fref pref prev next nref lref last post

krb5 commit: Allow small errors in t_renew.py tests

daemon@ATHENA.MIT.EDU (Greg Hudson)
Wed Sep 6 16:57:09 2017

Date: Wed, 6 Sep 2017 16:57:04 -0400
From: Greg Hudson <ghudson@mit.edu>
Message-Id: <201709062057.v86Kv40B007465@drugstore.mit.edu>
To: cvs-krb5@mit.edu
Reply-To: krbdev@mit.edu
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Errors-To: cvs-krb5-bounces@mit.edu

https://github.com/krb5/krb5/commit/4cfb64e362443be36a4cb92fb8f5d1d93280fb3f
commit 4cfb64e362443be36a4cb92fb8f5d1d93280fb3f
Author: Greg Hudson <ghudson@mit.edu>
Date:   Thu Aug 31 14:11:43 2017 -0400

    Allow small errors in t_renew.py tests
    
    ticket: 8609

 src/tests/t_renew.py |    8 +++++---
 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.
_______________________________________________
cvs-krb5 mailing list
cvs-krb5@mit.edu
https://mailman.mit.edu/mailman/listinfo/cvs-krb5

home help back first fref pref prev next nref lref last post