X-Git-Url: https://git.sur5r.net/?a=blobdiff_plain;f=tests%2Fscripts%2Ftest030-relay;h=7f06f98e7f4ff74283a343846afef72b45adb90b;hb=6c062ca841f82ca9ea17172c2a9882f373a76c02;hp=e7e457caed12ce68612f5ede7fa064fe11fc3d6c;hpb=ba6ac023ad20c1a37e2ec8d796e86ef73571a7de;p=openldap diff --git a/tests/scripts/test030-relay b/tests/scripts/test030-relay index e7e457caed..7f06f98e7f 100755 --- a/tests/scripts/test030-relay +++ b/tests/scripts/test030-relay @@ -2,7 +2,7 @@ # $OpenLDAP$ ## This work is part of OpenLDAP Software . ## -## Copyright 1998-2004 The OpenLDAP Foundation. +## Copyright 1998-2006 The OpenLDAP Foundation. ## All rights reserved. ## ## Redistribution and use in source and binary forms, with or without @@ -17,51 +17,93 @@ 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 echo "" -RELAYS= -# back-relay -if test $BACKRELAY = relayno ; then - echo "relay backend not available, test skipped" -else - RELAYS="$RELAYS relay" +if test "x$RELAYS" = "x" ; then + RELAYS= + # back-relay + if test $BACKRELAY = relayno ; then + echo "relay backend not available, test skipped" + else + if test "x$RELAYS" != "x" ; then + RELAYS="${RELAYS} " + fi + RELAYS="${RELAYS}relay" + fi + + # back-ldap + if test $BACKLDAP = ldapno ; then + echo "ldap backend not available, test skipped" + else + 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 $THREADS = "threadsno" ; then + echo "Need threads support, test skipped" + else + if test "x$RELAYS" != "x" ; then + RELAYS="${RELAYS} " + fi + RELAYS="${RELAYS}meta" + fi + fi fi -# back-ldap -if test $BACKLDAP = ldapno ; then - echo "ldap backend not available, test skipped" -else - RELAYS="$RELAYS ldap" +if test "x$RELAYS" = "x" ; then + echo "no relaying capable backend is available" + echo ">>>>> Test succeeded" + exit 0 fi -# back-meta -if test $BACKMETA = metano ; then - echo "meta backend not available, test skipped" -else - RELAYS="$RELAYS meta" -fi +echo "Testing virtual naming context mapping with $RELAYS backend(s)..." +echo "" 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 "" + + rm -rf $TESTDIR + fi - mkdir -p $TESTDIR $DBDIR1 - - . $SRCDIR/scripts/relay + mkdir -p $TESTDIR $DBDIR1 + + . $SRCDIR/scripts/relay + fi done echo ">>>>> Test succeeded" -exit 0 +test $KILLSERVERS != no && wait + +exit 0