]> git.sur5r.net Git - openldap/blobdiff - tests/scripts/test006-acls
Use -h URL, not -p port
[openldap] / tests / scripts / test006-acls
index 5ebb19e016a5b4d5fde05ccf58e969bf91093911..5a97ccc53168471e14f3e15dec11c729c8bea7da 100755 (executable)
@@ -1,16 +1,20 @@
 #! /bin/sh
 # $OpenLDAP$
 
-if test $# -eq 0 ; then
-       SRCDIR="."
-else
+SRCDIR="."
+if test $# -ge 1 ; then
        SRCDIR=$1; shift
 fi
-if test $# -eq 1 ; then
+BACKEND=ldbm
+if test $# -ge 1 ; then
        BACKEND=$1; shift
 fi
+WAIT=0
+if test $# -ge 1 ; then
+       WAIT=1; shift
+fi
 
-echo "running defines.sh $SRCDIR $BACKEND"
+echo "running defines.sh"
 . $SRCDIR/scripts/defines.sh
 
 echo "Cleaning up in $DBDIR..."
@@ -18,7 +22,8 @@ echo "Cleaning up in $DBDIR..."
 rm -f $DBDIR/[!C]*
 
 echo "Running slapadd to build slapd database..."
-$SLAPADD -f $CONF -l $LDIFORDERED
+. $CONFFILTER $BACKEND < $ACLCONF > $DBCONF
+$SLAPADD -f $DBCONF -l $LDIFORDERED
 RC=$?
 if test $RC != 0 ; then
        echo "slapadd failed ($RC)!"
@@ -26,8 +31,12 @@ if test $RC != 0 ; then
 fi
 
 echo "Starting slapd on TCP/IP port $PORT..."
-$SLAPD -f $ACLCONF -h $MASTERURI -d $LVL $TIMING > $MASTERLOG 2>&1 &
+$SLAPD -f $DBCONF -h $MASTERURI -d $LVL $TIMING > $MASTERLOG 2>&1 &
 PID=$!
+if test $WAIT != 0 ; then
+    echo PID $PID
+    read foo
+fi
 
 echo "Testing slapd access control..."
 for i in 0 1 2 3 4 5; do
@@ -116,7 +125,7 @@ EOMODS4
 
 echo "Using ldapsearch to retrieve all the entries..."
 $LDAPSEARCH -S "" -b "$BASEDN" -h localhost -p $PORT \
-           'objectClass=*' | . $SRCDIR/scripts/acfilter.sh >> $SEARCHOUT 2>&1
+           'objectClass=*' | . $LDIFFILTER >> $SEARCHOUT 2>&1
 RC=$?
 kill -HUP $PID
 if test $RC != 0 ; then
@@ -127,9 +136,9 @@ fi
 LDIF=$ACLOUTMASTER
 
 echo "Filtering ldapsearch results..."
-. $SRCDIR/scripts/acfilter.sh < $SEARCHOUT > $SEARCHFLT
+. $LDIFFILTER < $SEARCHOUT > $SEARCHFLT
 echo "Filtering original ldif used to create database..."
-. $SRCDIR/scripts/acfilter.sh < $LDIF > $LDIFFLT
+. $LDIFFILTER < $LDIF > $LDIFFLT
 echo "Comparing filter output..."
 $CMP $SEARCHFLT $LDIFFLT > $CMPOUT