]> git.sur5r.net Git - openldap/blobdiff - tests/scripts/test030-relay
Merge remote-tracking branch 'origin/mdb.master' into OPENLDAP_REL_ENG_2_4
[openldap] / tests / scripts / test030-relay
index bae99ca513012c2a9788576aea425e2d756fdb23..17dd8d6bde90618b87d2558405b35e1c8baacbe9 100755 (executable)
@@ -2,7 +2,7 @@
 # $OpenLDAP$
 ## This work is part of OpenLDAP Software <http://www.openldap.org/>.
 ##
-## Copyright 1998-2005 The OpenLDAP Foundation.
+## Copyright 1998-2013 The OpenLDAP Foundation.
 ## All rights reserved.
 ##
 ## Redistribution and use in source and binary forms, with or without
@@ -17,7 +17,7 @@ echo "running defines.sh"
 . $SRCDIR/scripts/defines.sh
 
 if test $RWM = rwmno ; then 
-       echo "Rewrite/remap overlay not available, test skipped"
+       echo "rwm (Rewrite/remap) overlay not available, test skipped"
        exit 0
 fi 
 
@@ -39,20 +39,28 @@ if test "x$RELAYS" = "x" ; then
        if test $BACKLDAP = ldapno ; then 
                echo "ldap backend not available, test skipped"
        else
-               if test "x$RELAYS" != "x" ; then
-                       RELAYS="${RELAYS} "
-               fi
-               RELAYS="${RELAYS}ldap"
+               if test $THREADS = "threadsno" ; then
+                       echo "Need threads support, test skipped"
+               else
+                       if test "x$RELAYS" != "x" ; then
+                               RELAYS="${RELAYS} "
+                       fi
+                       RELAYS="${RELAYS}ldap"
+               fi 
        fi
 
        # back-meta
        if test $BACKMETA = metano ; then 
                echo "meta backend not available, test skipped"
        else
-               if test "x$RELAYS" != "x" ; then
-                       RELAYS="${RELAYS} "
+               if test $THREADS = "threadsno" ; then
+                       echo "Need threads support, test skipped"
+               else
+                       if test "x$RELAYS" != "x" ; then
+                               RELAYS="${RELAYS} "
+                       fi
+                       RELAYS="${RELAYS}meta"
                fi
-               RELAYS="${RELAYS}meta"
        fi 
 fi
 
@@ -62,26 +70,49 @@ if test "x$RELAYS" = "x" ; then
        exit 0
 fi
 
-echo "Testing virtual naming context mapping with backend(s) $RELAYS..."
+echo "Testing virtual naming context mapping with $RELAYS backend(s)..."
 echo ""
 
+tmpfile=savelog.log
+if test -f $tmpfile ; then
+       rm -f $tmpfile
+fi
 first=1
 for RELAY in $RELAYS ; do
-       if test $first = 1 ; then
-               first=0
-       else
-               echo ">>>>> waiting 10 seconds for things to exit"
-               sleep 10
-               echo ""
-
-               rm -rf $TESTDIR
+       RUNIT=yes
+       if test $THREADS = "threadsno" ; then
+               case $RELAY in
+               ldap|meta)
+                       echo "Need threads support, test skipped"
+                       RUNIT=no
+                       ;;
+               esac
        fi
+       
+       if test $RUNIT = yes ; then             
+               if test $first = 1 ; then
+                       first=0
+               else
+                       echo ">>>>> waiting for things to exit"
+                       test $KILLSERVERS != no && wait
+                       echo ""
 
-       mkdir -p $TESTDIR $DBDIR1
+                       mv -f $LOG1 $tmpfile
+                       rm -rf $TESTDIR
+               fi
+
+               mkdir -p $TESTDIR $DBDIR1
 
-       . $SRCDIR/scripts/relay
+               if test -f $tmpfile ; then
+                       mv $tmpfile $LOG1
+               fi
+       
+               . $SRCDIR/scripts/relay
+       fi
 done
 
 echo ">>>>> Test succeeded"
-exit 0
 
+test $KILLSERVERS != no && wait
+
+exit 0