summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGreg Hudson <ghudson@mit.edu>2013-06-16 16:42:00 -0400
committerGreg Hudson <ghudson@mit.edu>2013-06-16 16:42:00 -0400
commit7e6000e2c48460ed2e4bd084d96a6dc21def1231 (patch)
tree14641451bcf87b2dfdd12a5bf05a1501765daf2e
parent0903006d9aef36b58d6ee7dfa5b10771add92279 (diff)
downloadkrb5-7e6000e2c48460ed2e4bd084d96a6dc21def1231.tar.gz
krb5-7e6000e2c48460ed2e4bd084d96a6dc21def1231.tar.xz
krb5-7e6000e2c48460ed2e4bd084d96a6dc21def1231.zip
Fix timing edge cases in t_renew.py
When we are testing maximum renewable lifetimes, the KDC might process the request at a later time than the request time (typically by no more than one second). So we need to ask for a ticket lifetime longer than the maximum renewable lifetime, not equal to it, or we risk getting a just-barely-renewable ticket instead of a non-renewable one. Also fix a couple of typos in comments.
-rw-r--r--src/tests/t_renew.py12
1 files changed, 6 insertions, 6 deletions
diff --git a/src/tests/t_renew.py b/src/tests/t_renew.py
index a5fd0126ef..acfdae6d28 100644
--- a/src/tests/t_renew.py
+++ b/src/tests/t_renew.py
@@ -33,12 +33,12 @@ out = realm.kinit(realm.user_princ, flags=['-R'], expected_code=1)
if "KDC can't fulfill requested option" not in out:
fail('expected error not seen renewing non-renewable ticket')
-# Test that -allow_reneable on the client principal works.
+# Test that -allow_renewable on the client principal works.
realm.run_kadminl('modprinc -allow_renewable user')
test('disallowed client', '1h', '2h', False)
realm.run_kadminl('modprinc +allow_renewable user')
-# Test that -allow_reneable on the server principal works.
+# Test that -allow_renewable on the server principal works.
realm.run_kadminl('modprinc -allow_renewable %s' % realm.krbtgt_princ)
test('disallowed server', '1h', '2h', False)
realm.run_kadminl('modprinc +allow_renewable %s' % realm.krbtgt_princ)
@@ -58,17 +58,17 @@ realm.run_kadminl('modprinc -maxlife "20 hours" user')
# Test maximum renewable life on the client principal.
realm.run_kadminl('modprinc -maxrenewlife "5 hours" user')
test('maxrenewlife client yes', '4h', '5h', True)
-test('maxrenewlife client no', '5h', '10h', False)
+test('maxrenewlife client no', '6h', '10h', False)
# Test maximum renewable life on the server principal.
-realm.run_kadminl('modprinc -maxrenewlife "4 hours" %s' % realm.krbtgt_princ)
-test('maxrenewlife server yes', '3h', '4h', True)
+realm.run_kadminl('modprinc -maxrenewlife "3 hours" %s' % realm.krbtgt_princ)
+test('maxrenewlife server yes', '2h', '3h', True)
test('maxrenewlife server no', '4h', '8h', False)
# Test realm maximum life.
realm.run_kadminl('modprinc -maxrenewlife "40 hours" user')
realm.run_kadminl('modprinc -maxrenewlife "40 hours" %s' % realm.krbtgt_princ)
test('maxrenewlife realm yes', '10h', '20h', True)
-test('maxrenewlife realm no', '20h', '40h', False)
+test('maxrenewlife realm no', '21h', '40h', False)
success('Renewing credentials')