1#!/bin/sh 2 3if [ -z "$LDBDIR" ]; then 4 LDBDIR=`dirname $0`/.. 5 export LDBDIR 6fi 7 8rm -rf tests/tmp/db 9mkdir -p tests/tmp/db 10 11if [ -f tests/tmp/slapd.pid ]; then 12 kill `cat tests/tmp/slapd.pid` 13 sleep 1 14fi 15if [ -f tests/tmp/slapd.pid ]; then 16 kill -9 `cat tests/tmp/slapd.pid` 17 rm -f tests/tmp/slapd.pid 18fi 19 20# we don't consider a slapadd failure as a test suite failure, as it 21# has nothing to do with ldb 22 23MODCONF=tests/tmp/modules.conf 24rm -f $MODCONF 25touch $MODCONF || exit 1 26 27slaptest -u -f $LDBDIR/tests/slapd.conf > /dev/null 2>&1 || { 28 echo "enabling sladp modules" 29cat > $MODCONF <<EOF 30modulepath /usr/lib/ldap 31moduleload back_bdb 32EOF 33} 34 35slaptest -u -f $LDBDIR/tests/slapd.conf || { 36 echo "slaptest failed - skipping ldap tests" 37 exit 0 38} 39 40slapadd -f $LDBDIR/tests/slapd.conf < $LDBDIR/tests/init.ldif || exit 0 41 42