5 if test $# -ge 1 ; then
9 if test $# -ge 1 ; then
13 echo "running defines.sh"
14 . $SRCDIR/scripts/defines.sh
16 echo "Cleaning up in $DBDIR..."
20 echo "Starting slapd on TCP/IP port $PORT..."
21 . $CONFFILTER $BACKEND < $CONF > $DBCONF
22 $SLAPD -f $DBCONF -h $MASTERURI -d $LVL $TIMING > $MASTERLOG 2>&1 &
25 echo "Using ldapsearch to check that slapd is running..."
26 for i in 0 1 2 3 4 5; do
27 $LDAPSEARCH -s base -b "$MONITOR" -h localhost -p $PORT \
28 'objectclass=*' > /dev/null 2>&1
30 if test $RC = 1 ; then
31 echo "Waiting 5 seconds for slapd to start..."
36 echo "Using ldapadd to populate the database..."
37 $LDAPADD -D "$MANAGERDN" -h localhost -p $PORT -w $PASSWD < \
38 $LDIFORDERED > $TESTOUT 2>&1
40 if test $RC != 0 ; then
41 echo "ldapadd failed ($RC)!"
46 echo "Using ldapsearch to read all the entries..."
47 $LDAPSEARCH -S "" -b "$BASEDN" -h localhost -p $PORT \
48 'objectclass=*' > $SEARCHOUT 2>&1
52 if test $RC != 0 ; then
53 echo "ldapsearch failed ($RC)!"
57 echo "Filtering ldapsearch results..."
58 . $LDIFFILTER < $SEARCHOUT > $SEARCHFLT
59 echo "Filtering original ldif used to create database..."
60 . $LDIFFILTER < $LDIF > $LDIFFLT
61 echo "Comparing filter output..."
62 $CMP $SEARCHFLT $LDIFFLT > $CMPOUT
64 if test $? != 0 ; then
65 echo "comparison failed - database was not created correctly"
69 echo ">>>>> Test succeeded"