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