From e0f6e1222ede4a7545ca995a8aacaae0b591cb9c Mon Sep 17 00:00:00 2001 From: Russ Allbery Date: Thu, 27 Sep 2007 03:22:46 +0000 Subject: Initial cut at srvtab support in the wallet client. This still requires additional work and cleanup, particularly support for the sync attribute. --- tests/client/basic-t.in | 46 ++++++++++++++++++++++++++++++++++++++++++++-- 1 file changed, 44 insertions(+), 2 deletions(-) (limited to 'tests/client') diff --git a/tests/client/basic-t.in b/tests/client/basic-t.in index f088933..50a4ab5 100644 --- a/tests/client/basic-t.in +++ b/tests/client/basic-t.in @@ -54,7 +54,7 @@ runfailure () { } # Print the number of tests. -echo 7 +echo 10 # Find the client program. if [ -f ../data/test.keytab ] ; then @@ -65,7 +65,7 @@ else fi fi if [ ! -f data/test.keytab ] || [ -z "@REMCTLD@" ] ; then - for n in 1 2 3 4 5 6 7 ; do + for n in 1 2 3 4 5 6 7 8 9 10 ; do echo ok $n \# skip -- no Kerberos configuration done exit 0 @@ -98,14 +98,56 @@ if [ ! -f data/pid ] ; then exit 1 fi +# We need a modified krb5.conf file for the srvtab test to work, since we need +# to add a v4_realm setting for the test-k5.stanford.edu realm that the keytab +# is for. +krb5conf= +for p in /etc/krb5.conf /usr/local/etc/krb5.conf ; do + if [ -r "$p" ] ; then + krb5conf="$p" + sed -e '/^ *test-k5.stanford.edu =/,/}/d' \ + -e 's/\(default_realm.*=\) .*/\1 test-k5.stanford.edu/' \ + "$p" > ./krb5.conf + cat >> krb5.conf </dev/null 2>&1 ; then + printcount "ok" + rm keytab +else + printcount "not ok" +fi +runsuccess "" -c fake-wallet get keytab -f keytab -S srvtab service/fake-srvtab if cmp keytab data/fake-keytab >/dev/null 2>&1 ; then printcount "ok" rm keytab else printcount "not ok" fi +if [ -n "$krb5conf" ] ; then + if cmp srvtab data/fake-srvtab >/dev/null 2>&1 ; then + printcount "ok" + rm srvtab + else + printcount "not ok" + fi + KRB5_CONFIG= + rm krb5.conf +else + printcount "ok # skip cannot find krb5.conf" +fi runsuccess "Some stuff about service/fake-test" \ -c fake-wallet show keytab service/fake-test runfailure 1 "wallet: Unknown object type srvtab" \ -- cgit v1.2.3