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 = 0 ; then
55 echo "Waiting 5 seconds for slapd to start..."
61 if test $RC != 0 ; then
62 echo "ldapsearch failed ($RC)!"
66 echo "Filtering ldapsearch results..."
67 . $LDIFFILTER < $SEARCHOUT > $SEARCHFLT
68 echo "Filtering original ldif used to create database..."
69 . $LDIFFILTER < $LDIF > $LDIFFLT
70 echo "Comparing filter output..."
71 $CMP $SEARCHFLT $LDIFFLT > $CMPOUT
73 if test $? != 0 ; then
74 echo "comparison failed - database was not created correctly"
75 echo $SEARCHFLT $LDIFFLT
76 $DIFF $SEARCHFLT $LDIFFLT
80 echo ">>>>> Test succeeded"