diff options
author | Greg Hudson <ghudson@mit.edu> | 2011-09-05 16:26:43 +0000 |
---|---|---|
committer | Greg Hudson <ghudson@mit.edu> | 2011-09-05 16:26:43 +0000 |
commit | 45360c9688ca963f75a2480f2cf818424fc3dc7b (patch) | |
tree | cd99a0453921fceb45b48895458977b260fa8d1d /src/lib/krb5/ccache/t_cccol.py | |
parent | f784a37909b68b7dfc1eed8c3a0e014639c90e45 (diff) | |
download | krb5-45360c9688ca963f75a2480f2cf818424fc3dc7b.tar.gz krb5-45360c9688ca963f75a2480f2cf818424fc3dc7b.tar.xz krb5-45360c9688ca963f75a2480f2cf818424fc3dc7b.zip |
Remove unneeded cccol behaviors
Do not yield any default caches in the top level cccol implementation.
In the FILE type, yield the default cache if it exists and is of type
FILE, instead of yielding the set of open file caches.
ticket: 6955
git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@25156 dc483132-0cff-0310-8789-dd5450dbe970
Diffstat (limited to 'src/lib/krb5/ccache/t_cccol.py')
-rw-r--r-- | src/lib/krb5/ccache/t_cccol.py | 44 |
1 files changed, 44 insertions, 0 deletions
diff --git a/src/lib/krb5/ccache/t_cccol.py b/src/lib/krb5/ccache/t_cccol.py new file mode 100644 index 0000000000..d809971089 --- /dev/null +++ b/src/lib/krb5/ccache/t_cccol.py @@ -0,0 +1,44 @@ +#!/usr/bin/python +from k5test import * + +realm = K5Realm(create_host=False, start_kadmind=False) + +realm.addprinc('alice', password('alice')) +realm.addprinc('bob', password('bob')) + +ccdir = os.path.join(realm.testdir, 'cc') +dccname = 'DIR:%s' % ccdir +duser = 'DIR::%s/tkt1' % ccdir +dalice = 'DIR::%s/tkt2' % ccdir +dbob = 'DIR::%s/tkt3' % ccdir +os.mkdir(ccdir) +realm.kinit('user', password('user'), flags=['-c', duser]) +realm.kinit('alice', password('alice'), flags=['-c', dalice]) +realm.kinit('bob', password('bob'), flags=['-c', dbob]) + +def cursor_test(testname, args, expected): + outlines = realm.run_as_client(['./t_cccursor'] + args).splitlines() + outlines.sort() + expected.sort() + if outlines != expected: + fail('Output not expected for %s\n' % testname + + 'Expected output:\n\n' + '\n'.join(expected) + '\n\n' + + 'Actual output:\n\n' + '\n'.join(outlines)) + +fccname = 'FILE:%s' % realm.ccache +cursor_test('file-default', [], [fccname]) +cursor_test('file-default2', [realm.ccache], [fccname]) +cursor_test('file-default3', [fccname], [fccname]) + +cursor_test('dir', [dccname], [duser, dalice, dbob]) + +mfoo = 'MEMORY:foo' +mbar = 'MEMORY:bar' +cursor_test('filemem', [fccname, mfoo, mbar], [fccname, mfoo, mbar]) +cursor_test('dirmem', [dccname, mfoo], [duser, dalice, dbob, mfoo]) + +# Make sure FILE doesn't yield a nonexistent default cache. +realm.run_as_client([kdestroy]) +cursor_test('noexist', [], []) + +success('Renewing credentials.') |