]> git.ipfire.org Git - thirdparty/krb5.git/commitdiff
Fix KDC race in t_unlockiter.py
authorTom Yu <tlyu@mit.edu>
Wed, 6 Aug 2014 19:03:03 +0000 (15:03 -0400)
committerTom Yu <tlyu@mit.edu>
Wed, 6 Aug 2014 19:37:18 +0000 (15:37 -0400)
The second KDC startup in t_unlockiter.py could race with the
garbage-collected shutdown of the first, causing the second one to
fail to bind the listening port.  Avoid the situation by setting
start_kdc=False, because there doesn't need to be a KDC running for
these tests anyway.  Also use create_user=False and create_host=False,
because those principals aren't necessary either.

ticket: 7977

src/tests/t_unlockiter.py

index d4ca4c5a6c24080316c8a7d8899f12d9deec6237..2a438e99ab00b79afaa7eaa3a589005b2672f610 100644 (file)
@@ -3,14 +3,15 @@ from k5test import *
 
 # Default KDB iteration is locked.  Expect write lock failure unless
 # unlocked iteration is explicitly requested.
-realm = K5Realm()
+realm = K5Realm(create_user=False, create_host=False, start_kdc=False)
 realm.run(['./unlockiter'], expected_code=1)
 realm.run(['./unlockiter', '-u'])
 realm.run(['./unlockiter', '-l'], expected_code=1)
 
 # Set default to unlocked iteration.  Only explicitly requested locked
 # iteration should block the write lock.
-realm = K5Realm(krb5_conf={'dbmodules': {'db': {'unlockiter': 'true'}}})
+realm = K5Realm(create_user=False, create_host=False, start_kdc=False,
+                krb5_conf={'dbmodules': {'db': {'unlockiter': 'true'}}})
 realm.run(['./unlockiter'])
 realm.run(['./unlockiter', '-u'])
 realm.run(['./unlockiter', '-l'], expected_code=1)