5 if test $# -ge 1 ; then
9 if test $# -ge 1 ; then
13 if test $# -ge 1 ; then
17 if test $# -ge 1 ; then
21 echo "running defines.sh"
22 . $SRCDIR/scripts/defines.sh
24 echo "Datadir is $DATADIR"
26 echo "Cleaning up in $DBDIR..."
30 echo "Running slapadd to build slapd database..."
31 . $CONFFILTER $BACKEND $MONITORDB < $CONF > $ADDCONF
32 $SLAPADD -f $ADDCONF -l $LDIFORDERED
34 if test $RC != 0 ; then
35 echo "slapadd failed ($RC)!"
39 echo "Starting slapd on TCP/IP port $PORT..."
40 . $CONFFILTER $BACKEND $MONITORDB < $CONF > $DBCONF
41 $SLAPD -f $DBCONF -h $MASTERURI -d $LVL $TIMING > $MASTERLOG 2>&1 &
43 if test $WAIT != 0 ; then
48 echo "Using ldapsearch to retrieve all the entries..."
49 for i in 0 1 2 3 4 5; do
50 $LDAPSEARCH -S "" -b "$BASEDN" -h $LOCALHOST -p $PORT > $SEARCHOUT 2>&1
52 if test $RC = 1 ; then
53 echo "Waiting 5 seconds for slapd to start..."
60 if test $RC != 0 ; then
61 echo "ldapsearch failed ($RC)!"
65 echo "Filtering ldapsearch results..."
66 . $LDIFFILTER < $SEARCHOUT > $SEARCHFLT
67 echo "Filtering original ldif used to create database..."
68 . $LDIFFILTER < $LDIF > $LDIFFLT
69 echo "Comparing filter output..."
70 $CMP $SEARCHFLT $LDIFFLT > $CMPOUT
72 if test $? != 0 ; then
73 echo "comparison failed - database was not created correctly"
74 echo $SEARCHFLT $LDIFFLT
75 $DIFF $SEARCHFLT $LDIFFLT
79 echo ">>>>> Test succeeded"