3 if test $# -eq 0 ; then
8 if test $# -eq 1 ; then
12 echo "running defines.sh $SRCDIR $BACKEND"
13 . $SRCDIR/scripts/defines.sh
15 echo "Cleaning up in $DBDIR..."
19 echo "Starting slapd on TCP/IP port $PORT..."
20 $SLAPD -f $CONF -p $PORT -d $LVL $TIMING > $MASTERLOG 2>&1 &
23 echo "Using ldapsearch to check that slapd is running..."
24 for i in 0 1 2 3 4 5; do
25 $LDAPSEARCH -L -b "$BASEDN" -h localhost -p $PORT \
26 'cn=Monitor' > /dev/null 2>&1
28 if test $RC = 1 ; then
29 echo "Waiting 5 seconds for slapd to start..."
34 echo "Using ldapadd to populate the database..."
35 $LDAPADD -D "$MANAGERDN" -h localhost -p $PORT -w $PASSWD < \
36 $LDIFORDERED > /dev/null 2>&1
38 if test $RC != 0 ; then
39 echo "ldapadd failed!"
44 echo "Using ldapsearch to read all the entries..."
45 $LDAPSEARCH -L -S "" -b "$BASEDN" -h localhost -p $PORT \
46 'objectclass=*' > $SEARCHOUT 2>&1
50 if test $RC != 0 ; then
51 echo "ldapsearch failed!"
55 echo "Filtering ldapsearch results..."
56 . $SRCDIR/scripts/acfilter.sh < $SEARCHOUT > $SEARCHFLT
57 echo "Filtering original ldif used to create database..."
58 . $SRCDIR/scripts/acfilter.sh < $LDIF > $LDIFFLT
59 echo "Comparing filter output..."
60 cmp $SEARCHFLT $LDIFFLT
62 if test $? != 0 ; then
63 echo "comparison failed - database was not created correctly"
67 echo ">>>>> Test succeeded"