[30872] in CVS-changelog-for-Kerberos-V5
krb5 commit: Avoid daylight savings time issues in tests
daemon@ATHENA.MIT.EDU (Greg Hudson)
Tue Nov 3 10:22:47 2020
Date: Tue, 3 Nov 2020 10:22:24 -0500
From: Greg Hudson <ghudson@mit.edu>
Message-ID: <202011031522.0A3FMOEo017731@drugstore.mit.edu>
To: <cvs-krb5@mit.edu>
MIME-Version: 1.0
Reply-To: krbdev@mit.edu
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Errors-To: cvs-krb5-bounces@mit.edu
https://github.com/krb5/krb5/commit/34ba67714db6079021c66a2bbd398dd23968d438
commit 34ba67714db6079021c66a2bbd398dd23968d438
Author: Greg Hudson <ghudson@mit.edu>
Date: Sun Nov 1 00:35:05 2020 -0400
Avoid daylight savings time issues in tests
src/tests/t_kdcpolicy.py | 4 ++++
src/tests/t_renew.py | 4 ++++
2 files changed, 8 insertions(+), 0 deletions(-)
diff --git a/src/tests/t_kdcpolicy.py b/src/tests/t_kdcpolicy.py
index a44adfd..9241333 100644
--- a/src/tests/t_kdcpolicy.py
+++ b/src/tests/t_kdcpolicy.py
@@ -12,6 +12,10 @@ kdc_conf = {'realms': {'$realm': {'default_principal_flags': '+preauth',
'max_renewable_life': '1d'}}}
realm = K5Realm(krb5_conf=krb5_conf, kdc_conf=kdc_conf)
+# We will be scraping timestamps from klist to compute lifetimes, so
+# use a time zone with no daylight savings time.
+realm.env['TZ'] = 'UTC'
+
realm.run([kadminl, 'addprinc', '-pw', password('fail'), 'fail'])
def verify_time(out, target_time):
diff --git a/src/tests/t_renew.py b/src/tests/t_renew.py
index 1630345..9f22bab 100755
--- a/src/tests/t_renew.py
+++ b/src/tests/t_renew.py
@@ -5,6 +5,10 @@ import re
conf = {'realms': {'$realm': {'max_life': '20h', 'max_renewable_life': '20h'}}}
realm = K5Realm(create_host=False, get_creds=False, kdc_conf=conf)
+# We will be scraping timestamps from klist to compute lifetimes, so
+# use a time zone with no daylight savings time.
+realm.env['TZ'] = 'UTC'
+
def test(testname, life, rlife, exp_life, exp_rlife, env=None):
global realm
flags = ['-l', life]
_______________________________________________
cvs-krb5 mailing list
cvs-krb5@mit.edu
https://mailman.mit.edu/mailman/listinfo/cvs-krb5