--- /dev/null
+# $OpenLDAP$
+#
+# stand-alone slapd config -- for testing
+# with indexing
+#
+ucdata-path ./ucdata
+include ./schema/core.schema
+include ./schema/cosine.schema
+include ./schema/inetorgperson.schema
+include ./schema/openldap.schema
+include ./schema/nis.schema
+#
+pidfile ./testrun/slapd.2.pid
+argsfile ./testrun/slapd.2.args
+
+modulepath ../servers/slapd/back-@BACKEND@/
+@MODULELOAD@
+
+
+#######################################################################
+# database definitions
+#######################################################################
+
+database @BACKEND@
+suffix "o=University of Michigan,c=US"
+directory ./testrun/db.2.a
+rootdn "cn=Manager,o=University of Michigan,c=US"
+rootpw secret
+index objectClass eq
+index cn,sn,uid pres,eq,sub
+
CLEAN=no
WAIT=0
KILLSERVERS=yes
-PRESERVE=no
+PRESERVE=${PRESERVE-no}
USERDATA=no
while test $# -gt 0 ; do
if test $PRESERVE = no ; then
echo "Cleaning up test run directory leftover from previous run."
/bin/rm -rf testrun
- else
+ elif test $PRESERVE = yes ; then
echo "Cleaning up only database directories leftover from previous run."
/bin/rm -rf testrun/db.*
fi
DBDIR5=$TESTDIR/db.5.a
DBDIR6=$TESTDIR/db.6.a
-DBDIR=./test-db
-CACHEDIR=./test-db2
-REPLDIR=./test-repl
-
CONF=$DATADIR/slapd.conf
+CONFTWO=$DATADIR/slapd2.conf
MCONF=$DATADIR/slapd-master.conf
PWCONF=$DATADIR/slapd-pw.conf
ACLCONF=$DATADIR/slapd-acl.conf
+++ /dev/null
-#! /bin/sh
-# $OpenLDAP$
-
-SRCDIR="."
-if test $# -ge 1 ; then
- SRCDIR=$1; shift
-fi
-BACKEND=bdb
-if test $# -ge 1 ; then
- BACKEND=$1; shift
-fi
-
-echo "running defines.sh"
-. $SRCDIR/scripts/defines.sh
-
-echo "Datadir is $DATADIR"
-
-echo "Cleaning up in $DBDIR..."
-
-rm -f $DBDIR/[!C]*
-
-echo "Running slapadd to build slapd database..."
-. $CONFFILTER $BACKEND < $CONF > $ADDCONF
-$SLAPADD -f $ADDCONF -l $LDIFORDERED
-RC=$?
-if test $RC != 0 ; then
- echo "slapadd failed ($RC)!"
- exit $RC
-fi
-
-echo "Starting slapd on TCP/IP port $PORT..."
-. $CONFFILTER $BACKEND < $CONF > $DBCONF
-$SLAPD -f $DBCONF -h $MASTERURI -d $LVL $TIMING > $MASTERLOG 2>&1 &
-PID=$!
-
-echo "Using ldapsearch to retrieve all the entries..."
-for i in 0 1 2 3 4 5; do
- $LDAPSEARCH -S "" -b "$BASEDN" -h $LOCALHOST -p $PORT > $SEARCHOUT 2>&1
- RC=$?
- if test $RC = 1 ; then
- echo "Waiting 5 seconds for slapd to start..."
- sleep 5
- fi
-done
-
-# kill -HUP $PID
-
-if test $RC != 0 ; then
- echo "ldapsearch failed ($RC)!"
- exit $RC
-fi
-
-echo "Filtering ldapsearch results..."
-. $LDIFFILTER < $SEARCHOUT > $SEARCHFLT
-echo "Filtering original ldif used to create database..."
-. $LDIFFILTER < $LDIF > $LDIFFLT
-echo "Comparing filter output..."
-$CMP $SEARCHFLT $LDIFFLT > $CMPOUT
-
-if test $? != 0 ; then
- echo "comparison failed - database was not created correctly"
- exit 1
-fi
-
-echo ">>>>> Master (pid=$PID) started"
-
-
-exit 0
+++ /dev/null
-#! /bin/sh
-# $OpenLDAP$
-
-SRCDIR="."
-if test $# -ge 1 ; then
- SRCDIR=$1; shift
-fi
-BACKEND=bdb
-if test $# -ge 1 ; then
- BACKEND=$1; shift
-fi
-
-echo "running defines.sh"
-. $SRCDIR/scripts/defines.sh
-
-echo "Datadir is $DATADIR"
-
-echo "Cleaning up in $DBDIR..."
-
-rm -f $DBDIR/[!C]*
-
-echo "Running slapadd to build slapd database..."
-. $CONFFILTER $BACKEND < $CONF > $ADDCONF
-$SLAPADD -f $ADDCONF -l $LDIFORDERED
-RC=$?
-if test $RC != 0 ; then
- echo "slapadd failed ($RC)!"
- exit $RC
-fi
-
-echo "Starting slapd on TCP/IP port $PORT..."
-. $CONFFILTER $BACKEND < $CONF > $DBCONF
-$SLAPD -f $DBCONF -h $MASTERURI -d $LVL $TIMING >> /dev/null 2>&1 &
-PID=$!
-
-echo "Using ldapsearch to retrieve all the entries..."
-for i in 0 1 2 3 4 5; do
- $LDAPSEARCH -S "" -b "$BASEDN" -h $LOCALHOST -p $PORT > $SEARCHOUT 2>&1
- RC=$?
- if test $RC = 1 ; then
- echo "Waiting 5 seconds for slapd to start..."
- sleep 5
- fi
-done
-
-# kill -HUP $PID
-
-if test $RC != 0 ; then
- echo "ldapsearch failed ($RC)!"
- exit $RC
-fi
-
-echo "Filtering ldapsearch results..."
-. $LDIFFILTER < $SEARCHOUT > $SEARCHFLT
-echo "Filtering original ldif used to create database..."
-. $LDIFFILTER < $LDIF > $LDIFFLT
-echo "Comparing filter output..."
-$CMP $SEARCHFLT $LDIFFLT > $CMPOUT
-
-if test $? != 0 ; then
- echo "comparison failed - database was not created correctly"
- exit 1
-fi
-
-echo ">>>>> Master (pid=$PID) started"
-
-
-exit 0
--- /dev/null
+#! /bin/sh
+# $OpenLDAP$
+
+echo "running defines.sh"
+. $SRCDIR/scripts/defines.sh
+
+mkdir -p $TESTDIR $DBDIR1
+
+echo "Running slapadd to build slapd database..."
+. $CONFFILTER $BACKEND < $CONF > $ADDCONF
+$SLAPADD -f $ADDCONF -l $LDIFORDERED
+RC=$?
+if test $RC != 0 ; then
+ echo "slapadd failed ($RC)!"
+ exit $RC
+fi
+
+echo "Starting slapd on TCP/IP port $PORT1..."
+. $CONFFILTER $BACKEND < $CONF > $CONF1
+$SLAPD -f $CONF1 -h $URI1 -d $LVL $TIMING > $LOG1 2>&1 &
+PID=$!
+
+echo "Using ldapsearch to retrieve all the entries..."
+for i in 0 1 2 3 4 5; do
+ $LDAPSEARCH -S "" -b "$BASEDN" -h $LOCALHOST -p $PORT1 > $SEARCHOUT 2>&1
+ RC=$?
+ if test $RC = 1 ; then
+ echo "Waiting 5 seconds for slapd to start..."
+ sleep 5
+ fi
+done
+
+if test $RC != 0 ; then
+ echo "ldapsearch failed ($RC)!"
+ exit $RC
+fi
+
+echo "Filtering ldapsearch results..."
+. $LDIFFILTER < $SEARCHOUT > $SEARCHFLT
+echo "Filtering original ldif used to create database..."
+. $LDIFFILTER < $LDIF > $LDIFFLT
+echo "Comparing filter output..."
+$CMP $SEARCHFLT $LDIFFLT > $CMPOUT
+
+if test $? != 0 ; then
+ echo "comparison failed - database was not created correctly"
+ exit 1
+fi
+
+echo ">>>>> Server1 (pid=$PID) started"
+exit 0
--- /dev/null
+#! /bin/sh
+# $OpenLDAP$
+
+echo "running defines.sh"
+. $SRCDIR/scripts/defines.sh
+
+mkdir -p $TESTDIR $DBDIR1
+
+echo "Running slapadd to build slapd database..."
+. $CONFFILTER $BACKEND < $CONF > $ADDCONF
+$SLAPADD -f $ADDCONF -l $LDIFORDERED
+RC=$?
+if test $RC != 0 ; then
+ echo "slapadd failed ($RC)!"
+ exit $RC
+fi
+
+echo "Starting slapd on TCP/IP port $PORT1..."
+. $CONFFILTER $BACKEND < $CONF > $CONF1
+$SLAPD -f $CONF1 -h $URI1 -d $LVL $TIMING >> /dev/null 2>&1 &
+PID=$!
+
+echo "Using ldapsearch to retrieve all the entries..."
+for i in 0 1 2 3 4 5; do
+ $LDAPSEARCH -S "" -b "$BASEDN" -h $LOCALHOST -p $PORT1 > $SEARCHOUT 2>&1
+ RC=$?
+ if test $RC = 1 ; then
+ echo "Waiting 5 seconds for slapd to start..."
+ sleep 5
+ fi
+done
+
+if test $RC != 0 ; then
+ echo "ldapsearch failed ($RC)!"
+ exit $RC
+fi
+
+echo "Filtering ldapsearch results..."
+. $LDIFFILTER < $SEARCHOUT > $SEARCHFLT
+echo "Filtering original ldif used to create database..."
+. $LDIFFILTER < $LDIF > $LDIFFLT
+echo "Comparing filter output..."
+$CMP $SEARCHFLT $LDIFFLT > $CMPOUT
+
+if test $? != 0 ; then
+ echo "comparison failed - database was not created correctly"
+ exit 1
+fi
+
+echo ">>>>> Server1 (pid=$PID) started"
+exit 0
--- /dev/null
+#! /bin/sh
+# $OpenLDAP$
+
+echo "running defines.sh"
+. $SRCDIR/scripts/defines.sh
+
+mkdir -p $TESTDIR $DBDIR2
+
+echo "Starting slapd on TCP/IP port $PORT2..."
+. $CONFFILTER $BACKEND < $CONFTWO > $CONF2
+$SLAPD -f $CONF2 -h $URI2 -d $LVL $TIMING > $LOG2 2>&1 &
+PID=$!
+
+echo "Using ldapsearch to retrieve all the entries..."
+for i in 0 1 2 3 4 5; do
+ $LDAPSEARCH -S "" -b "" -s base -h $LOCALHOST -p $PORT2 > $SERVER2OUT 2>&1
+ RC=$?
+ if test $RC = 1 ; then
+ echo "Waiting 5 seconds for slapd to start..."
+ sleep 5
+ fi
+done
+
+if test $RC != 0 ; then
+ echo "ldapsearch failed ($RC)!"
+ exit $RC
+fi
+
+echo ">>>>> Server2 (pid=$PID) started"
+exit 0
--- /dev/null
+#! /bin/sh
+# $OpenLDAP$
+
+echo "running defines.sh"
+. $SRCDIR/scripts/defines.sh
+
+mkdir -p $TESTDIR $DBDIR2
+
+echo "Starting slapd on TCP/IP port $PORT2..."
+. $CONFFILTER $BACKEND < $CONFTWO > $CONF2
+$SLAPD -f $CONF2 -h $URI2 -d $LVL $TIMING > /dev/null 2>&1 &
+PID=$!
+
+echo "Using ldapsearch to retrieve all the entries..."
+for i in 0 1 2 3 4 5; do
+ $LDAPSEARCH -S "" -b "" -s base -h $LOCALHOST -p $PORT2 > $SERVER2OUT 2>&1
+ RC=$?
+ if test $RC = 1 ; then
+ echo "Waiting 5 seconds for slapd to start..."
+ sleep 5
+ fi
+done
+
+if test $RC != 0 ; then
+ echo "ldapsearch failed ($RC)!"
+ exit $RC
+fi
+
+echo ">>>>> Server2 (pid=$PID) started"
+exit 0
+++ /dev/null
-#! /bin/sh
-#
-# Strip attribute from LDIF
-#
-awk '/^'$1'/ {getline; while (substr($0,1,1) == " ") getline;} /.*/ {print $0}'