5 if test $# -ge 1 ; then
9 . $SRCDIR/scripts/args.sh $*
11 echo "running defines.sh"
12 . $SRCDIR/scripts/defines.sh
14 echo "Datadir is $DATADIR"
16 echo "Cleaning up in $DBDIR..."
20 echo "Running slapadd to build slapd database..."
21 . $CONFFILTER $BACKEND $MONITORDB < $CONF > $ADDCONF
22 $SLAPADD -f $ADDCONF -l $LDIFORDERED
24 if test $RC != 0 ; then
25 echo "slapadd failed ($RC)!"
29 echo "Starting slapd on TCP/IP port $PORT..."
30 . $CONFFILTER $BACKEND $MONITORDB < $CONF > $DBCONF
31 $SLAPD -f $DBCONF -h $MASTERURI -d $LVL $TIMING > $MASTERLOG 2>&1 &
33 if test $WAIT != 0 ; then
38 echo "Using ldapsearch to retrieve all the entries..."
39 for i in 0 1 2 3 4 5; do
40 $LDAPSEARCH -S "" -b "$BASEDN" -h $LOCALHOST -p $PORT > $SEARCHOUT 2>&1
42 if test $RC = 0 ; then
45 echo "Waiting 5 seconds for slapd to start..."
51 if test $RC != 0 ; then
52 echo "ldapsearch failed ($RC)!"
56 echo "Filtering ldapsearch results..."
57 . $LDIFFILTER < $SEARCHOUT > $SEARCHFLT
58 echo "Filtering original ldif used to create database..."
59 . $LDIFFILTER < $LDIF > $LDIFFLT
60 echo "Comparing filter output..."
61 $CMP $SEARCHFLT $LDIFFLT > $CMPOUT
63 if test $? != 0 ; then
64 echo "comparison failed - database was not created correctly"
65 echo $SEARCHFLT $LDIFFLT
66 $DIFF $SEARCHFLT $LDIFFLT
70 echo ">>>>> Test succeeded"