diff options
author | Greg Hudson <ghudson@mit.edu> | 2013-12-20 11:06:52 -0500 |
---|---|---|
committer | Greg Hudson <ghudson@mit.edu> | 2013-12-20 23:10:03 -0500 |
commit | ae027dd69fc80cca549c9198d10afad389f30873 (patch) | |
tree | 343dc9b63543d39b682296b7ff6ca3d16c9f877c /src/tests/t_ccache.py | |
parent | c25fc42e8eac7350209df61e4a7b9960d17755ca (diff) | |
download | krb5-ae027dd69fc80cca549c9198d10afad389f30873.tar.gz krb5-ae027dd69fc80cca549c9198d10afad389f30873.tar.xz krb5-ae027dd69fc80cca549c9198d10afad389f30873.zip |
Use an extended com_err hook in klist
Add an adapted version of extended_com_err_fn from kinit to klist and
use it. In do_ccache(), rely on the ccache type to set a reasonable
message if krb5_cc_set_flags() or krb5_cc_get_principal() fails due to
a nonexistent or unreadable ccache, and don't confuse the user with
the name of the ccache operation that failed.
ticket: 7809
Diffstat (limited to 'src/tests/t_ccache.py')
-rw-r--r-- | src/tests/t_ccache.py | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/tests/t_ccache.py b/src/tests/t_ccache.py index 15d8141f02..eedd29af8f 100644 --- a/src/tests/t_ccache.py +++ b/src/tests/t_ccache.py @@ -33,7 +33,7 @@ test_keyring = (keyctl is not None and # Test kdestroy and klist of a non-existent ccache. realm.run([kdestroy]) output = realm.run([klist], expected_code=1) -if 'No credentials cache found' not in output: +if ' not found' not in output: fail('Expected error message not seen in klist output') realm.addprinc('alice', password('alice')) @@ -49,7 +49,7 @@ def collection_test(realm, ccname): fail('Initial kinit failed to get credentials for alice.') realm.run([kdestroy]) output = realm.run([klist], expected_code=1) - if 'No credentials cache found' not in output: + if ' not found' not in output: fail('Initial kdestroy failed to destroy primary cache.') output = realm.run([klist, '-l'], expected_code=1) if not output.endswith('---\n') or output.count('\n') != 2: @@ -131,7 +131,7 @@ realm = K5Realm(krb5_conf=conf, create_kdb=False) del realm.env['KRB5CCNAME'] uidstr = str(os.getuid()) out = realm.run([klist], expected_code=1) -if 'FILE:testdir/abc%s' % uidstr not in out: +if 'testdir/abc%s' % uidstr not in out: fail('Wrong ccache in klist') success('Credential cache tests') |