4 echo "running defines.sh"
5 . $SRCDIR/scripts/defines.sh
7 mkdir -p $TESTRUN $DBDIR1
9 echo "Starting slapd on TCP/IP port $PORT1..."
10 . $CONFFILTER $BACKEND $MONITORDB < $CONF > $CONF1
11 $SLAPD -f $CONF1 -h $URI1 -d $LVL $TIMING > $LOG1 2>&1 &
13 if test $WAIT != 0 ; then
19 echo "Using ldapsearch to check that slapd is running..."
20 for i in 0 1 2 3 4 5; do
21 $LDAPSEARCH -s base -b "$MONITOR" -h $LOCALHOST -p $PORT1 \
22 'objectclass=*' > /dev/null 2>&1
24 if test $RC = 0 ; then
27 echo "Waiting 5 seconds for slapd to start..."
31 echo "Using ldapadd to populate the database..."
32 $LDAPADD -D "$MANAGERDN" -h $LOCALHOST -p $PORT1 -w $PASSWD < \
33 $LDIFORDERED > $TESTOUT 2>&1
35 if test $RC != 0 ; then
36 echo "ldapadd failed ($RC)!"
37 test $KILLSERVERS != no && kill -HUP $KILLPIDS
41 echo "Using ldapsearch to read all the entries..."
42 $LDAPSEARCH -S "" -b "$BASEDN" -h $LOCALHOST -p $PORT1 \
43 'objectclass=*' > $SEARCHOUT 2>&1
46 test $KILLSERVERS != no && kill -HUP $KILLPIDS
48 if test $RC != 0 ; then
49 echo "ldapsearch failed ($RC)!"
53 echo "Filtering ldapsearch results..."
54 . $LDIFFILTER < $SEARCHOUT > $SEARCHFLT
55 echo "Filtering original ldif used to create database..."
56 . $LDIFFILTER < $LDIF > $LDIFFLT
57 echo "Comparing filter output..."
58 $CMP $SEARCHFLT $LDIFFLT > $CMPOUT
60 if test $? != 0 ; then
61 echo "comparison failed - database was not created correctly"
65 echo ">>>>> Test succeeded"