From 2027aa11ed46a38cff42ad20a8eb87a633a68ed8 Mon Sep 17 00:00:00 2001 From: Nicolas Williams Date: Sun, 4 Dec 2016 16:42:33 -0600 Subject: [PATCH] Use --detach in tests to avoid waiting --- tests/bin/setup-env.in | 10 ++++++++++ tests/gss/check-basic.in | 10 ++-------- tests/gss/check-context.in | 10 ++-------- tests/gss/check-gssmask.in | 10 ++-------- tests/gss/check-ntlm.in | 10 ++-------- tests/gss/check-spnego.in | 10 ++-------- tests/java/Makefile.am | 1 + tests/java/check-kinit.in | 13 +++++-------- tests/kdc/check-canon.in | 10 ++-------- tests/kdc/check-cc.in | 10 ++-------- tests/kdc/check-delegation.in | 10 ++-------- tests/kdc/check-des.in | 10 ++-------- tests/kdc/check-digest.in | 11 +++-------- tests/kdc/check-fast.in | 10 ++-------- tests/kdc/check-hdb-mitdb.in | 10 ++-------- tests/kdc/check-iprop.in | 45 +++++++++++++++++++++++-------------------- tests/kdc/check-kadmin.in | 11 ++--------- tests/kdc/check-kdc.in | 16 ++++++--------- tests/kdc/check-kinit.in | 10 ++-------- tests/kdc/check-kpasswdd.in | 16 ++++++--------- tests/kdc/check-pkinit.in | 10 ++-------- tests/kdc/check-referral.in | 11 ++--------- tests/kdc/check-uu.in | 11 ++--------- tests/ldap/check-ldap.in | 11 ++--------- tests/plugin/Makefile.am | 1 + tests/plugin/check-pac.in | 13 +++++-------- 26 files changed, 95 insertions(+), 205 deletions(-) diff --git a/tests/bin/setup-env.in b/tests/bin/setup-env.in index 85d331a9f..5c5de1265 100644 --- a/tests/bin/setup-env.in +++ b/tests/bin/setup-env.in @@ -1,5 +1,8 @@ #!/bin/sh +HEIM_PIDFILE_DIR="${objdir}/" +export HEIM_PIDFILE_DIR + unset KRB5_CONFIG unset KRB5CCNAME @@ -48,6 +51,13 @@ test_kuserok="${TESTS_ENVIRONMENT} ${top_builddir}/lib/krb5/test_kuserok" have_db="${top_builddir}/tests/db/have-db" leaks_kill="${top_srcdir}/tests/kdc/leaks-kill.sh" wait_kdc="${top_srcdir}/tests/kdc/wait-kdc.sh" +getpid () { + if [ -f "$HEIM_PIDFILE_DIR/lt-${1}.pid" ]; then + cat "$HEIM_PIDFILE_DIR/lt-${1}.pid" + else + cat "$HEIM_PIDFILE_DIR/${1}.pid" + fi +} if [ ! "${NO_AFS}" ] ; then afs_no_unlog="--no-unlog" diff --git a/tests/gss/check-basic.in b/tests/gss/check-basic.in index 031fdcff1..c8064c010 100644 --- a/tests/gss/check-basic.in +++ b/tests/gss/check-basic.in @@ -94,14 +94,8 @@ echo "Doing database check" ${kadmin} check ${R} || exit 1 echo Starting kdc -${kdc} & -kdcpid=$! - -sh ${srcdir}/../kdc/wait-kdc.sh -if [ "$?" != 0 ] ; then - kill ${kdcpid} - exit 1 -fi +${kdc} --testing --detach || { echo "kdc failed to start"; exit 1; } +kdcpid=`getpid kdc` trap "kill ${kdcpid}; echo signal killing kdc; exit 1;" EXIT diff --git a/tests/gss/check-context.in b/tests/gss/check-context.in index 12b97d959..32f19d141 100644 --- a/tests/gss/check-context.in +++ b/tests/gss/check-context.in @@ -114,14 +114,8 @@ ${kadmin} check ${R} || exit 1 echo u1 > ${objdir}/foopassword echo Starting kdc -${kdc} & -kdcpid=$! - -sh ${srcdir}/../kdc/wait-kdc.sh -if [ "$?" != 0 ] ; then - kill ${kdcpid} - exit 1 -fi +${kdc} --detach --testing || { echo "kdc failed to start"; exit 1; } +kdcpid=`getpid kdc` trap "kill ${kdcpid}; echo signal killing kdc; exit 1;" EXIT diff --git a/tests/gss/check-gssmask.in b/tests/gss/check-gssmask.in index d13319422..c7b7d6f53 100644 --- a/tests/gss/check-gssmask.in +++ b/tests/gss/check-gssmask.in @@ -88,14 +88,8 @@ echo "Doing database check" ${kadmin} check ${R} || exit 1 echo Starting kdc -${kdc} & -kdcpid=$! - -sh ${srcdir}/../kdc/wait-kdc.sh -if [ "$?" != 0 ] ; then - kill ${kdcpid} - exit 1 -fi +${kdc} --detach --testing || { echo "kdc failed to start"; exit 1; } +kdcpid=`getpid kdc` trap "kill ${kdcpid}; echo signal killing kdc; exit 1;" EXIT diff --git a/tests/gss/check-ntlm.in b/tests/gss/check-ntlm.in index def7b3c4f..5398b595b 100644 --- a/tests/gss/check-ntlm.in +++ b/tests/gss/check-ntlm.in @@ -106,14 +106,8 @@ echo u1 > ${objdir}/foopassword echo ds > ${objdir}/barpassword echo Starting kdc -${kdc} & -kdcpid=$! - -sh ${srcdir}/../kdc/wait-kdc.sh -if [ "$?" != 0 ] ; then - kill ${kdcpid} - exit 1 -fi +${kdc} --detach --testing || { echo "kdc failed to start"; exit 1; } +kdcpid=`getpid kdc` trap "kill ${kdcpid}; echo signal killing kdc; exit 1;" EXIT diff --git a/tests/gss/check-spnego.in b/tests/gss/check-spnego.in index 8ab5f297f..7202da538 100644 --- a/tests/gss/check-spnego.in +++ b/tests/gss/check-spnego.in @@ -105,14 +105,8 @@ echo u1 > ${objdir}/foopassword echo ds > ${objdir}/barpassword echo Starting kdc -${kdc} & -kdcpid=$! - -sh ${srcdir}/../kdc/wait-kdc.sh -if [ "$?" != 0 ] ; then - kill ${kdcpid} - exit 1 -fi +${kdc} --detach --testing || { echo "kdc failed to start"; exit 1; } +kdcpid=`getpid kdc` trap "kill ${kdcpid}; echo signal killing kdc; exit 1;" EXIT diff --git a/tests/java/Makefile.am b/tests/java/Makefile.am index 9b695f772..acbe874a0 100644 --- a/tests/java/Makefile.am +++ b/tests/java/Makefile.am @@ -13,6 +13,7 @@ TESTS = $(SCRIPT_TESTS) port = 49188 do_subst = sed -e 's,[@]srcdir[@],$(srcdir),g' \ + -e 's,[@]env_setup[@],$(top_builddir)/tests/bin/setup-env,g' \ -e 's,[@]port[@],$(port),g' \ -e 's,[@]objdir[@],$(top_builddir)/tests/java,g' diff --git a/tests/java/check-kinit.in b/tests/java/check-kinit.in index b55950eaa..04043ca02 100644 --- a/tests/java/check-kinit.in +++ b/tests/java/check-kinit.in @@ -35,9 +35,12 @@ # srcdir="@srcdir@" +env_setup="@env_setup@" objdir="@objdir@" port="@port@" +. ${env_setup} + # Disable test if: no data, no java, or socket wrapper ../db/have-db || exit 77 sh ${srcdir}/have-java.sh || exit 77 @@ -87,14 +90,8 @@ ${kadmin} add -p kaka --use-defaults ${server}@${R} || exit 1 ${kadmin} ext -k ${keytab} ${server}@${R} || exit 1 echo Starting kdc -${kdc} & -kdcpid=$! - -sh ${srcdir}/../kdc/wait-kdc.sh -if [ "$?" != 0 ] ; then - kill ${kdcpid} - exit 1 -fi +${kdc} --detach --testing || { echo "kdc failed to start"; exit 1; } +kdcpid=`getpid kdc` trap "kill -9 ${kdcpid}; echo signal killing kdc; exit 1;" EXIT diff --git a/tests/kdc/check-canon.in b/tests/kdc/check-canon.in index 85006d233..ef5d8275e 100644 --- a/tests/kdc/check-canon.in +++ b/tests/kdc/check-canon.in @@ -99,14 +99,8 @@ ${kadmin} check ${R3} || exit 1 echo foo > ${objdir}/foopassword echo "Starting kdc" ; > messages.log -${kdc} & -kdcpid=$! - -sh ${wait_kdc} -if [ "$?" != 0 ] ; then - kill -9 ${kdcpid} - exit 1 -fi +${kdc} --detach --testing || { echo "kdc failed to start"; exit 1; } +kdcpid=`getpid kdc` trap "kill -9 ${kdcpid}; echo signal killing kdc; exit 1;" EXIT diff --git a/tests/kdc/check-cc.in b/tests/kdc/check-cc.in index 4ad84571a..6e0258947 100644 --- a/tests/kdc/check-cc.in +++ b/tests/kdc/check-cc.in @@ -88,14 +88,8 @@ ${kadmin} check ${R} || exit 1 echo foo > ${objdir}/foopassword echo Starting kdc ; > messages.log -${kdc} & -kdcpid=$! - -sh ${wait_kdc} -if [ "$?" != 0 ] ; then - kill -9 ${kdcpid} - exit 1 -fi +${kdc} --detach --testing || { echo "kdc failed to start"; exit 1; } +kdcpid=`getpid kdc` trap "kill -9 ${kdcpid}; echo signal killing kdc; exit 1;" EXIT diff --git a/tests/kdc/check-delegation.in b/tests/kdc/check-delegation.in index 706ca6bd5..5fa19adba 100644 --- a/tests/kdc/check-delegation.in +++ b/tests/kdc/check-delegation.in @@ -102,14 +102,8 @@ ${kadmin} check ${R4} || exit 1 echo foo > ${objdir}/foopassword echo Starting kdc; > messages.log -${kdc} & -kdcpid=$! - -sh ${wait_kdc} -if [ "$?" != 0 ] ; then - kill -9 ${kdcpid} - exit 1 -fi +${kdc} --detach --testing || { echo "kdc failed to start"; exit 1; } +kdcpid=`getpid kdc` trap "kill -9 ${kdcpid}; echo signal killing kdc; exit 1;" EXIT diff --git a/tests/kdc/check-des.in b/tests/kdc/check-des.in index d1fcfa700..301baa6ed 100644 --- a/tests/kdc/check-des.in +++ b/tests/kdc/check-des.in @@ -96,14 +96,8 @@ ${kadmin} check ${R} || exit 1 echo foo > ${objdir}/foopassword echo Starting kdc; > messages.log -${kdc} & -kdcpid=$! - -sh ${wait_kdc} -if [ "$?" != 0 ] ; then - kill -9 ${kdcpid} - exit 1 -fi +${kdc} --detach --testing || { echo "kdc failed to start"; exit 1; } +kdcpid=`getpid kdc` trap "kill -9 ${kdcpid}; echo signal killing kdc; exit 1;" EXIT diff --git a/tests/kdc/check-digest.in b/tests/kdc/check-digest.in index 070facedd..d31ba323c 100644 --- a/tests/kdc/check-digest.in +++ b/tests/kdc/check-digest.in @@ -94,14 +94,9 @@ ${kadmin} check ${R} || exit 1 echo $password > ${objdir}/foopassword echo "Starting kdc" ; > messages.log -env ${HEIM_MALLOC_DEBUG} ${kdc} & -kdcpid=$! - -sh ${wait_kdc} -if [ "$?" != 0 ] ; then - kill -9 ${kdcpid} - exit 1 -fi +env ${HEIM_MALLOC_DEBUG} ${kdc} --detach --testing || + { echo "kdc failed to start"; exit 1; } +kdcpid=`getpid kdc` trap "kill -9 ${kdcpid}; echo signal killing kdc; cat messages.log; exit 1;" EXIT diff --git a/tests/kdc/check-fast.in b/tests/kdc/check-fast.in index 3027ae1ab..96c00c319 100644 --- a/tests/kdc/check-fast.in +++ b/tests/kdc/check-fast.in @@ -88,14 +88,8 @@ echo bar > ${objdir}/barpassword echo Starting kdc ; > messages.log env MallocStackLogging=1 MallocStackLoggingNoCompact=1 MallocErrorAbort=1 MallocLogFile=${objdir}/malloc-log \ -${kdc} & -kdcpid=$! - -sh ${wait_kdc} -if [ "$?" != 0 ] ; then - kill -9 ${kdcpid} - exit 1 -fi +${kdc} --detach --testing || { echo "kdc failed to start"; exit 1; } +kdcpid=`getpid kdc` trap "kill -9 ${kdcpid}; echo signal killing kdc; cat messages.log; exit 1;" EXIT diff --git a/tests/kdc/check-hdb-mitdb.in b/tests/kdc/check-hdb-mitdb.in index 1dc814841..13559d9c9 100644 --- a/tests/kdc/check-hdb-mitdb.in +++ b/tests/kdc/check-hdb-mitdb.in @@ -85,14 +85,8 @@ echo foo > ${objdir}/foopassword echo Starting kdc ; > messages.log env MallocStackLogging=1 MallocStackLoggingNoCompact=1 MallocErrorAbort=1 MallocLogFile=${objdir}/malloc-log \ -${kdc} & -kdcpid=$! - -sh ${wait_kdc} -if [ "$?" != 0 ] ; then - kill -9 ${kdcpid} - exit 1 -fi +${kdc} --detach --testing || { echo "kdc failed to start"; exit 1; } +kdcpid=`getpid kdc` trap "kill -9 ${kdcpid}; echo signal killing kdc; exit 1;" EXIT diff --git a/tests/kdc/check-iprop.in b/tests/kdc/check-iprop.in index cfe4b637a..fb7eba4b1 100644 --- a/tests/kdc/check-iprop.in +++ b/tests/kdc/check-iprop.in @@ -128,23 +128,22 @@ ipropd_slave="${ipropd_slave} --status-file=iprop-slave-status" trap "echo 'killing ipropd s + m + kdc'; kill -9 \${ipdm} \${ipds} \${kdcpid} >/dev/null 2>/dev/null; tail messages.log ; tail iprop-stats; exit 1;" EXIT echo Starting kdc ; > messages.log -${kdc} & -kdcpid=$! - -sh ${wait_kdc} || exit 1 +${kdc} --detach --testing || { echo "kdc failed to start"; exit 1; } +kdcpid=`getpid kdc` echo "starting master" ; > messages.log env ${HEIM_MALLOC_DEBUG} \ ${ipropd_master} --hostname=localhost -k ${keytab} \ - --database=${objdir}/current-db & -ipdm=$! -sh ${wait_kdc} ipropd-master || exit 1 + --database=${objdir}/current-db --detach || + { echo "ipropd-master failed to start"; exit 1; } +ipdm=`getpid ipropd-master` echo "starting slave" ; > messages.log env ${HEIM_MALLOC_DEBUG} \ KRB5_CONFIG="${objdir}/krb5-slave.conf" \ -${ipropd_slave} --hostname=slave.test.h5l.se -k ${keytab} localhost & -ipds=$! +${ipropd_slave} --hostname=slave.test.h5l.se -k ${keytab} --detach localhost || + { echo "ipropd-slave failed to start"; exit 1; } +ipds=`getpid ipropd-slave` sh ${wait_kdc} ipropd-slave messages.log 'slave status change: up-to-date' || exit 1 sleep 1 @@ -213,6 +212,7 @@ echo "kill slave and remove log and database" sh ${leaks_kill} ipropd-slave $ipds || exit 1 rm -f iprop-slave-status +sleep 2 ${EGREP} 'iprop/slave.test.h5l.se@TEST.H5L.SE.*Down' iprop-stats >/dev/null || exit 1 # ----------------- checking: slave is missing changes while down @@ -232,8 +232,9 @@ echo "starting slave again" ; > messages.log > iprop-stats env ${HEIM_MALLOC_DEBUG} \ KRB5_CONFIG="${objdir}/krb5-slave.conf" \ -${ipropd_slave} --hostname=slave.test.h5l.se -k ${keytab} localhost & -ipds=$! +${ipropd_slave} --hostname=slave.test.h5l.se -k ${keytab} --detach localhost || + { echo "ipropd-slave failed to start"; exit 1; } +ipds=`getpid ipropd-slave` sh ${wait_kdc} ipropd-slave messages.log 'slave status change: up-to-date' || exit 1 sleep 1 @@ -259,8 +260,9 @@ rm -f iprop-slave-status echo "starting slave" ; > messages.log env ${HEIM_MALLOC_DEBUG} \ KRB5_CONFIG="${objdir}/krb5-slave.conf" \ -${ipropd_slave} --hostname=slave.test.h5l.se -k ${keytab} localhost & -ipds=$! +${ipropd_slave} --hostname=slave.test.h5l.se -k ${keytab} --detach localhost || + { echo "ipropd-slave failed to start"; exit 1; } +ipds=`getpid ipropd-slave` sh ${wait_kdc} ipropd-slave messages.log 'slave status change: up-to-date' || exit 1 sleep 1 @@ -304,15 +306,16 @@ cp ${objdir}/current.log.tmp ${objdir}/current.log echo "starting master" ; > messages.log env ${HEIM_MALLOC_DEBUG} \ ${ipropd_master} --hostname=localhost -k ${keytab} \ - --database=${objdir}/current-db & -ipdm=$! -sh ${wait_kdc} ipropd-master || exit 1 + --database=${objdir}/current-db --detach || + { echo "ipropd-master failed to start"; exit 1; } +ipdm=`getpid ipropd-master` echo "starting slave" ; > messages.log env ${HEIM_MALLOC_DEBUG} \ KRB5_CONFIG="${objdir}/krb5-slave.conf" \ -${ipropd_slave} --hostname=slave.test.h5l.se -k ${keytab} localhost & -ipds=$! +${ipropd_slave} --hostname=slave.test.h5l.se -k ${keytab} --detach localhost || + { echo "ipropd-slave failed to start"; exit 1; } +ipds=`getpid ipropd-slave` sh ${wait_kdc} ipropd-slave messages.log 'slave status change: up-to-date' || exit 1 sleep 1 @@ -346,9 +349,9 @@ kill -0 ${ipds} || { echo "slave no longer there"; exit 1; } echo "Staring master again" ; > messages.log env ${HEIM_MALLOC_DEBUG} \ ${ipropd_master} --hostname=localhost -k ${keytab} \ - --database=${objdir}/current-db & -ipdm=$! -sh ${wait_kdc} ipropd-master || exit 1 + --database=${objdir}/current-db --detach || + { echo "ipropd-master failed to start"; exit 1; } +ipdm=`getpid ipropd-master` echo "probing for slave pid" kill -0 ${ipds} || { echo "slave no longer there"; exit 1; } diff --git a/tests/kdc/check-kadmin.in b/tests/kdc/check-kadmin.in index c0896ce2b..d40d0ea88 100644 --- a/tests/kdc/check-kadmin.in +++ b/tests/kdc/check-kadmin.in @@ -89,15 +89,8 @@ ${kadmin} -l modify --pkinit-acl="CN=baz,DC=test,DC=h5l,DC=se" pkinit@${R} || ex echo foo > ${objdir}/foopassword echo Starting kdc ; > messages.log -${kdc} & -kdcpid=$! - -sh ${wait_kdc} -if [ "$?" != 0 ] ; then - kill -9 ${kdcpid} - kill -9 ${kadmpid} - exit 1 -fi +${kdc} --detach --testing || { echo "kdc failed to start"; exit 1; } +kdcpid=`getpid kdc` trap "kill -9 ${kdcpid} ${kadmpid}" EXIT diff --git a/tests/kdc/check-kdc.in b/tests/kdc/check-kdc.in index 4714b2620..235113425 100644 --- a/tests/kdc/check-kdc.in +++ b/tests/kdc/check-kdc.in @@ -332,18 +332,14 @@ echo notfoo > ${objdir}/notfoopassword echo Starting kdc ; > messages.log env MallocStackLogging=1 MallocStackLoggingNoCompact=1 MallocErrorAbort=1 MallocLogFile=${objdir}/malloc-log \ -${kdc} & -kdcpid=$! - -sh ${wait_kdc} -if [ "$?" != 0 ] ; then - kill -9 ${kdcpid} - exit 1 -fi +${kdc} --detach --testing || + { echo "kdc failed to start"; exit 1; } +kdcpid=`getpid kdc` echo Starting kpasswdd; > messages.log -env ${HEIM_MALLOC_DEBUG} ${kpasswdd} & -kpasswddpid=$! +env ${HEIM_MALLOC_DEBUG} ${kpasswdd} --detach || + { echo "kpasswdd failed to start"; exit 1; } +kpasswddpid=`getpid kpasswdd` trap "kill -9 ${kdcpid} ${kpasswddpid}; echo signal killing kdc kpasswdd; exit 1;" EXIT diff --git a/tests/kdc/check-kinit.in b/tests/kdc/check-kinit.in index 168f3a2e8..e541a844d 100644 --- a/tests/kdc/check-kinit.in +++ b/tests/kdc/check-kinit.in @@ -107,14 +107,8 @@ if (($# == 0)); then echo foo > ${objdir}/foopassword echo Starting kdc ; > messages.log - ${kdc} & - kdcpid=$! - - sh ${wait_kdc} - if [ "$?" != 0 ] ; then - kill -9 ${kdcpid} - exit 1 - fi + ${kdc} --detach --testing || { echo "kdc failed to start"; exit 1; } + kdcpid=`getpid kdc` trap "kill -9 ${kdcpid}; echo signal killing kdc; exit 1;" EXIT diff --git a/tests/kdc/check-kpasswdd.in b/tests/kdc/check-kpasswdd.in index ae145d30d..3711ede01 100644 --- a/tests/kdc/check-kpasswdd.in +++ b/tests/kdc/check-kpasswdd.in @@ -102,18 +102,14 @@ ${kadmin} check ${R2} || exit 1 echo foo > ${objdir}/foopassword echo Starting kdc ; > messages.log -env ${HEIM_MALLOC_DEBUG} ${kdc} & -kdcpid=$! - -sh ${wait_kdc} -if [ "$?" != 0 ] ; then - kill -9 ${kdcpid} - exit 1 -fi +env ${HEIM_MALLOC_DEBUG} ${kdc} --detach --testing || + { echo "kdc failed to start"; exit 1; } +kdcpid=`getpid kdc` echo Starting kpasswdd -env ${HEIM_MALLOC_DEBUG} ${kpasswdd} & -kpasswddpid=$! +env ${HEIM_MALLOC_DEBUG} ${kpasswdd} --detach || + { echo "kpasswdd failed to start"; exit 1; } +kpasswddpid=`getpid kpasswdd` trap "kill -9 ${kdcpid} ${kpasswddpid}; echo signal killing kdc; exit \$ec;" EXIT diff --git a/tests/kdc/check-pkinit.in b/tests/kdc/check-pkinit.in index 46cfa7e5b..92c515ffb 100644 --- a/tests/kdc/check-pkinit.in +++ b/tests/kdc/check-pkinit.in @@ -169,14 +169,8 @@ ${hxtool} issue-certificate \ echo foo > ${objdir}/foopassword echo Starting kdc ; > messages.log -${kdc} & -kdcpid=$! - -sh ${wait_kdc} -if [ "$?" != 0 ] ; then - kill -9 ${kdcpid} - exit 1 -fi +${kdc} --detach --testing || { echo "kdc failed to start"; exit 1; } +kdcpid=`getpid kdc` trap "kill -9 ${kdcpid}; echo signal killing kdc; cat ca.crt kdc.crt pkinit.crt ;exit 1;" EXIT diff --git a/tests/kdc/check-referral.in b/tests/kdc/check-referral.in index ca304e0b7..bbb72a349 100644 --- a/tests/kdc/check-referral.in +++ b/tests/kdc/check-referral.in @@ -59,7 +59,6 @@ klist="${klist} -c $cache" kgetcred="${kgetcred} -c $cache" kdestroy="${kdestroy} -c $cache ${afs_no_unlog}" - KRB5_CONFIG="${objdir}/krb5.conf" export KRB5_CONFIG @@ -101,14 +100,8 @@ ${kadmin} check ${R2} || exit 1 echo foo > ${objdir}/foopassword echo Starting kdc ; > messages.log -${kdc} & -kdcpid=$! - -sh ${wait_kdc} -if [ "$?" != 0 ] ; then - kill -9 ${kdcpid} - exit 1 -fi +${kdc} --detach --testing || { echo "kdc failed to start"; exit 1; } +kdcpid=`getpid kdc` trap "kill -9 ${kdcpid}; echo signal killing kdc; exit 1;" EXIT diff --git a/tests/kdc/check-uu.in b/tests/kdc/check-uu.in index 92bed0a86..c6607fa23 100644 --- a/tests/kdc/check-uu.in +++ b/tests/kdc/check-uu.in @@ -61,7 +61,6 @@ kdestroy2="${TESTS_ENVIRONMENT} ../../kuser/kdestroy -c $cache2 ${afs_no_unlog}" uu_server="${TESTS_ENVIRONMENT} ../../appl/test/uu_server" uu_client="${TESTS_ENVIRONMENT} ../../appl/test/uu_client" - KRB5_CONFIG="${objdir}/krb5.conf" export KRB5_CONFIG @@ -87,14 +86,8 @@ ${kadmin} check ${R} || exit 1 echo foo > ${objdir}/foopassword echo Starting kdc ; > messages.log -${kdc} & -kdcpid=$! - -sh ${wait_kdc} -if [ "$?" != 0 ] ; then - kill -9 ${kdcpid} - exit 1 -fi +${kdc} --detach --testing || { echo "kdc failed to start"; exit 1; } +kdcpid=`getpid kdc` trap "kill -9 ${kdcpid} ${uuspid}; echo signal killing kdc; exit 1;" EXIT diff --git a/tests/ldap/check-ldap.in b/tests/ldap/check-ldap.in index 28bf5eb3f..efe94a022 100644 --- a/tests/ldap/check-ldap.in +++ b/tests/ldap/check-ldap.in @@ -114,15 +114,8 @@ ${kadmin} list '*' > /dev/null || exit 1 echo foo > ${objdir}/foopassword echo Starting kdc -${kdc} & -kdcpid=$! - -sh ${srcdir}/../kdc/wait-kdc.sh -if [ "$?" != 0 ] ; then - kill ${kdcpid} - sh ${srcdir}/slapd-stop - exit 1 -fi +${kdc} --detach --testing || { echo "kdc failed to start"; exit 1; } +kdcpid=`getpid kdc` trap "kill ${kdcpid}; echo signal killing kdc; sh ${srcdir}/slapd-stop ; exit 1;" EXIT diff --git a/tests/plugin/Makefile.am b/tests/plugin/Makefile.am index 002f2ade9..af1d07a8f 100644 --- a/tests/plugin/Makefile.am +++ b/tests/plugin/Makefile.am @@ -10,6 +10,7 @@ TESTS = $(SCRIPT_TESTS) port = 49188 do_subst = sed -e 's,[@]srcdir[@],$(srcdir),g' \ + -e 's,[@]env_setup[@],$(top_builddir)/tests/bin/setup-env,g' \ -e 's,[@]port[@],$(port),g' \ -e 's,[@]objdir[@],$(top_builddir)/tests/plugin,g' \ -e 's,[@]EGREP[@],$(EGREP),g' diff --git a/tests/plugin/check-pac.in b/tests/plugin/check-pac.in index 17f721603..7f0a4c326 100644 --- a/tests/plugin/check-pac.in +++ b/tests/plugin/check-pac.in @@ -35,9 +35,12 @@ # srcdir="@srcdir@" +env_setup="@env_setup@" objdir="@objdir@" EGREP="@EGREP@" +. ${env_setup} + testfailed="echo test failed; cat messages.log; exit 1" # If there is no useful db support compile in, disable test @@ -92,14 +95,8 @@ echo "Empty log" > messages.log echo Starting kdc -${kdc} & -kdcpid=$! - -sh ${srcdir}/../kdc/wait-kdc.sh -if [ "$?" != 0 ] ; then - kill ${kdcpid} - exit 1 -fi +${kdc} --detach --testing || { echo "kdc failed to start"; exit 1; } +kdcpid=`getpid kdc` trap "kill ${kdcpid}; echo signal killing kdc; exit 1;" EXIT -- 2.11.4.GIT