2 ## This work is part of OpenLDAP Software <http://www.openldap.org/>.
4 ## Copyright 1998-2003 The OpenLDAP Foundation.
5 ## All rights reserved.
7 ## Redistribution and use in source and binary forms, with or without
8 ## modification, are permitted only as authorized by the OpenLDAP
11 ## A copy of this license is available in the file LICENSE in the
12 ## top-level directory of the distribution or, alternatively, at
13 ## <http://www.OpenLDAP.org/license.html>.
15 USAGE="$0 [-b <backend>] [-c] [-k] [-p] [-u] [-w] <script>"
19 TOPSRCDIR="@top_srcdir@"
22 export SRCDIR TOPSRCDIR LN_S
27 AC_MONITOR=@BUILD_MONITOR@
28 AC_CACHE=@BUILD_CACHE@
29 AC_WITH_TLS=@WITH_TLS@
31 export AC_MONITOR AC_CACHE AC_WITH_TLS
33 if test ! -x ../servers/slapd/slapd ; then
34 echo "Could not locate slapd(8)"
38 if test $AC_BDB = yes ; then
40 elif test $AC_LDBM = yes ; then
42 elif test $AC_HDB = yes ; then
45 echo "Not configured with a suitable database backend"
52 PRESERVE=${PRESERVE-no}
55 while test $# -gt 0 ; do
94 export BACKEND WAIT KILLSERVERS PRESERVE USERDATA
100 SCRIPTDIR="${SRCDIR}/scripts"
104 if test -x "${SCRIPTDIR}/${SCRIPTNAME}" ; then
105 SCRIPT="${SCRIPTDIR}/${SCRIPTNAME}"
106 elif test -x "`echo ${SCRIPTDIR}/test*-${SCRIPTNAME}`"; then
107 SCRIPT="`echo ${SCRIPTDIR}/test*-${SCRIPTNAME}`"
108 elif test -x "`echo ${SCRIPTDIR}/${SCRIPTNAME}-*`"; then
109 SCRIPT="`echo ${SCRIPTDIR}/${SCRIPTNAME}-*`"
111 echo "run: ${SCRIPTNAME} not found (or not executable)"
115 if test ! -r testdata/test.ldif ; then
116 ${LN_S} ${SRCDIR}/data testdata
118 if test ! -r schema/core.schema ; then
119 ${LN_S} ${TOPSRCDIR}/servers/slapd/schema schema
121 if test ! -r ucdata/UnicodeData.txt ; then
122 ${LN_S} ../libraries/liblunicode ucdata
125 if test -d testrun ; then
126 if test $PRESERVE = no ; then
127 echo "Cleaning up test run directory leftover from previous run."
129 elif test $PRESERVE = yes ; then
130 echo "Cleaning up only database directories leftover from previous run."
131 /bin/rm -rf testrun/db.*
135 if test $USERDATA = yes ; then
136 if test ! -d userdata ; then
137 echo "User data directory (userdata) does not exist."
141 cp -R userdata/* testrun
144 # disable LDAP initialization
145 LDAPNOINIT=true; export LDAPNOINIT
147 echo "Running ${SCRIPT}..."
151 if test $CLEAN = yes ; then
152 echo "Cleaning up test run directory from this run."
154 echo "Cleaning up symlinks."
155 /bin/rm -f testdata schema ucdata