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 = yes ; then
41 elif test $AC_LDBM = yes ; then
43 elif test $AC_HDB = yes ; then
46 echo "Not configured with a suitable database backend"
53 PRESERVE=${PRESERVE-no}
56 while test $# -gt 0 ; do
95 export BACKEND WAIT KILLSERVERS PRESERVE USERDATA
101 SCRIPTDIR="${SRCDIR}/scripts"
105 if test -x "${SCRIPTDIR}/${SCRIPTNAME}" ; then
106 SCRIPT="${SCRIPTDIR}/${SCRIPTNAME}"
107 elif test -x "`echo ${SCRIPTDIR}/test*-${SCRIPTNAME}`"; then
108 SCRIPT="`echo ${SCRIPTDIR}/test*-${SCRIPTNAME}`"
109 elif test -x "`echo ${SCRIPTDIR}/${SCRIPTNAME}-*`"; then
110 SCRIPT="`echo ${SCRIPTDIR}/${SCRIPTNAME}-*`"
112 echo "run: ${SCRIPTNAME} not found (or not executable)"
116 if test ! -r testdata/test.ldif ; then
117 ${LN_S} ${SRCDIR}/data testdata
119 if test ! -r schema/core.schema ; then
120 ${LN_S} ${TOPSRCDIR}/servers/slapd/schema schema
122 if test ! -r ucdata/UnicodeData.txt ; then
123 ${LN_S} ../libraries/liblunicode ucdata
126 if test -d testrun ; then
127 if test $PRESERVE = no ; then
128 echo "Cleaning up test run directory leftover from previous run."
130 elif test $PRESERVE = yes ; then
131 echo "Cleaning up only database directories leftover from previous run."
132 /bin/rm -rf testrun/db.*
136 if test $USERDATA = yes ; then
137 if test ! -d userdata ; then
138 echo "User data directory (userdata) does not exist."
142 cp -R userdata/* testrun
145 # disable LDAP initialization
146 LDAPNOINIT=true; export LDAPNOINIT
148 echo "Running ${SCRIPT}..."
152 if test $CLEAN = yes ; then
153 echo "Cleaning up test run directory from this run."
155 echo "Cleaning up symlinks."
156 /bin/rm -f testdata schema ucdata