5 if test $# -ge 1 ; then
9 if test $# -ge 1 ; then
13 if test $# -ge 1 ; then
17 echo "running defines.sh"
18 . $SRCDIR/scripts/defines.sh
20 echo "Datadir is $DATADIR"
22 echo "Cleaning up in $DBDIR..."
26 echo "Running slapadd to build slapd database..."
27 . $CONFFILTER $BACKEND < $CONF > $ADDCONF
28 $SLAPADD -f $ADDCONF -l $LDIFORDERED
30 if test $RC != 0 ; then
31 echo "slapadd failed ($RC)!"
35 echo "Starting slapd on TCP/IP port $PORT..."
36 . $CONFFILTER $BACKEND < $CONF > $DBCONF
37 $SLAPD -f $DBCONF -h $MASTERURI -d $LVL $TIMING > $MASTERLOG 2>&1 &
39 if test $WAIT != 0 ; then
44 echo "Using ldapsearch to retrieve all the entries..."
45 for i in 0 1 2 3 4 5; do
46 $LDAPSEARCH -S "" -b "$BASEDN" -h localhost:$PORT > $SEARCHOUT 2>&1
48 if test $RC = 1 ; then
49 echo "Waiting 5 seconds for slapd to start..."
56 if test $RC != 0 ; then
57 echo "ldapsearch failed ($RC)!"
61 echo "Filtering ldapsearch results..."
62 . $LDIFFILTER < $SEARCHOUT > $SEARCHFLT
63 echo "Filtering original ldif used to create database..."
64 . $LDIFFILTER < $LDIF > $LDIFFLT
65 echo "Comparing filter output..."
66 $CMP $SEARCHFLT $LDIFFLT > $CMPOUT
68 if test $? != 0 ; then
69 echo "comparison failed - database was not created correctly"
70 echo $SEARCHFLT $LDIFFLT
71 diff -iu $SEARCHFLT $LDIFFLT
75 echo ">>>>> Test succeeded"