[28619] in CVS-changelog-for-Kerberos-V5

home help back first fref pref prev next nref lref last post

krb5 commit: Add tests for klist -s

daemon@ATHENA.MIT.EDU (Greg Hudson)
Mon Oct 13 00:59:08 2014

Date: Mon, 13 Oct 2014 00:22:44 -0400
From: Greg Hudson <ghudson@mit.edu>
Message-Id: <201410130422.s9D4Mi7J010986@drugstore.mit.edu>
To: cvs-krb5@mit.edu
Reply-To: krbdev@mit.edu
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Errors-To: cvs-krb5-bounces@mit.edu

https://github.com/krb5/krb5/commit/c7a8b8908e5db1af1c612bb7b94d46e97f919856
commit c7a8b8908e5db1af1c612bb7b94d46e97f919856
Author: Greg Hudson <ghudson@mit.edu>
Date:   Thu Oct 9 12:03:36 2014 -0400

    Add tests for klist -s

 src/tests/t_ccache.py |   17 +++++++++++++++++
 1 files changed, 17 insertions(+), 0 deletions(-)

diff --git a/src/tests/t_ccache.py b/src/tests/t_ccache.py
index dd20e11..54a3050 100644
--- a/src/tests/t_ccache.py
+++ b/src/tests/t_ccache.py
@@ -36,6 +36,17 @@ output = realm.run([klist], expected_code=1)
 if ' not found' not in output:
     fail('Expected error message not seen in klist output')
 
+# Test klist -s with a single ccache.
+realm.run([klist, '-s'], expected_code=1)
+realm.kinit(realm.user_princ, password('user'))
+realm.run([klist, '-s'])
+realm.kinit(realm.user_princ, password('user'), ['-l', '-1s'])
+realm.run([klist, '-s'], expected_code=1)
+realm.kinit(realm.user_princ, password('user'), ['-S', 'kadmin/admin'])
+realm.run([klist, '-s'])
+realm.run([kdestroy])
+realm.run([klist, '-s'], expected_code=1)
+
 realm.addprinc('alice', password('alice'))
 realm.addprinc('bob', password('bob'))
 realm.addprinc('carol', password('carol'))
@@ -43,10 +54,12 @@ realm.addprinc('carol', password('carol'))
 def collection_test(realm, ccname):
     realm.env['KRB5CCNAME'] = ccname
 
+    realm.run([klist, '-A', '-s'], expected_code=1)
     realm.kinit('alice', password('alice'))
     output = realm.run([klist])
     if 'Default principal: alice@' not in output:
         fail('Initial kinit failed to get credentials for alice.')
+    realm.run([klist, '-A', '-s'])
     realm.run([kdestroy])
     output = realm.run([klist], expected_code=1)
     if ' not found' not in output:
@@ -54,6 +67,7 @@ def collection_test(realm, ccname):
     output = realm.run([klist, '-l'], expected_code=1)
     if not output.endswith('---\n') or output.count('\n') != 2:
         fail('Initial kdestroy failed to empty cache collection.')
+    realm.run([klist, '-A', '-s'], expected_code=1)
 
     realm.kinit('alice', password('alice'))
     realm.kinit('carol', password('carol'))
@@ -77,10 +91,13 @@ def collection_test(realm, ccname):
     output = realm.run([klist, '-l'])
     if 'carol@' in output or 'bob@' not in output or output.count('\n') != 4:
         fail('kdestroy failed to remove only primary ccache.')
+    realm.run([klist, '-s'], expected_code=1)
+    realm.run([klist, '-A', '-s'])
     realm.run([kdestroy, '-A'])
     output = realm.run([klist, '-l'], expected_code=1)
     if not output.endswith('---\n') or output.count('\n') != 2:
         fail('kdestroy -a failed to empty cache collection.')
+    realm.run([klist, '-A', '-s'], expected_code=1)
 
 
 collection_test(realm, 'DIR:' + os.path.join(realm.testdir, 'cc'))
_______________________________________________
cvs-krb5 mailing list
cvs-krb5@mit.edu
https://mailman.mit.edu/mailman/listinfo/cvs-krb5

home help back first fref pref prev next nref lref last post