4 echo "running defines.sh"
5 . $SRCDIR/scripts/defines.sh
7 mkdir -p $TESTDIR $DBDIR1A $DBDIR1B $DBDIR1C
9 echo "Running slapadd to build glued slapd databases..."
10 . $CONFFILTER $BACKEND $MONITORDB < $GLUECONF > $CONF1
11 $SLAPADD -d $LVL -f $CONF1 -l $LDIFORDERED > $SLAPADDLOG1 2>&1
13 if test $RC != 0 ; then
14 echo "slapadd failed ($RC)!"
18 echo "Starting slapd on TCP/IP port $PORT1..."
19 $SLAPD -f $CONF1 -h $URI1 -d $LVL $TIMING > $LOG1 2>&1 &
21 if test $WAIT != 0 ; then
27 echo "Using ldapsearch to retrieve all the entries..."
28 for i in 0 1 2 3 4 5; do
29 $LDAPSEARCH -b "$BASEDN" -h $LOCALHOST -p $PORT1 > $SEARCHOUT 2>&1
31 if test $RC = 0 ; then
34 echo "Waiting 5 seconds for slapd to start..."
38 test $KILLSERVERS != no && kill -HUP $KILLPIDS
40 if test $RC != 0 ; then
41 echo "ldapsearch failed ($RC)!"
45 echo "Filtering ldapsearch results..."
46 . $LDIFFILTER < $SEARCHOUT > $SEARCHFLT
47 echo "Filtering original ldif used to create database..."
48 . $LDIFFILTER < $LDIFGLUED > $LDIFFLT
49 echo "Comparing filter output..."
50 $CMP $SEARCHFLT $LDIFFLT > $CMPOUT
52 if test $? != 0 ; then
53 echo "comparison failed - database was not created correctly"
54 echo $SEARCHFLT $LDIFFLT
55 $DIFF $SEARCHFLT $LDIFFLT
59 echo ">>>>> Test succeeded"