Test two realms.

git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@25325 ec53bebd-3082-4978-b11e-865c3cabbd6b
This commit is contained in:
Love Hörnquist Åstrand
2009-07-15 22:17:17 +00:00
parent aa5b66d1e8
commit 9dcdb2c02c

View File

@@ -44,6 +44,7 @@ testfailed="echo test failed; cat messages.log; exit \$ec"
../db/have-db || exit 77
R=TEST.H5L.SE
R2=TEST2.H5L.SE
port=@port@
pwport=@pwport@
@@ -74,7 +75,7 @@ rm -f mkey.file*
> messages.log
echo Creating database
echo "Creating database for $R"
${kadmin} \
init \
--realm-max-ticket-life=1day \
@@ -85,8 +86,18 @@ ${kadmin} add -p foo --use-defaults foo@${R} || exit 1
${kadmin} add -p kaka --use-defaults ${server}@${R} || exit 1
${kadmin} ext -k ${keytab} ${server}@${R} || exit 1
echo "Doing database check"
echo "Creating database for ${R2}"
${kadmin} \
init \
--realm-max-ticket-life=1day \
--realm-max-renewable-life=1month \
${R2} || exit 1
${kadmin} add -p foo --use-defaults bar@${R2} || exit 1
echo "Doing database check for ${R} ${R2}"
${kadmin} check ${R} || exit 1
${kadmin} check ${R2} || exit 1
echo foo > ${objdir}/foopassword
@@ -101,6 +112,7 @@ if [ "$?" != 0 ] ; then
fi
echo Starting kpasswdd
env MallocStackLogging=1 MallocStackLoggingNoCompact=1 MallocErrorAbort=1 MallocLogFile=${objdir}/malloc-log \
${kpasswdd} &
kpasswddpid=$!
@@ -119,6 +131,7 @@ ${test_apreq} ${server}@${R} ${keytab} ${cache} || \
{ ec=1 ; eval "${testfailed}"; }
${kdestroy}
echo "checking ${R}"
pw=ak4unandsop39NuJ
@@ -138,11 +151,11 @@ ${rkpty} cpw.tmp ../../kpasswd/kpasswd foo@${R} || \
rm cpw.tmp
echo ${pw} > ${objdir}/foopassword
echo ${pw} > ${objdir}/barpassword
echo "Getting client initial tickets"; > messages.log
${kinit} --password-file=${objdir}/foopassword foo@$R || \
echo "Getting client initial tickets for ${R}"; > messages.log
${kinit} --password-file=${objdir}/barpassword foo@$R || \
{ ec=1 ; eval "${testfailed}"; }
echo "Getting tickets"; > messages.log
${kgetcred} ${server}@${R} || { ec=1 ; eval "${testfailed}"; }
@@ -153,6 +166,29 @@ ${test_apreq} ${server}@${R} ${keytab} ${cache} || \
${kdestroy}
echo "checking ${R2}"
cat > cpw.tmp <<EOF
expect Password
password foo\n
expect New password
send ${pw}\n
expect New password
send ${pw}\n
expect Success
EOF
${rkpty} cpw.tmp ../../kpasswd/kpasswd bar@${R2} || \
{ ec=$? ; eval "${testfailed}"; }
rm cpw.tmp
echo "Getting client initial tickets for ${R2}"; > messages.log
${kinit} --password-file=${objdir}/barpassword bar@${R2} || \
{ ec=1 ; eval "${testfailed}"; }
${kdestroy}
echo "killing kdc (${kdcpid} ${kpasswddpid})"
sh ${srcdir}/leaks-kill.sh kdc $kdcpid || exit 1