4 echo "running defines.sh"
5 . $SRCDIR/scripts/defines.sh
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 $PORT..."
19 . $CONFFILTER $BACKEND $MONITORDB < $CONF > $DBCONF
20 $SLAPD -f $DBCONF -h $MASTERURI -d $LVL $TIMING > $MASTERLOG 2>&1 &
22 if test $WAIT != 0 ; then
27 echo "Using ldapsearch to retrieve all the entries..."
28 for i in 0 1 2 3 4 5; do
29 $LDAPSEARCH -S "" -b "$BASEDN" -h $LOCALHOST -p $PORT > $SEARCHOUT 2>&1
31 if test $RC = 0 ; then
34 echo "Waiting 5 seconds for slapd to start..."
40 if test $RC != 0 ; then
41 echo "ldapsearch failed ($RC)!"
45 echo "Filtering ldapsearch results..."
46 . $LDIFFILTER < $SEARCHOUT > $SEARCHFLT
47 echo "Filtering original ldif used to create database..."
48 . $LDIFFILTER < $LDIF > $LDIFFLT
49 echo "Comparing filter output..."
50 $CMP $SEARCHFLT $LDIFFLT > $CMPOUT
52 if test $? != 0 ; then
53 echo "comparison failed - database was not created correctly"
54 echo $SEARCHFLT $LDIFFLT
55 $DIFF $SEARCHFLT $LDIFFLT
59 echo ">>>>> Test succeeded"