]> git.sur5r.net Git - openldap/blobdiff - tests/scripts/test029-ldapglue
s/ldap_sync.h/ldap.h/
[openldap] / tests / scripts / test029-ldapglue
index 1f8201ff8bdc01d3fb2a92a7e53bdae093565cc0..2c55f3e66c9c5a8d09ca236031f6f06c5c78fabd 100755 (executable)
@@ -2,7 +2,7 @@
 # $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
@@ -16,7 +16,7 @@
 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>},"
@@ -97,6 +97,8 @@ if test $WAIT != 0 ; then
 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 \
@@ -185,36 +187,38 @@ if test $? != 0 ; then
 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