4 echo "running defines.sh"
5 . $SRCDIR/scripts/defines.sh
7 mkdir -p $TESTRUN $DBDIR1
9 echo "Running slapadd to build slapd database..."
10 . $CONFFILTER $BACKEND $MONITORDB < $CONF > $ADDCONF
11 $SLAPADD -f $ADDCONF -l $LDIFORDERED
13 if test $RC != 0 ; then
14 echo "slapadd failed ($RC)!"
18 echo "Starting slapd on TCP/IP port $PORT1..."
19 . $CONFFILTER $BACKEND $MONITORDB < $CONF > $CONF1
20 $SLAPD -f $CONF1 -h $URI1 -d $LVL $TIMING > $LOG1 2>&1 &
22 if test $WAIT != 0 ; then
28 echo "Using ldapsearch to retrieve all the entries..."
29 for i in 0 1 2 3 4 5; do
30 $LDAPSEARCH -S "" -b "$BASEDN" -h $LOCALHOST -p $PORT1 > $SEARCHOUT 2>&1
32 if test $RC = 0 ; then
35 echo "Waiting 5 seconds for slapd to start..."
39 test $KILLSERVERS != no && kill -HUP $KILLPIDS
41 if test $RC != 0 ; then
42 echo "ldapsearch failed ($RC)!"
46 echo "Filtering ldapsearch results..."
47 . $LDIFFILTER < $SEARCHOUT > $SEARCHFLT
48 echo "Filtering original ldif used to create database..."
49 . $LDIFFILTER < $LDIF > $LDIFFLT
50 echo "Comparing filter output..."
51 $CMP $SEARCHFLT $LDIFFLT > $CMPOUT
53 if test $? != 0 ; then
54 echo "comparison failed - database was not created correctly"
55 echo $SEARCHFLT $LDIFFLT
56 $DIFF $SEARCHFLT $LDIFFLT
60 echo ">>>>> Test succeeded"