externlize env-setup
This commit is contained in:
@@ -29,4 +29,4 @@ leaks_kill="${top_srcdir}/tests/kdc/leaks-kill.sh"
|
|||||||
have_db="${top_builddir}/tests/db/have-db"
|
have_db="${top_builddir}/tests/db/have-db"
|
||||||
|
|
||||||
# data
|
# data
|
||||||
hx509_data="${top_srcdir}/../../lib/hx509/data"
|
hx509_data="${top_srcdir}/lib/hx509/data"
|
@@ -39,6 +39,7 @@ do_dlopen = -e 's,[@]DLOPEN[@],false,g'
|
|||||||
endif
|
endif
|
||||||
|
|
||||||
do_subst = sed $(do_dlopen) \
|
do_subst = sed $(do_dlopen) \
|
||||||
|
-e 's,[@]env_setup[@],$(top_builddir)/tests/bin/setup-env,g' \
|
||||||
-e 's,[@]srcdir[@],$(srcdir),g' \
|
-e 's,[@]srcdir[@],$(srcdir),g' \
|
||||||
-e 's,[@]port[@],$(port),g' \
|
-e 's,[@]port[@],$(port),g' \
|
||||||
-e 's,[@]admport[@],$(admport),g' \
|
-e 's,[@]admport[@],$(admport),g' \
|
||||||
@@ -65,16 +66,12 @@ check-des: check-des.in Makefile krb5.conf
|
|||||||
mv check-des.tmp check-des
|
mv check-des.tmp check-des
|
||||||
|
|
||||||
check-kdc: check-kdc.in Makefile
|
check-kdc: check-kdc.in Makefile
|
||||||
$(do_subst) \
|
$(do_subst) < $(srcdir)/check-kdc.in > check-kdc.tmp
|
||||||
-e 's,[@]KDCCONF[@],krb5.conf,g' \
|
|
||||||
< $(srcdir)/check-kdc.in > check-kdc.tmp
|
|
||||||
chmod +x check-kdc.tmp
|
chmod +x check-kdc.tmp
|
||||||
mv check-kdc.tmp check-kdc
|
mv check-kdc.tmp check-kdc
|
||||||
|
|
||||||
check-kdc-weak: check-kdc.in Makefile
|
check-kdc-weak: check-kdc-weak.in Makefile
|
||||||
$(do_subst) \
|
$(do_subst) < $(srcdir)/check-kdc-weak.in > check-kdc-weak.tmp
|
||||||
-e 's,[@]KDCCONF[@],krb5-weak.conf,g' \
|
|
||||||
< $(srcdir)/check-kdc.in > check-kdc-weak.tmp
|
|
||||||
chmod +x check-kdc-weak.tmp
|
chmod +x check-kdc-weak.tmp
|
||||||
mv check-kdc-weak.tmp check-kdc-weak
|
mv check-kdc-weak.tmp check-kdc-weak
|
||||||
|
|
||||||
@@ -200,6 +197,7 @@ EXTRA_DIST = \
|
|||||||
check-iprop.in \
|
check-iprop.in \
|
||||||
check-kadmin.in \
|
check-kadmin.in \
|
||||||
check-kdc.in \
|
check-kdc.in \
|
||||||
|
check-kdc-weak.in \
|
||||||
check-keys.in \
|
check-keys.in \
|
||||||
check-kpasswdd.in \
|
check-kpasswdd.in \
|
||||||
check-pkinit.in \
|
check-pkinit.in \
|
||||||
|
40
tests/kdc/check-kdc-weak.in
Normal file
40
tests/kdc/check-kdc-weak.in
Normal file
@@ -0,0 +1,40 @@
|
|||||||
|
#!/bin/sh
|
||||||
|
#
|
||||||
|
# Copyright (c) 2009 Kungliga Tekniska Högskolan
|
||||||
|
# (Royal Institute of Technology, Stockholm, Sweden).
|
||||||
|
# All rights reserved.
|
||||||
|
#
|
||||||
|
# Redistribution and use in source and binary forms, with or without
|
||||||
|
# modification, are permitted provided that the following conditions
|
||||||
|
# are met:
|
||||||
|
#
|
||||||
|
# 1. Redistributions of source code must retain the above copyright
|
||||||
|
# notice, this list of conditions and the following disclaimer.
|
||||||
|
#
|
||||||
|
# 2. Redistributions in binary form must reproduce the above copyright
|
||||||
|
# notice, this list of conditions and the following disclaimer in the
|
||||||
|
# documentation and/or other materials provided with the distribution.
|
||||||
|
#
|
||||||
|
# 3. Neither the name of the Institute nor the names of its contributors
|
||||||
|
# may be used to endorse or promote products derived from this software
|
||||||
|
# without specific prior written permission.
|
||||||
|
#
|
||||||
|
# THIS SOFTWARE IS PROVIDED BY THE INSTITUTE AND CONTRIBUTORS ``AS IS'' AND
|
||||||
|
# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||||
|
# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
||||||
|
# ARE DISCLAIMED. IN NO EVENT SHALL THE INSTITUTE OR CONTRIBUTORS BE LIABLE
|
||||||
|
# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
||||||
|
# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
|
||||||
|
# OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
|
||||||
|
# HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
|
||||||
|
# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
|
||||||
|
# OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
||||||
|
# SUCH DAMAGE.
|
||||||
|
#
|
||||||
|
# $Id$
|
||||||
|
#
|
||||||
|
|
||||||
|
top_builddir="@top_builddir@"
|
||||||
|
objdir="@objdir@"
|
||||||
|
|
||||||
|
exec ${top_builddir}/tests/kdc/check-kdc ${objdir}/krb5-weak.conf
|
@@ -35,11 +35,15 @@
|
|||||||
#
|
#
|
||||||
|
|
||||||
top_builddir="@top_builddir@"
|
top_builddir="@top_builddir@"
|
||||||
|
env_setup="@env_setup@"
|
||||||
objdir="@objdir@"
|
objdir="@objdir@"
|
||||||
|
|
||||||
|
KRB5_CONFIG="${1-${objdir}/krb5.conf}"
|
||||||
|
export KRB5_CONFIG
|
||||||
|
|
||||||
testfailed="echo test failed; cat messages.log; exit 1"
|
testfailed="echo test failed; cat messages.log; exit 1"
|
||||||
|
|
||||||
. ${top_builddir}/tests/bin/setup-env
|
. ${env_setup}
|
||||||
|
|
||||||
# If there is no useful db support compile in, disable test
|
# If there is no useful db support compile in, disable test
|
||||||
${have_db} || exit 77
|
${have_db} || exit 77
|
||||||
@@ -76,9 +80,6 @@ kgetcred_imp="${kgetcred} -c $cache --out-cache=${ocache}"
|
|||||||
kdestroy="${kdestroy} -c $cache --no-unlog"
|
kdestroy="${kdestroy} -c $cache --no-unlog"
|
||||||
kimpersonate="${kimpersonate} -k ${keytab} --ccache=${ocache}"
|
kimpersonate="${kimpersonate} -k ${keytab} --ccache=${ocache}"
|
||||||
|
|
||||||
KRB5_CONFIG="${objdir}/@KDCCONF@"
|
|
||||||
export KRB5_CONFIG
|
|
||||||
|
|
||||||
rm -f ${keytabfile}
|
rm -f ${keytabfile}
|
||||||
rm -f current-db*
|
rm -f current-db*
|
||||||
rm -f out-*
|
rm -f out-*
|
||||||
@@ -387,8 +388,6 @@ fi
|
|||||||
# If we support pkinit and have RSA, lets try that
|
# If we support pkinit and have RSA, lets try that
|
||||||
if test "$pkinit" = yes -a "$rsa" = yes ; then
|
if test "$pkinit" = yes -a "$rsa" = yes ; then
|
||||||
|
|
||||||
base="${hx509_data}"
|
|
||||||
|
|
||||||
echo "try anonymous pkinit"; > messages.log
|
echo "try anonymous pkinit"; > messages.log
|
||||||
${kinit} --anonymous ${R} || \
|
${kinit} --anonymous ${R} || \
|
||||||
{ ec=1 ; eval "${testfailed}"; }
|
{ ec=1 ; eval "${testfailed}"; }
|
||||||
@@ -397,26 +396,26 @@ if test "$pkinit" = yes -a "$rsa" = yes ; then
|
|||||||
|
|
||||||
for type in "" "--pk-use-enckey"; do
|
for type in "" "--pk-use-enckey"; do
|
||||||
echo "Trying pk-init (principal in certificate) $type"; > messages.log
|
echo "Trying pk-init (principal in certificate) $type"; > messages.log
|
||||||
${kinit} $type -C FILE:${base}/pkinit.crt,${base}/pkinit.key bar@${R} || \
|
${kinit} $type -C FILE:${hx509_data}/pkinit.crt,${hx509_data}/pkinit.key bar@${R} || \
|
||||||
{ ec=1 ; eval "${testfailed}"; }
|
{ ec=1 ; eval "${testfailed}"; }
|
||||||
${kgetcred} ${server}@${R} || { ec=1 ; eval "${testfailed}"; }
|
${kgetcred} ${server}@${R} || { ec=1 ; eval "${testfailed}"; }
|
||||||
${kdestroy}
|
${kdestroy}
|
||||||
|
|
||||||
echo "Trying pk-init (principal in pki-mapping) $type"; > messages.log
|
echo "Trying pk-init (principal in pki-mapping) $type"; > messages.log
|
||||||
${kinit} $type -C FILE:${base}/pkinit.crt,${base}/pkinit.key foo@${R} || \
|
${kinit} $type -C FILE:${hx509_data}/pkinit.crt,${hx509_data}/pkinit.key foo@${R} || \
|
||||||
{ ec=1 ; eval "${testfailed}"; }
|
{ ec=1 ; eval "${testfailed}"; }
|
||||||
${kgetcred} ${server}@${R} || { ec=1 ; eval "${testfailed}"; }
|
${kgetcred} ${server}@${R} || { ec=1 ; eval "${testfailed}"; }
|
||||||
${kdestroy}
|
${kdestroy}
|
||||||
|
|
||||||
echo "Trying pk-init (password protected key) $type"; > messages.log
|
echo "Trying pk-init (password protected key) $type"; > messages.log
|
||||||
${kinit} $type -C FILE:${base}/pkinit.crt,${base}/pkinit-pw.key --password-file=${objdir}/foopassword foo@${R} || \
|
${kinit} $type -C FILE:${hx509_data}/pkinit.crt,${hx509_data}/pkinit-pw.key --password-file=${objdir}/foopassword foo@${R} || \
|
||||||
{ ec=1 ; eval "${testfailed}"; }
|
{ ec=1 ; eval "${testfailed}"; }
|
||||||
${kgetcred} ${server}@${R} || \
|
${kgetcred} ${server}@${R} || \
|
||||||
{ ec=1 ; eval "${testfailed}"; }
|
{ ec=1 ; eval "${testfailed}"; }
|
||||||
${kdestroy}
|
${kdestroy}
|
||||||
|
|
||||||
echo "Trying pk-init (proxy cert) $type"; > messages.log
|
echo "Trying pk-init (proxy cert) $type"; > messages.log
|
||||||
${kinit} $type -C FILE:${base}/pkinit-proxy-chain.crt,${base}/pkinit-proxy.key foo@${R} || \
|
${kinit} $type -C FILE:${hx509_data}/pkinit-proxy-chain.crt,${hx509_data}/pkinit-proxy.key foo@${R} || \
|
||||||
{ ec=1 ; eval "${testfailed}"; }
|
{ ec=1 ; eval "${testfailed}"; }
|
||||||
${kgetcred} ${server}@${R} || { ec=1 ; eval "${testfailed}"; }
|
${kgetcred} ${server}@${R} || { ec=1 ; eval "${testfailed}"; }
|
||||||
${kdestroy}
|
${kdestroy}
|
||||||
@@ -426,7 +425,7 @@ if test "$pkinit" = yes -a "$rsa" = yes ; then
|
|||||||
if test "$ecdsa" = yes > /dev/null ; then
|
if test "$ecdsa" = yes > /dev/null ; then
|
||||||
echo "Trying pk-init (ec certificate)"
|
echo "Trying pk-init (ec certificate)"
|
||||||
> messages.log
|
> messages.log
|
||||||
${kinit} -C FILE:${base}/pkinit-ec.crt,${base}/pkinit-ec.key bar@${R} || \
|
${kinit} -C FILE:${hx509_data}/pkinit-ec.crt,${hx509_data}/pkinit-ec.key bar@${R} || \
|
||||||
{ ec=1 ; eval "${testfailed}"; }
|
{ ec=1 ; eval "${testfailed}"; }
|
||||||
${kgetcred} ${server}@${R} || { ec=1 ; eval "${testfailed}"; }
|
${kgetcred} ${server}@${R} || { ec=1 ; eval "${testfailed}"; }
|
||||||
${kdestroy}
|
${kdestroy}
|
||||||
|
@@ -35,9 +35,10 @@
|
|||||||
#
|
#
|
||||||
|
|
||||||
top_builddir="@top_builddir@"
|
top_builddir="@top_builddir@"
|
||||||
|
env_setup="@env_setup@"
|
||||||
objdir="."
|
objdir="."
|
||||||
|
|
||||||
. ${top_builddir}/tests/bin/setup-env
|
. ${env_setup}
|
||||||
|
|
||||||
srcdir="${top_srcdir}/tests/kdc"
|
srcdir="${top_srcdir}/tests/kdc"
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user