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_MONITOR=@BUILD_MONITOR@
29 AC_CACHE=@BUILD_CACHE@
30 AC_WITH_TLS=@WITH_TLS@
32 export AC_MONITOR AC_CACHE AC_WITH_TLS
34 if test ! -x ../servers/slapd/slapd ; then
35 echo "Could not locate slapd(8)"
39 if test $AC_bdb != no ; then
41 elif test $AC_ldbm != no ; then
43 elif test $AC_hdb != no ; then
46 echo "Not configured with a suitable database backend"
53 PRESERVE=${PRESERVE-no}
56 while test $# -gt 0 ; do
95 BACKENDTYPE=`eval 'echo $AC_'$BACKEND`
96 export BACKEND BACKENDTYPE WAIT KILLSERVERS PRESERVE USERDATA
102 SCRIPTDIR="${SRCDIR}/scripts"
106 if test -x "${SCRIPTDIR}/${SCRIPTNAME}" ; then
107 SCRIPT="${SCRIPTDIR}/${SCRIPTNAME}"
108 elif test -x "`echo ${SCRIPTDIR}/test*-${SCRIPTNAME}`"; then
109 SCRIPT="`echo ${SCRIPTDIR}/test*-${SCRIPTNAME}`"
110 elif test -x "`echo ${SCRIPTDIR}/${SCRIPTNAME}-*`"; then
111 SCRIPT="`echo ${SCRIPTDIR}/${SCRIPTNAME}-*`"
113 echo "run: ${SCRIPTNAME} not found (or not executable)"
117 if test ! -r testdata/test.ldif ; then
118 ${LN_S} ${SRCDIR}/data testdata
120 if test ! -r schema/core.schema ; then
121 ${LN_S} ${TOPSRCDIR}/servers/slapd/schema schema
123 if test ! -r ucdata/UnicodeData.txt ; then
124 ${LN_S} ../libraries/liblunicode ucdata
127 if test -d testrun ; then
128 if test $PRESERVE = no ; then
129 echo "Cleaning up test run directory leftover from previous run."
131 elif test $PRESERVE = yes ; then
132 echo "Cleaning up only database directories leftover from previous run."
133 /bin/rm -rf testrun/db.*
137 if test $USERDATA = yes ; then
138 if test ! -d userdata ; then
139 echo "User data directory (userdata) does not exist."
143 cp -R userdata/* testrun
146 # disable LDAP initialization
147 LDAPNOINIT=true; export LDAPNOINIT
149 echo "Running ${SCRIPT}..."
153 if test $CLEAN = yes ; then
154 echo "Cleaning up test run directory from this run."
156 echo "Cleaning up symlinks."
157 /bin/rm -f testdata schema ucdata