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 "Waiting 5 seconds for ldif2ldbm to build slapd database..."
33 echo "Starting slapd on TCP/IP port $PORT..."
34 $SLAPD -f $CONF -p $PORT -d $LVL $TIMING > $MASTERLOG 2>&1 &
37 echo "Waiting 5 seconds for slapd to start..."
40 echo "Using tester for concurrent server access..."
41 $SLAPDTESTER -b "$BASEDN" -P "$PROGDIR" -d "$DATADIR" -h localhost -p $PORT -D "$MANAGERDN" -w $PASSWD -l 50
44 if test $RC != 0 ; then
45 echo "slapd-tester failed!"
49 echo "Using ldapsearch to retrieve all the entries..."
50 $LDAPSEARCH -L -S "" -b "$BASEDN" -h localhost -p $PORT \
51 'objectClass=*' > $SEARCHOUT 2>&1
56 if test $RC != 0 ; then
57 echo "ldapsearch failed!"
61 echo "Filtering ldapsearch results..."
62 . $SRCDIR/scripts/acfilter.sh < $SEARCHOUT > $SEARCHFLT
63 echo "Filtering original ldif used to create database..."
64 . $SRCDIR/scripts/acfilter.sh < $LDIF > $LDIFFLT
65 echo "Comparing filter output..."
66 cmp $SEARCHFLT $LDIFFLT
68 if test $? != 0 ; then
69 echo "comparison failed - database was not created correctly"
73 echo ">>>>> Test succeeded"