Skip to content

Commit

Permalink
Rename tests/t_cccol.py to t_ccache.py
Browse files Browse the repository at this point in the history
Generalize the ccache collection tests in t_cccol.py to multiple kinds
of ccache tests, and rename it to avoid confusion with the lower-level
lib/krb5/ccache/t_cccol.py.  Move a test from t_general.py into
t_ccache.py.
  • Loading branch information
greghudson committed Jul 24, 2012
1 parent 8fbbfd7 commit 18884ca
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 12 deletions.
2 changes: 1 addition & 1 deletion src/tests/Makefile.in
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ check-pytests:: hist
$(RUNPYTEST) $(srcdir)/t_keyrollover.py $(PYTESTFLAGS)
$(RUNPYTEST) $(srcdir)/t_renew.py $(PYTESTFLAGS)
$(RUNPYTEST) $(srcdir)/t_renprinc.py $(PYTESTFLAGS)
$(RUNPYTEST) $(srcdir)/t_cccol.py $(PYTESTFLAGS)
$(RUNPYTEST) $(srcdir)/t_ccache.py $(PYTESTFLAGS)
$(RUNPYTEST) $(srcdir)/t_stringattr.py $(PYTESTFLAGS)
$(RUNPYTEST) $(srcdir)/t_sesskeynego.py $(PYTESTFLAGS)
$(RUNPYTEST) $(srcdir)/t_crossrealm.py $(PYTESTFLAGS)
Expand Down
15 changes: 10 additions & 5 deletions src/tests/t_cccol.py → src/tests/t_ccache.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,11 +23,16 @@
#!/usr/bin/python
from k5test import *

realm = K5Realm(create_user=False, create_host=False)
realm = K5Realm(create_host=False)

# Make a directory collection and use it for client commands in both realms.
ccdir = os.path.join(realm.testdir, 'cc')
ccname = 'DIR:' + ccdir
# Test kdestroy and klist of a non-existent ccache.
realm.run_as_client([kdestroy])
output = realm.run_as_client([klist], expected_code=1)
if 'No credentials cache found' not in output:
fail('Expected error message not seen in klist output')

# Make a directory collection and use it for client commands.
ccname = 'DIR:' + os.path.join(realm.testdir, 'cc')
realm.env_client['KRB5CCNAME'] = ccname

realm.addprinc('alice', password('alice'))
Expand Down Expand Up @@ -73,4 +78,4 @@
if not output.endswith('---\n') or output.count('\n') != 2:
fail('kdestroy -a failed to empty cache collection.')

success('Credential cache collection tests')
success('Credential cache tests')
6 changes: 0 additions & 6 deletions src/tests/t_general.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,12 +33,6 @@
if 'fred\n' not in output:
fail('Policy not preserved across dump/load.')

# Test kdestroy and klist of a non-existent ccache.
realm.run_as_client([kdestroy])
output = realm.run_as_client([klist], expected_code=1)
if 'No credentials cache found' not in output:
fail('Expected error message not seen in klist output')

# Spot-check KRB5_TRACE output
tracefile = os.path.join(realm.testdir, 'trace')
realm.run_as_client(['env', 'KRB5_TRACE=' + tracefile, kinit,
Expand Down

0 comments on commit 18884ca

Please sign in to comment.