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