]> git.sur5r.net Git - openldap/blobdiff - tests/scripts/test002-populate
More streamlining.
[openldap] / tests / scripts / test002-populate
index dd785f09449307945d0b85e974342a7126ee5f7e..5f4ba5a436781cf19b6e3dac0e01b88fe0a06c9c 100755 (executable)
@@ -9,6 +9,10 @@ BACKEND=bdb
 if test $# -ge 1 ; then
        BACKEND=$1; shift
 fi
+MONITORDB=no
+if test $# -ge 1 ; then
+       MONITORDB=$1; shift
+fi
 WAIT=0
 if test $# -ge 1 ; then
        WAIT=1; shift
@@ -22,7 +26,7 @@ echo "Cleaning up in $DBDIR..."
 rm -f $DBDIR/[!C]*
 
 echo "Starting slapd on TCP/IP port $PORT..."
-. $CONFFILTER $BACKEND < $CONF > $DBCONF
+. $CONFFILTER $BACKEND $MONITORDB < $CONF > $DBCONF
 $SLAPD -f $DBCONF -h $MASTERURI -d $LVL $TIMING > $MASTERLOG 2>&1 &
 PID=$!
 if test $WAIT != 0 ; then
@@ -35,10 +39,11 @@ for i in 0 1 2 3 4 5; do
        $LDAPSEARCH -s base -b "$MONITOR" -h $LOCALHOST -p $PORT \
                'objectclass=*' > /dev/null 2>&1
        RC=$?
-       if test $RC = 1 ; then
-               echo "Waiting 5 seconds for slapd to start..."
-               sleep 5
+       if test $RC = 0 ; then
+               break
        fi
+       echo "Waiting 5 seconds for slapd to start..."
+       sleep 5
 done
 
 echo "Using ldapadd to populate the database..."