svn rev #25815: trunk/src/tests/

ghudson@MIT.EDU ghudson at MIT.EDU
Thu Apr 19 13:55:03 EDT 2012


http://src.mit.edu/fisheye/changelog/krb5/?cs=25815
Commit By: ghudson
Log Message:
Add keytab kinit test cases

Create a test script for keytab-related tests.  Move the kvno wrapping
test there from t_general.py, and augment it to better match what's in
standalone.exp.  Add tests for kinit with keytab, including kinit with
the most-preferred enctype missing from the keytab (which currently
fails).


Changed Files:
U   trunk/src/tests/Makefile.in
U   trunk/src/tests/t_general.py
A   trunk/src/tests/t_keytab.py
Modified: trunk/src/tests/Makefile.in
===================================================================
--- trunk/src/tests/Makefile.in	2012-04-19 14:45:20 UTC (rev 25814)
+++ trunk/src/tests/Makefile.in	2012-04-19 17:55:03 UTC (rev 25815)
@@ -72,6 +72,7 @@
 	$(RUNPYTEST) $(srcdir)/t_stringattr.py $(PYTESTFLAGS)
 	$(RUNPYTEST) $(srcdir)/t_crossrealm.py $(PYTESTFLAGS)
 	$(RUNPYTEST) $(srcdir)/t_skew.py $(PYTESTFLAGS)
+	$(RUNPYTEST) $(srcdir)/t_keytab.py $(PYTESTFLAGS)
 #	$(RUNPYTEST) $(srcdir)/kdc_realm/kdcref.py $(PYTESTFLAGS)
 
 clean::

Modified: trunk/src/tests/t_general.py
===================================================================
--- trunk/src/tests/t_general.py	2012-04-19 14:45:20 UTC (rev 25814)
+++ trunk/src/tests/t_general.py	2012-04-19 17:55:03 UTC (rev 25815)
@@ -39,15 +39,4 @@
     if 'No credentials cache found' not in output:
         fail('Expected error message not seen in klist output')
 
-    # Test handling of kvno values beyond 255.
-    princ = 'foo/bar@%s' % realm.realm
-    realm.addprinc(princ)
-    realm.run_kadminl('modprinc -kvno 252 %s' % princ)
-    for kvno in range(253, 259):
-        realm.run_kadminl('ktadd -k %s %s' % (realm.keytab, princ))
-        realm.klist_keytab(princ)
-    output = realm.run_kadminl('getprinc %s' % princ)
-    if 'Key: vno 258,' not in output:
-        fail('Expected vno not seen in kadmin.local output')
-
 success('Dump/load, FAST kinit, kdestroy, kvno wrapping')

Added: trunk/src/tests/t_keytab.py
===================================================================
--- trunk/src/tests/t_keytab.py	                        (rev 0)
+++ trunk/src/tests/t_keytab.py	2012-04-19 17:55:03 UTC (rev 25815)
@@ -0,0 +1,29 @@
+#!/usr/bin/python
+from k5test import *
+
+realm = K5Realm(start_kadmind=False)
+
+# Test kinit with a keytab.
+realm.kinit(realm.host_princ, flags=['-k'])
+
+# Test kinit with a partial keytab.
+pkeytab = realm.keytab + '.partial'
+realm.run_as_master([ktutil], input=('rkt %s\ndelent 1\nwkt %s\n' %
+                                     (realm.keytab, pkeytab)))
+realm.kinit(realm.host_princ, flags=['-k', '-t', pkeytab], expected_code=1)
+
+# Test handling of kvno values beyond 255.
+princ = 'foo/bar@%s' % realm.realm
+realm.addprinc(princ)
+os.remove(realm.keytab)
+realm.run_kadminl('modprinc -kvno 252 %s' % princ)
+for kvno in range(253, 259):
+    realm.run_kadminl('ktadd -k %s %s' % (realm.keytab, princ))
+    realm.kinit(princ, flags=['-k'])
+    realm.klist_keytab(princ)
+    os.remove(realm.keytab)
+output = realm.run_kadminl('getprinc %s' % princ)
+if 'Key: vno 258,' not in output:
+    fail('Expected vno not seen in kadmin.local output')
+
+success('Keytab-related tests')



More information about the cvs-krb5 mailing list