#! /bin/sh
# $OpenLDAP$
-if test $# -eq 0 ; then
- SRCDIR="."
-else
+SRCDIR="."
+if test $# -ge 1 ; then
SRCDIR=$1; shift
fi
-if test $# -eq 1 ; then
+BACKEND=ldbm
+if test $# -ge 1 ; then
BACKEND=$1; shift
fi
+WAIT=0
+if test $# -ge 1 ; then
+ WAIT=1; shift
+fi
-echo "running defines.sh $SRCDIR $BACKEND"
+echo "running defines.sh"
. $SRCDIR/scripts/defines.sh
echo "Cleaning up in $DBDIR..."
rm -f $DBDIR/[!C]*
echo "Starting slapd on TCP/IP port $PORT..."
-$SLAPD -f $PWCONF -h $MASTERURI -d $LVL $TIMING > $MASTERLOG 2>&1 &
+. $CONFFILTER $BACKEND < $PWCONF > $DBCONF
+$SLAPD -f $DBCONF -h $MASTERURI -d $LVL $TIMING > $MASTERLOG 2>&1 &
PID=$!
+if test $WAIT != 0 ; then
+ echo PID $PID
+ read foo
+fi
echo "Using ldapsearch to check that slapd is running..."
for i in 0 1 2 3 4 5; do
echo "Pass 1" >> $TESTOUT
$LDAPPASSWD -h localhost -p $PORT \
-w secret -s newsecret \
- "cn=md5, $BASEDN" >> $TESTOUT 2>&1
+ -D "cn=md5, $BASEDN" >> $TESTOUT 2>&1
RC=$?
if test $RC != 0 ; then
echo "ldappasswd failed ($RC)!"
exit $RC
fi
$LDAPPASSWD -h localhost -p $PORT \
- -w secret -s newsecret \
- "cn=smd5, $BASEDN" >> $TESTOUT 2>&1
+ -w $PASSWD -s newsecret \
+ -D $MANAGERDN "cn=smd5, $BASEDN" >> $TESTOUT 2>&1
if test $RC != 0 ; then
echo "ldappasswd failed ($RC)!"
kill -HUP $PID
fi
$LDAPPASSWD -h localhost -p $PORT \
-w secret -s newsecret \
- "cn=sha, $BASEDN" >> $TESTOUT 2>&1
+ -D "cn=sha, $BASEDN" >> $TESTOUT 2>&1
if test $RC != 0 ; then
echo "ldappasswd failed ($RC)!"
kill -HUP $PID
fi
$LDAPPASSWD -h localhost -p $PORT \
-w secret -s newsecret \
- "cn=ssha, $BASEDN" >> $TESTOUT 2>&1
+ -D "cn=ssha, $BASEDN" >> $TESTOUT 2>&1
if test $RC != 0 ; then
echo "ldappasswd failed ($RC)!"
kill -HUP $PID
echo "Using ldappasswd (PASS 2) ..."
$LDAPPASSWD -h localhost -p $PORT \
-w newsecret \
- "cn=md5, $BASEDN" >> $TESTOUT 2>&1
+ -D "cn=md5, $BASEDN" >> $TESTOUT 2>&1
if test $RC != 0 ; then
echo "ldappasswd failed ($RC)!"
kill -HUP $PID
fi
$LDAPPASSWD -h localhost -p $PORT \
-w newsecret \
- "cn=smd5, $BASEDN" >> $TESTOUT 2>&1
+ -D "cn=smd5, $BASEDN" >> $TESTOUT 2>&1
if test $RC != 0 ; then
echo "ldappasswd failed ($RC)!"
kill -HUP $PID
fi
$LDAPPASSWD -h localhost -p $PORT \
-w newsecret \
- "cn=sha, $BASEDN" >> $TESTOUT 2>&1
+ -D "cn=sha, $BASEDN" >> $TESTOUT 2>&1
if test $RC != 0 ; then
echo "ldappasswd failed ($RC)!"
kill -HUP $PID
fi
$LDAPPASSWD -h localhost -p $PORT \
-w newsecret \
- "cn=ssha, $BASEDN" >> $TESTOUT 2>&1
+ -D "cn=ssha, $BASEDN" >> $TESTOUT 2>&1
if test $RC != 0 ; then
echo "ldappasswd failed ($RC)!"
kill -HUP $PID