5 if test $# -ge 1 ; then
9 . $SRCDIR/scripts/args.sh $*
11 echo "running defines.sh"
12 . $SRCDIR/scripts/defines.sh
14 echo "Datadir is $DATADIR"
16 echo "Cleaning up in $DBDIR..."
20 echo "Running slapadd to build slapd database..."
21 . $CONFFILTER $BACKEND $MONITORDB < $CONF > $DBCONF
22 $SLAPADD -f $DBCONF -l $LDIFORDERED
24 if test $RC != 0 ; then
25 echo "slapadd failed ($RC)!"
29 echo "Waiting 5 seconds for slapadd to build slapd database..."
32 echo "Starting slapd on TCP/IP port $PORT..."
33 $SLAPD -f $DBCONF -h $MASTERURI -d $LVL $TIMING > $MASTERLOG 2>&1 &
35 if test $WAIT != 0 ; then
40 echo "Using ldapsearch to check that slapd is running..."
41 for i in 0 1 2 3 4 5; do
42 $LDAPSEARCH -s base -b "$MONITOR" -h $LOCALHOST -p $PORT \
43 'objectclass=*' > /dev/null 2>&1
45 if test $RC = 0 ; then
48 echo "Waiting 5 seconds for slapd to start..."
52 echo "Using tester for concurrent server access..."
53 $SLAPDTESTER -P "$PROGDIR" -d "$DATADIR" -h $LOCALHOST -p $PORT -D "$MANAGERDN" -w $PASSWD -l 50
56 if test $RC != 0 ; then
57 echo "slapd-tester failed ($RC)!"
61 echo "Using ldapsearch to retrieve all the entries..."
62 $LDAPSEARCH -S "" -b "$BASEDN" -h $LOCALHOST -p $PORT \
63 'objectClass=*' > $SEARCHOUT 2>&1
68 if test $RC != 0 ; then
69 echo "ldapsearch failed ($RC)!"
73 echo "Filtering ldapsearch results..."
74 . $LDIFFILTER < $SEARCHOUT > $SEARCHFLT
75 echo "Filtering original ldif used to create database..."
76 . $LDIFFILTER < $LDIF > $LDIFFLT
77 echo "Comparing filter output..."
78 $CMP $SEARCHFLT $LDIFFLT > $CMPOUT
80 if test $? != 0 ; then
81 echo "comparison failed - database was not created correctly"
85 echo ">>>>> Test succeeded"