4 echo "running defines.sh"
5 . $SRCDIR/scripts/defines.sh
7 mkdir -p $TESTDIR $DBDIR1
9 echo "Running slapadd to build slapd database..."
10 . $CONFFILTER $BACKEND $MONITORDB < $CONF > $CONF1
11 $SLAPADD -f $CONF1 -l $LDIFORDERED
13 if test $RC != 0 ; then
14 echo "slapadd failed ($RC)!"
18 echo "Waiting 5 seconds for slapadd to build slapd database..."
21 echo "Starting slapd on TCP/IP port $PORT1..."
22 $SLAPD -f $CONF1 -h $URI1 -d $LVL $TIMING > $LOG1 2>&1 &
24 if test $WAIT != 0 ; then
30 echo "Using ldapsearch to check that slapd is running..."
31 for i in 0 1 2 3 4 5; do
32 $LDAPSEARCH -s base -b "$MONITOR" -h $LOCALHOST -p $PORT1 \
33 'objectclass=*' > /dev/null 2>&1
35 if test $RC = 0 ; then
38 echo "Waiting 5 seconds for slapd to start..."
42 echo "Using tester for concurrent server access..."
43 $SLAPDTESTER -P "$PROGDIR" -d "$DATADIR" -h $LOCALHOST -p $PORT1 -D "$MANAGERDN" -w $PASSWD -l 50
46 if test $RC != 0 ; then
47 echo "slapd-tester failed ($RC)!"
48 test $KILLSERVERS != no && kill -HUP $KILLPIDS
52 echo "Using ldapsearch to retrieve all the entries..."
53 $LDAPSEARCH -S "" -b "$BASEDN" -h $LOCALHOST -p $PORT1 \
54 'objectClass=*' > $SEARCHOUT 2>&1
57 test $KILLSERVERS != no && kill -HUP $KILLPIDS
59 if test $RC != 0 ; then
60 echo "ldapsearch failed ($RC)!"
64 echo "Filtering ldapsearch results..."
65 . $LDIFFILTER < $SEARCHOUT > $SEARCHFLT
66 echo "Filtering original ldif used to create database..."
67 . $LDIFFILTER < $LDIF > $LDIFFLT
68 echo "Comparing filter output..."
69 $CMP $SEARCHFLT $LDIFFLT > $CMPOUT
71 if test $? != 0 ; then
72 echo "comparison failed - database was not created correctly"
76 echo ">>>>> Test succeeded"