4 echo "running defines.sh"
5 . $SRCDIR/scripts/defines.sh
9 echo "Starting slapd on TCP/IP port $PORT..."
10 . $CONFFILTER $BACKEND $MONITORDB < $CONF > $DBCONF
11 $SLAPD -f $DBCONF -h $MASTERURI -d $LVL $TIMING > $MASTERLOG 2>&1 &
13 if test $WAIT != 0 ; then
18 echo "Using ldapsearch to check that slapd is running..."
19 for i in 0 1 2 3 4 5; do
20 $LDAPSEARCH -s base -b "$MONITOR" -h $LOCALHOST -p $PORT \
21 'objectclass=*' > /dev/null 2>&1
23 if test $RC = 0 ; then
26 echo "Waiting 5 seconds for slapd to start..."
30 echo "Using ldapadd to populate the database..."
31 $LDAPADD -D "$MANAGERDN" -h $LOCALHOST -p $PORT -w $PASSWD < \
32 $LDIFORDERED > $TESTOUT 2>&1
34 if test $RC != 0 ; then
35 echo "ldapadd failed ($RC)!"
40 echo "Using ldapsearch to read all the entries..."
41 $LDAPSEARCH -S "" -b "$BASEDN" -h $LOCALHOST -p $PORT \
42 'objectclass=*' > $SEARCHOUT 2>&1
47 if test $RC != 0 ; then
48 echo "ldapsearch failed ($RC)!"
52 echo "Filtering ldapsearch results..."
53 . $LDIFFILTER < $SEARCHOUT > $SEARCHFLT
54 echo "Filtering original ldif used to create database..."
55 . $LDIFFILTER < $LDIF > $LDIFFLT
56 echo "Comparing filter output..."
57 $CMP $SEARCHFLT $LDIFFLT > $CMPOUT
59 if test $? != 0 ; then
60 echo "comparison failed - database was not created correctly"
64 echo ">>>>> Test succeeded"