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 "Cleaning up in $DBDIR..."
28 echo "Starting slapd on TCP/IP port $PORT..."
29 . $CONFFILTER $BACKEND $MONITORDB < $CONF > $DBCONF
30 $SLAPD -f $DBCONF -h $MASTERURI -d $LVL $TIMING > $MASTERLOG 2>&1 &
32 if test $WAIT != 0 ; then
37 echo "Using ldapsearch to check that slapd is running..."
38 for i in 0 1 2 3 4 5; do
39 $LDAPSEARCH -s base -b "$MONITOR" -h $LOCALHOST -p $PORT \
40 'objectclass=*' > /dev/null 2>&1
42 if test $RC = 1 ; then
43 echo "Waiting 5 seconds for slapd to start..."
48 echo "Using ldapadd to populate the database..."
49 $LDAPADD -D "$MANAGERDN" -h $LOCALHOST -p $PORT -w $PASSWD < \
50 $LDIFORDERED > $TESTOUT 2>&1
52 if test $RC != 0 ; then
53 echo "ldapadd failed ($RC)!"
58 echo "Using ldapsearch to read all the entries..."
59 $LDAPSEARCH -S "" -b "$BASEDN" -h $LOCALHOST -p $PORT \
60 'objectclass=*' > $SEARCHOUT 2>&1
65 if test $RC != 0 ; then
66 echo "ldapsearch failed ($RC)!"
70 echo "Filtering ldapsearch results..."
71 . $LDIFFILTER < $SEARCHOUT > $SEARCHFLT
72 echo "Filtering original ldif used to create database..."
73 . $LDIFFILTER < $LDIF > $LDIFFLT
74 echo "Comparing filter output..."
75 $CMP $SEARCHFLT $LDIFFLT > $CMPOUT
77 if test $? != 0 ; then
78 echo "comparison failed - database was not created correctly"
82 echo ">>>>> Test succeeded"