]> git.sur5r.net Git - openldap/blobdiff - tests/scripts/test012-glue
More streamlining.
[openldap] / tests / scripts / test012-glue
index 51c589ca84526708720ec8ecc88bd632891fde4a..a8b93f06985effbd73364fda4e795697ff1a3738 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
@@ -24,7 +28,7 @@ mkdir $DBDIR/C_db1 $DBDIR/C_db2 $DBDIR/C_db3
 rm -f $DBDIR/[!C]* $DBDIR/C_db?/*
 
 echo "Running slapadd to build glued slapd databases..."
-. $CONFFILTER $BACKEND < $GLUECONF > $DBCONF
+. $CONFFILTER $BACKEND $MONITORDB < $GLUECONF > $DBCONF
 $SLAPADD -d $LVL -f $DBCONF -l $LDIFORDERED > $DBDIR/slapadd.log 2>&1
 RC=$?
 if test $RC != 0 ; then
@@ -45,10 +49,11 @@ cd test-db
 for i in 0 1 2 3 4 5; do
        ../$LDAPSEARCH -b "$BASEDN" -h $LOCALHOST -p $PORT > ../$SEARCHOUT 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
 cd ..
 
@@ -92,10 +97,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 glued database..."