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 | |
parent | c25fc42e8eac7350209df61e4a7b9960d17755ca (diff) | |
download | krb5-ae027dd69fc80cca549c9198d10afad389f30873.zip krb5-ae027dd69fc80cca549c9198d10afad389f30873.tar.gz krb5-ae027dd69fc80cca549c9198d10afad389f30873.tar.bz2 |
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')
-rw-r--r-- | src/tests/dejagnu/config/default.exp | 2 | ||||
-rw-r--r-- | src/tests/gssapi/t_client_keytab.py | 2 | ||||
-rw-r--r-- | src/tests/t_ccache.py | 6 |
3 files changed, 5 insertions, 5 deletions
diff --git a/src/tests/dejagnu/config/default.exp b/src/tests/dejagnu/config/default.exp index bd45ece..5d4bcfc 100644 --- a/src/tests/dejagnu/config/default.exp +++ b/src/tests/dejagnu/config/default.exp @@ -2205,7 +2205,7 @@ proc do_klist_err { testname } { spawn $KLIST -5 # Might say "credentials cache" or "credentials cache file". expect { - -re "klist: No credentials cache.*found.*\r\n" { + -re "klist: Credentials cache file .* not found.*\r\n" { verbose "klist started" } timeout { diff --git a/src/tests/gssapi/t_client_keytab.py b/src/tests/gssapi/t_client_keytab.py index ef27d5e..d26d408 100644 --- a/src/tests/gssapi/t_client_keytab.py +++ b/src/tests/gssapi/t_client_keytab.py @@ -135,7 +135,7 @@ if bob not in out: fail('Authenticated as wrong principal') # Make sure the tickets we acquired didn't become the default out = realm.run([klist], expected_code=1) -if 'No credentials cache found' not in out: +if ' not found' not in out: fail('Expected error not seen') realm.run([kdestroy, '-A']) diff --git a/src/tests/t_ccache.py b/src/tests/t_ccache.py index 15d8141..eedd29a 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') |