3 if test $# -eq 0 ; then
8 if test $# -eq 1 ; then
12 echo "running defines.sh $SRCDIR $BACKEND"
14 . $SRCDIR/scripts/defines.sh
16 echo "Datadir is $DATADIR"
18 echo "Cleaning up in $DBDIR..."
22 echo "Running ldif2ldbm to build slapd database..."
23 $LDIF2LDBM -f $CONF -i $LDIF -e ../servers/slapd/tools
25 if test $RC != 0 ; then
26 echo "ldif2ldbm failed!"
30 echo "Starting slapd on TCP/IP port $PORT..."
31 $SLAPD -f $CONF -p $PORT -d $LVL $TIMING > $MASTERLOG 2>&1 &
34 echo "Using ldapsearch to retrieve all the entries..."
35 for i in 0 1 2 3 4 5; do
36 $LDAPSEARCH -L -S "" -b "$BASEDN" -h localhost -p $PORT \
37 'objectClass=*' > $SEARCHOUT 2>&1
39 if test $RC = 1 ; then
40 echo "Waiting 5 seconds for slapd to start..."
47 if test $RC != 0 ; then
48 echo "ldapsearch failed!"
52 echo "Filtering ldapsearch results..."
53 . $SRCDIR/scripts/acfilter.sh < $SEARCHOUT > $SEARCHFLT
54 echo "Filtering original ldif used to create database..."
55 . $SRCDIR/scripts/acfilter.sh < $LDIF > $LDIFFLT
56 echo "Comparing filter output..."
57 cmp $SEARCHFLT $LDIFFLT
59 if test $? != 0 ; then
60 echo "comparison failed - database was not created correctly"
64 echo ">>>>> Test succeeded"