2004-07-13 03:26:07 +08:00
|
|
|
#! /bin/sh
|
|
|
|
# $OpenLDAP$
|
|
|
|
## This work is part of OpenLDAP Software <http://www.openldap.org/>.
|
|
|
|
##
|
2007-01-03 04:00:42 +08:00
|
|
|
## Copyright 1998-2007 The OpenLDAP Foundation.
|
2004-07-13 03:26:07 +08:00
|
|
|
## All rights reserved.
|
|
|
|
##
|
|
|
|
## Redistribution and use in source and binary forms, with or without
|
|
|
|
## modification, are permitted only as authorized by the OpenLDAP
|
|
|
|
## Public License.
|
|
|
|
##
|
|
|
|
## A copy of this license is available in the file LICENSE in the
|
|
|
|
## top-level directory of the distribution or, alternatively, at
|
|
|
|
## <http://www.OpenLDAP.org/license.html>.
|
|
|
|
|
|
|
|
echo "running defines.sh"
|
|
|
|
. $SRCDIR/scripts/defines.sh
|
|
|
|
|
2004-12-30 23:10:31 +08:00
|
|
|
if test $RWM = rwmno ; then
|
2005-07-04 07:29:10 +08:00
|
|
|
echo "rwm (Rewrite/remap) overlay not available, test skipped"
|
2004-12-30 23:10:31 +08:00
|
|
|
exit 0
|
|
|
|
fi
|
|
|
|
|
|
|
|
echo ""
|
|
|
|
|
2004-12-31 02:05:20 +08:00
|
|
|
if test "x$RELAYS" = "x" ; then
|
|
|
|
RELAYS=
|
|
|
|
# back-relay
|
|
|
|
if test $BACKRELAY = relayno ; then
|
|
|
|
echo "relay backend not available, test skipped"
|
|
|
|
else
|
2005-01-02 00:12:29 +08:00
|
|
|
if test "x$RELAYS" != "x" ; then
|
|
|
|
RELAYS="${RELAYS} "
|
|
|
|
fi
|
|
|
|
RELAYS="${RELAYS}relay"
|
2004-12-31 02:05:20 +08:00
|
|
|
fi
|
2004-12-30 23:10:31 +08:00
|
|
|
|
2004-12-31 02:05:20 +08:00
|
|
|
# back-ldap
|
|
|
|
if test $BACKLDAP = ldapno ; then
|
|
|
|
echo "ldap backend not available, test skipped"
|
|
|
|
else
|
2006-01-04 02:04:12 +08:00
|
|
|
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
|
2004-12-31 02:05:20 +08:00
|
|
|
fi
|
|
|
|
|
|
|
|
# back-meta
|
|
|
|
if test $BACKMETA = metano ; then
|
|
|
|
echo "meta backend not available, test skipped"
|
|
|
|
else
|
2006-01-04 02:04:12 +08:00
|
|
|
if test $THREADS = "threadsno" ; then
|
|
|
|
echo "Need threads support, test skipped"
|
|
|
|
else
|
|
|
|
if test "x$RELAYS" != "x" ; then
|
|
|
|
RELAYS="${RELAYS} "
|
|
|
|
fi
|
|
|
|
RELAYS="${RELAYS}meta"
|
2005-01-02 00:12:29 +08:00
|
|
|
fi
|
2004-12-31 02:05:20 +08:00
|
|
|
fi
|
2004-12-30 23:10:31 +08:00
|
|
|
fi
|
|
|
|
|
2005-01-02 00:12:29 +08:00
|
|
|
if test "x$RELAYS" = "x" ; then
|
|
|
|
echo "no relaying capable backend is available"
|
|
|
|
echo ">>>>> Test succeeded"
|
|
|
|
exit 0
|
|
|
|
fi
|
|
|
|
|
2005-01-20 07:45:51 +08:00
|
|
|
echo "Testing virtual naming context mapping with $RELAYS backend(s)..."
|
2004-12-31 02:05:20 +08:00
|
|
|
echo ""
|
2004-07-13 03:26:07 +08:00
|
|
|
|
2006-09-04 16:29:47 +08:00
|
|
|
tmpfile=savelog.log
|
|
|
|
if test -f $tmpfile ; then
|
|
|
|
rm -f $tmpfile
|
|
|
|
fi
|
2004-12-30 23:10:31 +08:00
|
|
|
first=1
|
|
|
|
for RELAY in $RELAYS ; do
|
2006-01-04 02:04:12 +08:00
|
|
|
RUNIT=yes
|
|
|
|
if test $THREADS = "threadsno" ; then
|
|
|
|
case $RELAY in
|
|
|
|
ldap|meta)
|
|
|
|
echo "Need threads support, test skipped"
|
|
|
|
RUNIT=no
|
|
|
|
;;
|
|
|
|
esac
|
2004-12-30 23:10:31 +08:00
|
|
|
fi
|
2006-01-04 02:04:12 +08:00
|
|
|
|
|
|
|
if test $RUNIT = yes ; then
|
|
|
|
if test $first = 1 ; then
|
|
|
|
first=0
|
|
|
|
else
|
2006-01-14 05:32:24 +08:00
|
|
|
echo ">>>>> waiting for things to exit"
|
|
|
|
test $KILLSERVERS != no && wait
|
2006-01-04 02:04:12 +08:00
|
|
|
echo ""
|
2006-09-04 16:29:47 +08:00
|
|
|
|
|
|
|
mv -f $LOG1 $tmpfile
|
2006-01-04 02:04:12 +08:00
|
|
|
rm -rf $TESTDIR
|
|
|
|
fi
|
2004-12-30 23:10:31 +08:00
|
|
|
|
2006-01-04 02:04:12 +08:00
|
|
|
mkdir -p $TESTDIR $DBDIR1
|
2006-09-04 16:29:47 +08:00
|
|
|
|
|
|
|
if test -f $tmpfile ; then
|
|
|
|
mv $tmpfile $LOG1
|
|
|
|
fi
|
2006-01-04 02:04:12 +08:00
|
|
|
|
|
|
|
. $SRCDIR/scripts/relay
|
|
|
|
fi
|
2004-12-30 23:10:31 +08:00
|
|
|
done
|
|
|
|
|
|
|
|
echo ">>>>> Test succeeded"
|
2004-07-20 08:28:15 +08:00
|
|
|
|
2006-01-11 13:25:09 +08:00
|
|
|
test $KILLSERVERS != no && wait
|
|
|
|
|
|
|
|
exit 0
|