5 if test $# -ge 1 ; then
9 if test $# -ge 1 ; then
13 echo "running defines.sh"
14 . $SRCDIR/scripts/defines.sh
16 echo "Datadir is $DATADIR"
18 echo "Cleaning up in $DBDIR..."
22 echo "Running slapadd to build slapd database..."
23 . $CONFFILTER $BACKEND < $CONF > $DBCONF
24 $SLAPADD -f $DBCONF -l $LDIFORDERED
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 $DBCONF -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 . $LDIFFILTER < $SEARCHOUT > $SEARCHFLT
72 echo "Filtering original ldif used to create database..."
73 . $LDIFFILTER < $LDIF > $LDIFFLT
74 echo "Comparing filter output..."
75 $CMP $SEARCHFLT $LDIFFLT > $CMPOUT
77 if test $? != 0 ; then
78 echo "comparison failed - database was not created correctly"
82 echo ">>>>> Test succeeded"