diff options
author | Russ Allbery <rra@stanford.edu> | 2007-09-27 03:22:46 +0000 |
---|---|---|
committer | Russ Allbery <rra@stanford.edu> | 2007-09-27 03:22:46 +0000 |
commit | e0f6e1222ede4a7545ca995a8aacaae0b591cb9c (patch) | |
tree | 2af9d140d13ee321c6fdb81c4444ca2e0e93c4a3 /tests/client/basic-t.in | |
parent | 7ec47028dbfe6df70d4c07e9546ae1680cf4e91f (diff) |
Initial cut at srvtab support in the wallet client. This still requires
additional work and cleanup, particularly support for the sync attribute.
Diffstat (limited to 'tests/client/basic-t.in')
-rw-r--r-- | tests/client/basic-t.in | 46 |
1 files changed, 44 insertions, 2 deletions
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 <<EOF + +[realms] + test-k5.stanford.edu = { + v4_realm = TEST.STANFORD.EDU + } +EOF + KRB5_CONFIG="./krb5.conf" + export KRB5_CONFIG + break + fi +done + # Now, we can finally run our tests. runsuccess "" -c fake-wallet get keytab -f keytab service/fake-test +if cmp keytab data/fake-data >/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" \ |