Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Test the inconsistent locking fix and svc unavail
Test the fix for https://bugzilla.redhat.com/show_bug.cgi?id=586032 . Also test that krb5kdc can return svc unavailable
- Loading branch information
1 parent
29ee39b
commit b2e7deb
Showing
2 changed files
with
40 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
#!/usr/bin/python | ||
|
||
# This is a regression test for | ||
# https://bugzilla.redhat.com/show_bug.cgi?id=586032 . | ||
# | ||
# We start a KDC, remove the kadm5 lock file, use the KDC, re-create the | ||
# kadm5 lock file, and use kadmin.local. The kinit should fail, and the | ||
# kadmin.local should succeed. | ||
|
||
|
||
import os | ||
|
||
from k5test import * | ||
|
||
kdc_conf = { | ||
'all' : { 'libdefaults' : { 'default_realm' : 'KRBTEST.COM'}} | ||
} | ||
|
||
p = 'foo' | ||
realm = K5Realm(kdc_conf=kdc_conf, create_user=False) | ||
realm.addprinc(p, p) | ||
|
||
kadm5_lock = os.path.join(realm.testdir, 'master-db.kadm5.lock') | ||
if not os.path.exists(kadm5_lock): | ||
fail('kadm5 lock file not created: ' + kadm5_lock) | ||
os.unlink(kadm5_lock) | ||
|
||
output = realm.kinit(p, p, [], expected_code=1) | ||
if 'A service is not available' not in output: | ||
fail('krb5kdc should have returned service not available error') | ||
|
||
f = open(kadm5_lock, 'w') | ||
f.close() | ||
|
||
output = realm.run_kadminl('modprinc -allow_tix ' + p) | ||
if 'Cannot lock database' in output: | ||
fail('krb5kdc still holds a lock on the principal db') | ||
|
||
success('KDB locking tests') |