From: Ben Kaduk Date: Wed, 14 Nov 2012 20:20:16 +0000 (-0500) Subject: Tests for kinit's detection of a keytab request X-Git-Tag: krb5-1.12-alpha1~473 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=76259be582f1e0d07c2a8993741e4893c7fd6f74;p=thirdparty%2Fkrb5.git Tests for kinit's detection of a keytab request We must check that 'kinit -t keytab' and 'kinit -i' successfully produce tickets, and have the specified warning output. ticket: 7218 tags: pullup target_version: 1.11 --- diff --git a/src/tests/t_keytab.py b/src/tests/t_keytab.py index f8cea68d40..bc547d9437 100644 --- a/src/tests/t_keytab.py +++ b/src/tests/t_keytab.py @@ -26,6 +26,18 @@ out = realm.run_as_client([klist, '-k', '-i']) if realm.client_keytab not in out or realm.user_princ not in out: fail('Expected output not seen from klist -k -i') +# Test implicit request for keytab (-i or -t without -k) +realm.run_as_client([kdestroy]) +output = realm.kinit(realm.host_princ, flags=['-t', realm.keytab]) +if 'keytab specified, forcing -k' not in output: + fail('Expected output not seen from kinit -t keytab') +realm.klist(realm.host_princ) +realm.run_as_client([kdestroy]) +output = realm.kinit(realm.user_princ, flags=['-i']) +if 'keytab specified, forcing -k' not in output: + fail('Expected output not seen from kinit -i') +realm.klist(realm.user_princ) + # Test handling of kvno values beyond 255. princ = 'foo/bar@%s' % realm.realm realm.addprinc(princ)