5 if test $# -ge 1 ; then
9 if test $# -ge 1 ; then
13 if test $# -ge 1 ; then
17 echo "running defines.sh"
18 . $SRCDIR/scripts/defines.sh
20 echo "Datadir is $DATADIR"
22 echo "Cleaning up in $DBDIR..."
26 echo "Running slapadd to build slapd database..."
27 . $CONFFILTER $BACKEND < $CONF > $DBCONF
28 $SLAPADD -f $DBCONF -l $LDIFORDERED
30 if test $RC != 0 ; then
31 echo "slapadd failed ($RC)!"
35 echo "Waiting 5 seconds for slapadd to build slapd database..."
38 echo "Starting slapd on TCP/IP port $PORT..."
39 $SLAPD -f $DBCONF -h $MASTERURI -d $LVL $TIMING > $MASTERLOG 2>&1 &
41 if test $WAIT != 0 ; then
46 echo "Using ldapsearch to check that slapd is running..."
47 for i in 0 1 2 3 4 5; do
48 $LDAPSEARCH -s base -b "$MONITOR" -h localhost -p $PORT \
49 'objectclass=*' > /dev/null 2>&1
51 if test $RC = 1 ; then
52 echo "Waiting 5 seconds for slapd to start..."
57 echo "Using tester for concurrent server access..."
58 $SLAPDTESTER -b "$BASEDN" -P "$PROGDIR" -d "$DATADIR" -h localhost -p $PORT -D "$MANAGERDN" -w $PASSWD -l 50
61 if test $RC != 0 ; then
62 echo "slapd-tester failed ($RC)!"
66 echo "Using ldapsearch to retrieve all the entries..."
67 $LDAPSEARCH -S "" -b "$BASEDN" -h localhost -p $PORT \
68 'objectClass=*' > $SEARCHOUT 2>&1
73 if test $RC != 0 ; then
74 echo "ldapsearch failed ($RC)!"
78 echo "Filtering ldapsearch results..."
79 . $LDIFFILTER < $SEARCHOUT > $SEARCHFLT
80 echo "Filtering original ldif used to create database..."
81 . $LDIFFILTER < $LDIF > $LDIFFLT
82 echo "Comparing filter output..."
83 $CMP $SEARCHFLT $LDIFFLT > $CMPOUT
85 if test $? != 0 ; then
86 echo "comparison failed - database was not created correctly"
90 echo ">>>>> Test succeeded"