3 ## This work is part of OpenLDAP Software <http://www.openldap.org/>.
5 ## Copyright 1998-2003 The OpenLDAP Foundation.
6 ## All rights reserved.
8 ## Redistribution and use in source and binary forms, with or without
9 ## modification, are permitted only as authorized by the OpenLDAP
12 ## A copy of this license is available in the file LICENSE in the
13 ## top-level directory of the distribution or, alternatively, at
14 ## <http://www.OpenLDAP.org/license.html>.
16 USAGE="$0 [-b <backend>] [-c] [-k] [-p] [-u] [-w] <script>"
20 TOPSRCDIR="@top_srcdir@"
23 export SRCDIR TOPSRCDIR LN_S
28 AC_ldap=ldap@BUILD_LDAP@
29 AC_pcache=pcache@BUILD_PROXYCACHE@
30 AC_MONITOR=@BUILD_MONITOR@
31 AC_WITH_TLS=@WITH_TLS@
33 export AC_MONITOR AC_WITH_TLS AC_ldap AC_pcache
35 if test ! -x ../servers/slapd/slapd ; then
36 echo "Could not locate slapd(8)"
40 if test $AC_bdb != no ; then
42 elif test $AC_ldbm != no ; then
44 elif test $AC_hdb != no ; then
47 echo "Not configured with a suitable database backend"
54 PRESERVE=${PRESERVE-no}
57 while test $# -gt 0 ; do
96 BACKENDTYPE=`eval 'echo $AC_'$BACKEND`
97 export BACKEND BACKENDTYPE WAIT KILLSERVERS PRESERVE USERDATA
100 echo "$USAGE"; exit 1
103 SCRIPTDIR="${SRCDIR}/scripts"
107 if test -x "${SCRIPTDIR}/${SCRIPTNAME}" ; then
108 SCRIPT="${SCRIPTDIR}/${SCRIPTNAME}"
109 elif test -x "`echo ${SCRIPTDIR}/test*-${SCRIPTNAME}`"; then
110 SCRIPT="`echo ${SCRIPTDIR}/test*-${SCRIPTNAME}`"
111 elif test -x "`echo ${SCRIPTDIR}/${SCRIPTNAME}-*`"; then
112 SCRIPT="`echo ${SCRIPTDIR}/${SCRIPTNAME}-*`"
114 echo "run: ${SCRIPTNAME} not found (or not executable)"
118 if test ! -r testdata/test.ldif ; then
119 ${LN_S} ${SRCDIR}/data testdata
121 if test ! -r schema/core.schema ; then
122 ${LN_S} ${TOPSRCDIR}/servers/slapd/schema schema
124 if test ! -r ucdata/UnicodeData.txt ; then
125 ${LN_S} ../libraries/liblunicode ucdata
128 if test -d testrun ; then
129 if test $PRESERVE = no ; then
130 echo "Cleaning up test run directory leftover from previous run."
132 elif test $PRESERVE = yes ; then
133 echo "Cleaning up only database directories leftover from previous run."
134 /bin/rm -rf testrun/db.*
138 if test $USERDATA = yes ; then
139 if test ! -d userdata ; then
140 echo "User data directory (userdata) does not exist."
144 cp -R userdata/* testrun
147 # disable LDAP initialization
148 LDAPNOINIT=true; export LDAPNOINIT
150 echo "Running ${SCRIPT}..."
154 if test $CLEAN = yes ; then
155 echo "Cleaning up test run directory from this run."
157 echo "Cleaning up symlinks."
158 /bin/rm -f testdata schema ucdata