4 if test $# -eq 0 ; then
9 if test $# -eq 1 ; then
13 echo "running defines.sh $SRCDIR $BACKEND"
15 . $SRCDIR/scripts/defines.sh
17 echo "Datadir is $DATADIR"
19 echo "Cleaning up in $DBDIR..."
23 echo "Running slapadd to build slapd database..."
24 $LDIF2LDBM -f $CONF -l $LDIF
26 if test $RC != 0 ; then
27 echo "slapadd failed ($RC)!"
31 echo "Waiting 5 seconds for slapadd to build slapd database..."
34 echo "Starting slapd on TCP/IP port $PORT..."
35 $SLAPD -f $CONF -h $MASTERURI -d $LVL $TIMING > $MASTERLOG 2>&1 &
38 echo "Using ldapsearch to check that slapd is running..."
39 for i in 0 1 2 3 4 5; do
40 $LDAPSEARCH -s base -b "$MONITOR" -h localhost -p $PORT \
41 'objectclass=*' > /dev/null 2>&1
43 if test $RC = 1 ; then
44 echo "Waiting 5 seconds for slapd to start..."
49 echo "Using tester for concurrent server access..."
50 $SLAPDTESTER -b "$BASEDN" -P "$PROGDIR" -d "$DATADIR" -h localhost -p $PORT -D "$MANAGERDN" -w $PASSWD -l 50
53 if test $RC != 0 ; then
54 echo "slapd-tester failed ($RC)!"
58 echo "Using ldapsearch to retrieve 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 . $SRCDIR/scripts/acfilter.sh < $SEARCHOUT > $SEARCHFLT
72 echo "Filtering original ldif used to create database..."
73 . $SRCDIR/scripts/acfilter.sh < $LDIF > $LDIFFLT
74 echo "Comparing filter output..."
75 $CMP $SEARCHFLT $LDIFFLT
77 if test $? != 0 ; then
78 echo "comparison failed - database was not created correctly"
82 echo ">>>>> Test succeeded"