]> git.sur5r.net Git - openldap/blobdiff - tests/scripts/test012-glue
ITS#2401 support tests for dynamically loaded backends
[openldap] / tests / scripts / test012-glue
index d820cb67d35e7b5bdbc0cdaabf576bdeba86db80..a163f8f08c8e65f264d298efc37eff881ebfce75 100755 (executable)
@@ -5,14 +5,8 @@ SRCDIR="."
 if test $# -ge 1 ; then
        SRCDIR=$1; shift
 fi
-BACKEND=ldbm
-if test $# -ge 1 ; then
-       BACKEND=$1; shift
-fi
-WAIT=0
-if test $# -ge 1 ; then
-       WAIT=1; shift
-fi
+
+. $SRCDIR/scripts/args.sh
 
 echo "running defines.sh"
 . $SRCDIR/scripts/defines.sh
@@ -24,7 +18,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 +39,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 +87,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..."
@@ -111,6 +107,7 @@ fi
 echo "Using ldapsearch to read all the entries..."
 $LDAPSEARCH -b "$BASEDN" -h $LOCALHOST -p $PORT \
        'objectclass=*' > $SEARCHOUT 2>&1
+RC=$?
 
 kill -HUP $PID