]> git.ipfire.org Git - thirdparty/openldap.git/commitdiff
Update tests to filter create/modify dn/timestamp.
authorKurt Zeilenga <kurt@openldap.org>
Tue, 25 May 1999 19:31:23 +0000 (19:31 +0000)
committerKurt Zeilenga <kurt@openldap.org>
Tue, 25 May 1999 19:31:23 +0000 (19:31 +0000)
tests/scripts/acfilter.sh [new file with mode: 0755]
tests/scripts/all
tests/scripts/defines.sh
tests/scripts/makeldbm.sh
tests/scripts/test001-ldif2ldbm
tests/scripts/test002-populate
tests/scripts/test003-search
tests/scripts/test004-modify
tests/scripts/test005-modrdn
tests/scripts/test006-acls
tests/scripts/test007-replication

diff --git a/tests/scripts/acfilter.sh b/tests/scripts/acfilter.sh
new file mode 100755 (executable)
index 0000000..22c58c3
--- /dev/null
@@ -0,0 +1,2 @@
+#! /bin/sh
+egrep -iv '^modifiersname:|^modifytimestamp:|^creatorsname:|^createtimestamp'
index 2af48bcc4d88084e6107ebec498c5417bcd33b24..a469a919f0a6d8797b530f68dd0a61a1a28d0b64 100755 (executable)
@@ -1,11 +1,11 @@
-#!/bin/sh
+#! /bin/sh
 
 # disable LDAP initialization
 LDAPNOINIT=true; export LDAPNOINIT
 
 echo ">>>>> Executing all LDAP tests..."
 
-if [ $# -eq 0 ]; then
+if test $# -eq 0 ; then
        SRCDIR="."
 else
        SRCDIR=$1; shift
@@ -13,11 +13,19 @@ fi
 
 echo ">>>>> Test Directory: $SRCDIR"
 
+if test $# -eq 0 ; then
+       BACKEND=ldbm
+else
+       BACKEND=$1; shift
+fi
+
+echo ">>>>> Backend: $BACKEND"
+
 for CMD in $SRCDIR/scripts/test*; do
        echo ">>>>> Starting `basename $CMD` ..."
-       $CMD $SRCDIR
+       $CMD $SRCDIR $BACKEND
        RC=$?
-       if [ $RC -eq 0 ]; then
+       if test $RC -eq 0 ; then
                echo ">>>>> $CMD completed OK."
        else
                echo ">>>>> $CMD failed (exit $RC)"
index 03337899e29fea66111f5164b284d14f1c7a85da..d1de82f68ee608cdb251ad1fd2145ebb0729ee4a 100755 (executable)
@@ -1,21 +1,31 @@
+
 DATADIR=$SRCDIR/data
+PROGDIR=./progs
 
 LDIF2LDBM=../servers/slapd/tools/ldif2ldbm
+CONF=$DATADIR/slapd-master.conf
+ACLCONF=$DATADIR/slapd-acl.conf
+MASTERCONF=$DATADIR/slapd-repl-master.conf
+SLAVECONF=$DATADIR/slapd-repl-slave.conf
+
+PASSWDCONF=$DATADIR/slapd-passwd.conf
+
+CLIENTDIR=../clients/tools
+#CLIENTDIR=/usr/local/bin
+
 SLAPD=../servers/slapd/slapd
 SLURPD=../servers/slurpd/slurpd
-LDAPSEARCH=../clients/tools/ldapsearch
-LDAPMODIFY=../clients/tools/ldapmodify
-LDAPMODRDN=../clients/tools/ldapmodrdn
-LDAPADD=../clients/tools/ldapadd
-LVL=5
+LDAPSEARCH=$CLIENTDIR/ldapsearch
+LDAPMODIFY=$CLIENTDIR/ldapmodify
+LDAPADD=$CLIENTDIR/ldapadd
+LDAPMODRDN=$CLIENTDIR/ldapmodrdn
+SLAPDTESTER=$PROGDIR/slapd-tester
+LVL=${SLAPD_DEBUG-5}
+ADDR=127.0.0.1
 PORT=9009
 SLAVEPORT=9010
 DBDIR=./test-db
 REPLDIR=./test-repl
-CONF=$DATADIR/slapd-master.conf
-ACLCONF=$DATADIR/slapd-acl.conf
-MASTERCONF=$DATADIR/slapd-repl-master.conf
-SLAVECONF=$DATADIR/slapd-repl-slave.conf
 LDIF=$DATADIR/test.ldif
 LDIFORDERED=$DATADIR/test-ordered.ldif
 BASEDN="o=University of Michigan, c=US"
@@ -33,7 +43,6 @@ LDIFFLT=$DBDIR/ldif.flt
 MASTEROUT=$DBDIR/master.out
 SLAVEOUT=$DBDIR/slave.out
 TESTOUT=$DBDIR/ldapsearch.out
-TESTOUT_MODRDN=$DBDIR/ldapmodrdn.out
 SEARCHOUTMASTER=$DATADIR/search.out.master
 MODIFYOUTMASTER=$DATADIR/modify.out.master
 ADDDELOUTMASTER=$DATADIR/adddel.out.master
index bb2aac035c595384ed31313159b8394c520df30a..72cdb3053db05a84318304d2c377e3d41f4388d0 100755 (executable)
@@ -1,15 +1,15 @@
-#!/bin/sh
+#! /bin/sh
 
 . scripts/defines.sh
 
 echo "Cleaning up in $DBDIR..."
 
-rm -f $DBDIR/*
+rm -f $DBDIR/[!C]*
 
 echo "Running ldif2ldbm to build slapd database..."
 $LDIF2LDBM -f $CONF -i $LDIF -e ../servers/slapd/tools
 RC=$?
-if [ $RC != 0 ]; then
+if test $RC != 0 ; then
        echo "ldif2ldbm failed!"
        exit $RC
 fi
index 64deb66b875b4b2d16e14c264d1d985fd8d35a2b..a93b1d8f55e9b9da69ca6e2983d3cb2c875eadb7 100755 (executable)
@@ -1,14 +1,17 @@
-#!/bin/sh
+#! /bin/sh
 
-if [ $# -eq 0 ]; then
+if test $# -eq 0 ; then
        SRCDIR="."
 else
        SRCDIR=$1; shift
 fi
+if test $# -eq 1 ; then
+       BACKEND=$1; shift
+fi
 
-echo "running defines.sh $SRCDIR"
+echo "running defines.sh $SRCDIR $BACKEND"
 
-. $SRCDIR/scripts/defines.sh $SRCDIR
+. $SRCDIR/scripts/defines.sh
 
 echo "Datadir is $DATADIR"
 
@@ -19,13 +22,13 @@ rm -f $DBDIR/[!C]*
 echo "Running ldif2ldbm to build slapd database..."
 $LDIF2LDBM -f $CONF -i $LDIF -e ../servers/slapd/tools
 RC=$?
-if [ $RC != 0 ]; then
+if test $RC != 0 ; then
        echo "ldif2ldbm failed!"
        exit $RC
 fi
 
 echo "Starting slapd on TCP/IP port $PORT..."
-$SLAPD -f $CONF -p $PORT -d $LVL > $MASTERLOG 2>&1 &
+$SLAPD -f $CONF -p $PORT -d $LVL $TIMING > $MASTERLOG 2>&1 &
 PID=$!
 
 echo "Using ldapsearch to retrieve all the entries..."
@@ -33,7 +36,7 @@ for i in 0 1 2 3 4 5; do
        $LDAPSEARCH -L -S "" -b "$BASEDN" -h localhost -p $PORT \
                'objectClass=*' > $SEARCHOUT 2>&1
        RC=$?
-       if [ $RC = 1 ]; then
+       if test $RC = 1 ; then
                echo "Waiting 5 seconds for slapd to start..."
                sleep 5
        fi
@@ -41,14 +44,19 @@ done
 
 kill -HUP $PID
 
-if [ $RC != 0 ]; then
+if test $RC != 0 ; then
        echo "ldapsearch failed!"
        exit $RC
 fi
 
-echo "Comparing retrieved entries to LDIF file used to create database"
-cmp $SEARCHOUT $LDIF
-if [ $? != 0 ]; then
+echo "Filtering ldapsearch results..."
+. $SRCDIR/scripts/acfilter.sh < $SEARCHOUT > $SEARCHFLT
+echo "Filtering original ldif used to create database..."
+. $SRCDIR/scripts/acfilter.sh < $LDIF > $LDIFFLT
+echo "Comparing filter output..."
+cmp $SEARCHFLT $LDIFFLT
+
+if test $? != 0 ; then
        echo "comparison failed - database was not created correctly"
        exit 1
 fi
index cc7fc7debdf5ef8787d2cdaf5ac69aafe771c064..641a3d5c65bb980f57bd55ec1a59d374bca965c2 100755 (executable)
@@ -1,19 +1,23 @@
-#!/bin/sh
+#! /bin/sh
 
-if [ $# -eq 0 ]; then
+if test $# -eq 0 ; then
        SRCDIR="."
 else
        SRCDIR=$1; shift
 fi
+if test $# -eq 1 ; then
+       BACKEND=$1; shift
+fi
 
-. $SRCDIR/scripts/defines.sh $SRCDIR
+echo "running defines.sh $SRCDIR $BACKEND"
+. $SRCDIR/scripts/defines.sh
 
 echo "Cleaning up in $DBDIR..."
 
 rm -f $DBDIR/[!C]*
 
 echo "Starting slapd on TCP/IP port $PORT..."
-$SLAPD -f $CONF -p $PORT -d $LVL > $MASTERLOG 2>&1 &
+$SLAPD -f $CONF -p $PORT -d $LVL $TIMING > $MASTERLOG 2>&1 &
 PID=$!
 
 echo "Using ldapsearch to check that slapd is running..."
@@ -21,7 +25,7 @@ for i in 0 1 2 3 4 5; do
        $LDAPSEARCH -L -b "$BASEDN" -h localhost -p $PORT \
                'cn=Monitor' > /dev/null 2>&1
        RC=$?
-       if [ $RC = 1 ]; then
+       if test $RC = 1 ; then
                echo "Waiting 5 seconds for slapd to start..."
                sleep 5
        fi
@@ -31,7 +35,7 @@ echo "Using ldapmodify to populate the database..."
 $LDAPMODIFY -a -D "$MANAGERDN" -h localhost -p $PORT -w $PASSWD < \
        $LDIFORDERED > /dev/null 2>&1
 RC=$?
-if [ $RC != 0 ]; then
+if test $RC != 0 ; then
        echo "ldapmodify failed!"
        kill -HUP $PID
        exit $RC
@@ -39,12 +43,11 @@ fi
 
 echo "Using ldapsearch to read all the entries..."
 $LDAPSEARCH -L -S "" -b "$BASEDN" -h localhost -p $PORT \
-       'objectclass=*' | egrep -iv '^creatorsname:|^createtimestamp:' > \
-       $SEARCHOUT 2>&1
+       'objectclass=*' > $SEARCHOUT 2>&1
 
 kill -HUP $PID
 
-if [ $RC != 0 ]; then
+if test $RC != 0 ; then
        echo "ldapsearch failed!"
        exit $RC
 fi
@@ -56,7 +59,7 @@ echo "Filtering original ldif used to create database..."
 echo "Comparing filter output..."
 cmp $SEARCHFLT $LDIFFLT
 
-if [ $? != 0 ]; then
+if test $? != 0 ; then
        echo "comparison failed - database was not created correctly"
        exit 1
 fi
index e6d2d6ac9daf4f1ddca52eb8e3cda5a2b347da3c..03179910f6be4b5ce667c27868a1c666533e490e 100755 (executable)
@@ -1,12 +1,16 @@
-#!/bin/sh
+#! /bin/sh
 
-if [ $# -eq 0 ]; then
+if test $# -eq 0 ; then
        SRCDIR="."
 else
        SRCDIR=$1; shift
 fi
+if test $# -eq 1 ; then
+       BACKEND=$1; shift
+fi
 
-. $SRCDIR/scripts/defines.sh $SRCDIR
+echo "running defines.sh $SRCDIR $BACKEND"
+. $SRCDIR/scripts/defines.sh
 
 echo "Cleaning up in $DBDIR..."
 
@@ -15,13 +19,13 @@ rm -f $DBDIR/[!C]*
 echo "Running ldif2ldbm to build slapd database..."
 $LDIF2LDBM -f $CONF -i $LDIF -e ../servers/slapd/tools
 RC=$?
-if [ $RC != 0 ]; then
+if test $RC != 0 ; then
        echo "ldif2ldbm failed!"
        exit $RC
 fi
 
 echo "Starting slapd on TCP/IP port $PORT..."
-$SLAPD -f $CONF -p $PORT -d $LVL > $MASTERLOG 2>&1 &
+$SLAPD -f $CONF -p $PORT -d $LVL $TIMING > $MASTERLOG 2>&1 &
 PID=$!
 
 echo "Testing slapd searching..."
@@ -29,24 +33,24 @@ for i in 0 1 2 3 4 5; do
        $LDAPSEARCH -L -S "" -b "$BASEDN" -h localhost -p $PORT \
                'cn=Manager' > /dev/null 2>&1
        RC=$?
-       if [ $RC = 1 ]; then
+       if test $RC = 1 ; then
                echo "Waiting 5 seconds for slapd to start..."
                sleep 5
        fi
 done
 
-if [ $RC != 0 ]; then
+if test $RC != 0 ; then
        echo "ldapsearch failed!"
        kill -HUP $PID
        exit $RC
 fi
 
-cat /dev/null > $TESTOUT
+cat /dev/null > $SEARCHOUT
 
 echo "Testing exact searching..."
 $LDAPSEARCH -L -S "" -b "$BASEDN" -h localhost -p $PORT \
-       'sn=jensen' >> $TESTOUT 2>&1
-if [ $RC != 0 ]; then
+       'sn=jensen' >> $SEARCHOUT 2>&1
+if test $RC != 0 ; then
        echo "ldapsearch failed!"
        kill -HUP $PID
        exit $RC
@@ -54,8 +58,8 @@ fi
 
 echo "Testing OR searching..."
 $LDAPSEARCH -L -S "" -b "$BASEDN" -h localhost -p $PORT \
-       '(|(objectclass=rfc822mailgroup)(sn=jones))' >> $TESTOUT 2>&1
-if [ $RC != 0 ]; then
+       '(|(objectclass=rfc822mailgroup)(sn=jones))' >> $SEARCHOUT 2>&1
+if test $RC != 0 ; then
        echo "ldapsearch failed!"
        kill -HUP $PID
        exit $RC
@@ -63,8 +67,8 @@ fi
 
 echo "Testing AND matching and ends-with searching..."
 $LDAPSEARCH -L -S "" -b "$BASEDN" -h localhost -p $PORT \
-       '(&(objectclass=rfc822mailgroup)(cn=A*))' >> $TESTOUT 2>&1
-if [ $RC != 0 ]; then
+       '(&(objectclass=rfc822mailgroup)(cn=A*))' >> $SEARCHOUT 2>&1
+if test $RC != 0 ; then
        echo "ldapsearch failed!"
        kill -HUP $PID
        exit $RC
@@ -72,9 +76,8 @@ fi
 
 echo "Testing NOT searching..."
 $LDAPSEARCH -L -S "" -b "$BASEDN" -h localhost -p $PORT \
-       '(!(objectclass=person))' | grep -v "^modifytimestamp:" \
-       >> $TESTOUT 2>&1
-if [ $RC != 0 ]; then
+       '(!(objectclass=person))' >> $SEARCHOUT 2>&1
+if test $RC != 0 ; then
        echo "ldapsearch failed!"
        kill -HUP $PID
        exit $RC
@@ -82,9 +85,17 @@ fi
 
 kill -HUP $PID
 
-echo "Comparing results"
-cmp $TESTOUT $SEARCHOUTMASTER
-if [ $? != 0 ]; then
+TESTOUT=$SEARCHOUT
+LDIF=$SEARCHOUTMASTER
+
+echo "Filtering ldapsearch results..."
+. $SRCDIR/scripts/acfilter.sh < $SEARCHOUT > $SEARCHFLT
+echo "Filtering original ldif used to create database..."
+. $SRCDIR/scripts/acfilter.sh < $LDIF > $LDIFFLT
+echo "Comparing filter output..."
+cmp $SEARCHFLT $LDIFFLT
+
+if test $? != 0 ; then
        echo "Comparison failed"
        exit 1
 fi
index bea606e7a3751caf46e6274b325a1ba6290f606d..fa3bc019851a5302226fa44b0d63a00676f49d58 100755 (executable)
@@ -1,12 +1,16 @@
-#!/bin/sh
+#! /bin/sh
 
-if [ $# -eq 0 ]; then
+if test $# -eq 0 ; then
        SRCDIR="."
 else
        SRCDIR=$1; shift
 fi
+if test $# -eq 1 ; then
+       BACKEND=$1; shift
+fi
 
-. $SRCDIR/scripts/defines.sh $SRCDIR
+echo "running defines.sh $SRCDIR $BACKEND"
+. $SRCDIR/scripts/defines.sh
 
 echo "Cleaning up in $DBDIR..."
 
@@ -15,13 +19,13 @@ rm -f $DBDIR/[!C]*
 echo "Running ldif2ldbm to build slapd database..."
 $LDIF2LDBM -f $CONF -i $LDIF -e ../servers/slapd/tools
 RC=$?
-if [ $RC != 0 ]; then
+if test $RC != 0 ; then
        echo "ldif2ldbm failed!"
        exit $RC
 fi
 
 echo "Starting slapd on TCP/IP port $PORT..."
-$SLAPD -f $CONF -p $PORT -d $LVL > $MASTERLOG 2>&1 &
+$SLAPD -f $CONF -p $PORT -d $LVL $TIMING > $MASTERLOG 2>&1 &
 PID=$!
 
 echo "Testing slapd modify operations..."
@@ -29,13 +33,13 @@ for i in 0 1 2 3 4 5; do
        $LDAPSEARCH -L -S "" -b "$BASEDN" -h localhost -p $PORT \
                'cn=Manager' > /dev/null 2>&1
        RC=$?
-       if [ $RC = 1 ]; then
+       if test $RC = 1 ; then
                echo "Waiting 5 seconds for slapd to start..."
                sleep 5
        fi
 done
 
-if [ $RC != 0 ]; then
+if test $RC != 0 ; then
        echo "ldapsearch failed!"
        kill -HUP $PID
        exit $RC
@@ -102,7 +106,7 @@ changetype: delete
 EOMODS
 
 RC=$?
-if [ $RC != 0 ]; then
+if test $RC != 0 ; then
        echo "ldapmodify failed!"
        kill -HUP $PID
        exit $RC
@@ -110,18 +114,24 @@ fi
 
 echo "Using ldapsearch to retrieve all the entries..."
 $LDAPSEARCH -L -S "" -b "$BASEDN" -h localhost -p $PORT \
-           'objectClass=*' | egrep -iv '^createtimestamp:|^modifytimestamp:' \
-           > $SEARCHOUT 2>&1
+           'objectClass=*' > $SEARCHOUT 2>&1
 RC=$?
 kill -HUP $PID
-if [ $RC != 0 ]; then
+if test $RC != 0 ; then
        echo "ldapsearch failed!"
        exit $RC
 fi
 
-echo "Comparing database to reference file"
-cmp $SEARCHOUT $MODIFYOUTMASTER
-if [ $? != 0 ]; then
+LDIF=$MODIFYOUTMASTER
+
+echo "Filtering ldapsearch results..."
+. $SRCDIR/scripts/acfilter.sh < $SEARCHOUT > $SEARCHFLT
+echo "Filtering original ldif used to create database..."
+. $SRCDIR/scripts/acfilter.sh < $LDIF > $LDIFFLT
+echo "Comparing filter output..."
+cmp $SEARCHFLT $LDIFFLT
+
+if test $? != 0 ; then
        echo "comparison failed - modify operations did not complete correctly"
        exit 1
 fi
index e6069758f626643f93fd0ad790da37886d8a40b1..70392336cfc477ad416116c7c4f3c228a18a8691 100755 (executable)
@@ -46,7 +46,8 @@ if test $RC != 0 ; then
        exit $RC
 fi
 
-cat /dev/null > $TESTOUT_MODRDN
+cat /dev/null > $TESTOUT
+
 
 # -r used to do remove of old rdn
 
@@ -74,8 +75,7 @@ fi
 
 echo "Using ldapsearch to retrieve all the entries..."
 $LDAPSEARCH -L -S "" -b "$BASEDN" -h localhost -p $PORT \
-           'objectClass=*' | egrep -iv '^createtimestamp:|^modifytimestamp:' \
-           > $SEARCHOUT 2>&1
+           'objectClass=*' > $SEARCHOUT 2>&1
 RC=$?
 kill -HUP $PID
 if test $RC != 0 ; then
@@ -83,8 +83,15 @@ if test $RC != 0 ; then
        exit $RC
 fi
 
-echo "Comparing database to reference file"
-cmp $SEARCHOUT $MODRDNOUTMASTER
+LDIF=$MODRDNOUTMASTER
+
+echo "Filtering ldapsearch results..."
+. $SRCDIR/scripts/acfilter.sh < $SEARCHOUT > $SEARCHFLT
+echo "Filtering original ldif used to create database..."
+. $SRCDIR/scripts/acfilter.sh < $LDIF > $LDIFFLT
+echo "Comparing filter output..."
+cmp $SEARCHFLT $LDIFFLT
+
 if test $? != 0 ; then
        echo "comparison failed - modrdn operations did not complete correctly"
        exit 1
index 7a1f0f84f51288e6a031e0fd78d28be2b74d7b4a..58d12154074923e69fd9a3a2e8135243cb724661 100755 (executable)
@@ -1,12 +1,16 @@
-#!/bin/sh
+#! /bin/sh
 
-if [ $# -eq 0 ]; then
+if test $# -eq 0 ; then
        SRCDIR="."
 else
        SRCDIR=$1; shift
 fi
+if test $# -eq 1 ; then
+       BACKEND=$1; shift
+fi
 
-. $SRCDIR/scripts/defines.sh $SRCDIR
+echo "running defines.sh $SRCDIR $BACKEND"
+. $SRCDIR/scripts/defines.sh
 
 echo "Cleaning up in $DBDIR..."
 
@@ -15,13 +19,13 @@ rm -f $DBDIR/[!C]*
 echo "Running ldif2ldbm to build slapd database..."
 $LDIF2LDBM -f $CONF -i $LDIF -e ../servers/slapd/tools
 RC=$?
-if [ $RC != 0 ]; then
+if test $RC != 0 ; then
        echo "ldif2ldbm failed!"
        exit $RC
 fi
 
 echo "Starting slapd on TCP/IP port $PORT..."
-$SLAPD -f $ACLCONF -p $PORT -d $LVL > $MASTERLOG 2>&1 &
+$SLAPD -f $ACLCONF -p $PORT -d $LVL $TIMING > $MASTERLOG 2>&1 &
 PID=$!
 
 echo "Testing slapd access control..."
@@ -29,13 +33,13 @@ for i in 0 1 2 3 4 5; do
        $LDAPSEARCH -L -S "" -b "$BASEDN" -h localhost -p $PORT \
                'cn=Monitor' > /dev/null 2>&1
        RC=$?
-       if [ $RC = 1 ]; then
+       if test $RC = 1 ; then
                echo "Waiting 5 seconds for slapd to start..."
                sleep 5
        fi
 done
 
-if [ $RC != 0 ]; then
+if test $RC != 0 ; then
        echo "ldapsearch failed!"
        kill -HUP $PID
        exit $RC
@@ -105,14 +109,21 @@ $LDAPSEARCH -L -S "" -b "$BASEDN" -h localhost -p $PORT \
            'objectClass=*' | . $SRCDIR/scripts/acfilter.sh >> $SEARCHOUT 2>&1
 RC=$?
 kill -HUP $PID
-if [ $RC != 0 ]; then
+if test $RC != 0 ; then
        echo "ldapsearch failed!"
        exit $RC
 fi
 
-echo "Comparing database to reference file"
-cmp $SEARCHOUT $ACLOUTMASTER
-if [ $? != 0 ]; then
+LDIF=$ACLOUTMASTER
+
+echo "Filtering ldapsearch results..."
+. $SRCDIR/scripts/acfilter.sh < $SEARCHOUT > $SEARCHFLT
+echo "Filtering original ldif used to create database..."
+. $SRCDIR/scripts/acfilter.sh < $LDIF > $LDIFFLT
+echo "Comparing filter output..."
+cmp $SEARCHFLT $LDIFFLT
+
+if test $? != 0 ; then
        echo "comparison failed - modify operations did not complete correctly"
        exit 1
 fi
index 472d257678be3b631f265e62ecb3445a02735aac..b3d71c295c046c1cd925c6b66e5e9014b348be7d 100755 (executable)
@@ -1,4 +1,4 @@
-#!/bin/sh
+#! /bin/sh
 
 #
 # Test replication:
 # - retrieve database over ldap and compare against expected results
 #
 
-if [ $# -eq 0 ]; then
+if test $# -eq 0 ; then
        SRCDIR="."
 else
        SRCDIR=$1; shift
 fi
+if test $# -eq 1 ; then
+       BACKEND=$1; shift
+fi
 
-. $SRCDIR/scripts/defines.sh $SRCDIR
+echo "running defines.sh $SRCDIR $BACKEND"
+. $SRCDIR/scripts/defines.sh
 
 if test ! -x $SLURPD ; then
        echo ">>>>> $SLURPD is not executable or do not exist."
@@ -30,11 +34,11 @@ echo "Cleaning up in $REPLDIR..."
 rm -f $REPLDIR/[!C]*
 
 echo "Starting master slapd on TCP/IP port $PORT..."
-$SLAPD -f $MASTERCONF -p $PORT -d $LVL > $MASTERLOG 2>&1 &
+$SLAPD -f $MASTERCONF -p $PORT -d $LVL $TIMING > $MASTERLOG 2>&1 &
 PID=$!
 
 echo "Starting slave slapd on TCP/IP port $SLAVEPORT..."
-$SLAPD -f $SLAVECONF -p $SLAVEPORT -d $LVL > $SLAVELOG 2>&1 &
+$SLAPD -f $SLAVECONF -p $SLAVEPORT -d $LVL $TIMING > $SLAVELOG 2>&1 &
 SLAVEPID=$!
 
 echo "Using ldapsearch to check that master slapd is running..."
@@ -42,7 +46,7 @@ for i in 0 1 2 3 4 5; do
        $LDAPSEARCH -L -b "$BASEDN" -h localhost -p $PORT \
                'cn=Monitor' > /dev/null 2>&1
        RC=$?
-       if [ $RC = 1 ]; then
+       if test $RC = 1 ; then
                echo "Waiting 5 seconds for slapd to start..."
                sleep 5
        fi
@@ -53,7 +57,7 @@ for i in 0 1 2 3 4 5; do
        $LDAPSEARCH -L -b "$BASEDN" -h localhost -p $SLAVEPORT \
                'cn=Monitor' > /dev/null 2>&1
        RC=$?
-       if [ $RC = 1 ]; then
+       if test $RC = 1 ; then
                echo "Waiting 5 seconds for slapd to start..."
                sleep 5
        fi
@@ -67,7 +71,7 @@ echo "Using ldapmodify to populate the database..."
 $LDAPMODIFY -a -D "$MANAGERDN" -h localhost -p $PORT -w $PASSWD < \
        $LDIFORDERED > /dev/null 2>&1
 RC=$?
-if [ $RC != 0 ]; then
+if test $RC != 0 ; then
        echo "ldapmodify failed!"
        kill -HUP $PID $SLAVEPID $SLURPPID
        exit $RC
@@ -142,7 +146,7 @@ echo "Using ldapsearch to read all the entries from the master..."
 $LDAPSEARCH -L -S "" -b "$BASEDN" -h localhost -p $PORT \
        'objectclass=*' > $MASTEROUT 2>&1
 
-if [ $RC != 0 ]; then
+if test $RC != 0 ; then
        echo "ldapsearch failed!"
        kill -HUP $PID $SLAVEPID $SLURPPID
        exit $RC
@@ -152,7 +156,7 @@ echo "Using ldapsearch to read all the entries from the slave..."
 $LDAPSEARCH -L -S "" -b "$BASEDN" -h localhost -p $SLAVEPORT \
        'objectclass=*' > $SLAVEOUT 2>&1
 
-if [ $RC != 0 ]; then
+if test $RC != 0 ; then
        echo "ldapsearch failed!"
        kill -HUP $PID $SLAVEPID $SLURPPID
        exit $RC
@@ -160,9 +164,18 @@ fi
 
 kill -HUP $PID $SLAVEPID $SLURPPID
 
+SEARCHOUT=$MASTEROUT
+LDIF=$SLAVEOUT
+
+echo "Filtering ldapsearch results..."
+. $SRCDIR/scripts/acfilter.sh < $SEARCHOUT > $SEARCHFLT
+echo "Filtering original ldif used to create database..."
+. $SRCDIR/scripts/acfilter.sh < $LDIF > $LDIFFLT
+
 echo "Comparing retrieved entries from master and slave..."
-cmp $MASTEROUT $SLAVEOUT
-if [ $? != 0 ]; then
+cmp $SEARCHFLT $LDIFFLT
+
+if test $? != 0 ; then
        echo "test failed - master and slave databases differ"
        exit 1
 fi