# $OpenLDAP$
## This work is part of OpenLDAP Software <http://www.openldap.org/>.
##
-## Copyright 1998-2004 The OpenLDAP Foundation.
+## Copyright 1998-2008 The OpenLDAP Foundation.
## All rights reserved.
##
## Redistribution and use in source and binary forms, with or without
echo "running defines.sh"
. $SRCDIR/scripts/defines.sh
-echo "### This test requires the ldap backend."
+echo "### This test requires the ldap backend and glue overlay."
echo "### If available, and explicitly requested, it can use SASL bind;"
echo "### note that SASL must be properly set up, and the requested"
echo "### mechanism must be available. Define SLAPD_USE_SASL={yes|<mech>},"
fi
KILLPIDS="$PID1 $PID2 $PID3"
+sleep 1
+
echo "Using ldapsearch to check that slapd is running..."
for i in 0 1 2 3 4 5; do
$LDAPSEARCH -s base -b "$MONITOR" -h $LOCALHOST -p $PORT1 \
fi
# FIXME: this cannot work as is, because SASL bind cannot be proxied!
-#if test $USE_SASL != "no" ; then
-# ID="bjorn"
-# BASE="dc=example,dc=com"
-# echo "Testing ldapsearch as $ID for \"$BASE\" with SASL bind and identity assertion..."
-# $LDAPSASLSEARCH -h $LOCALHOST -p $PORT1 -b "$BASE" \
-# -Q -U "$ID" -w bjorn -Y $MECH > $SEARCHOUT 2>&1
-#
-# RC=$?
-# if test $RC != 0 ; then
-# echo "ldapsearch failed ($RC)!"
-# test $KILLSERVERS != no && kill -HUP $KILLPIDS
-# exit $RC
-# fi
-#
-# echo "Filtering ldapsearch results..."
-# . $LDIFFILTER < $SEARCHOUT > $SEARCHFLT
-# echo "Filtering original ldif used to create database..."
-# . $LDIFFILTER < $LDAPGLUEOUT > $LDIFFLT
-# echo "Comparing filter output..."
-# $CMP $SEARCHFLT $LDIFFLT > $CMPOUT
-#
-# if test $? != 0 ; then
-# echo "comparison failed - glued search with SASL bind and identity assertion didn't succeed"
-# test $KILLSERVERS != no && kill -HUP $KILLPIDS
-# exit 1
-# fi
-#fi
+if test $USE_SASL != "no" ; then
+ ID="bjorn"
+ BASE="dc=example,dc=com"
+ echo "Testing ldapsearch as $ID for \"$BASE\" with SASL bind and identity assertion..."
+ $LDAPSASLSEARCH -h $LOCALHOST -p $PORT1 -b "$BASE" \
+ -Q -U "$ID" -w bjorn -Y $MECH > $SEARCHOUT 2>&1
+
+ RC=$?
+ if test $RC != 0 ; then
+ echo "ldapsearch failed ($RC)!"
+ test $KILLSERVERS != no && kill -HUP $KILLPIDS
+ exit $RC
+ fi
+
+ echo "Filtering ldapsearch results..."
+ . $LDIFFILTER < $SEARCHOUT > $SEARCHFLT
+ echo "Filtering original ldif used to create database..."
+ . $LDIFFILTER < $LDAPGLUEOUT > $LDIFFLT
+ echo "Comparing filter output..."
+ $CMP $SEARCHFLT $LDIFFLT > $CMPOUT
+
+ if test $? != 0 ; then
+ echo "comparison failed - glued search with SASL bind and identity assertion didn't succeed"
+ test $KILLSERVERS != no && kill -HUP $KILLPIDS
+ exit 1
+ fi
+fi
test $KILLSERVERS != no && kill -HUP $KILLPIDS
echo ">>>>> Test succeeded"
-exit 0
+test $KILLSERVERS != no && wait
+
+exit 0