]> git.sur5r.net Git - openldap/blobdiff - tests/scripts/test034-translucent
Sync with HEAD
[openldap] / tests / scripts / test034-translucent
index eeb863e47e541855ef095e9dcc0b531edbf5c95f..75ba8298687815faad611dfabbf335c736f79082 100755 (executable)
@@ -2,7 +2,7 @@
 # $OpenLDAP$
 ## This work is part of OpenLDAP Software <http://www.openldap.org/>.
 ##
-## Copyright 2004 The OpenLDAP Foundation.
+## Copyright 2004-2006 The OpenLDAP Foundation.
 ## All rights reserved.
 ##
 ## Redistribution and use in source and binary forms, with or without
@@ -25,11 +25,6 @@ if test $TRANSLUCENT = translucentno ; then
        exit 0
 fi 
 
-if test $BACKEND = ldbm ; then
-       echo "Translucent Proxy overlay not qualified for use with LDBM, skipping"
-       exit 0
-fi
-
 if test $AC_ldap = ldapno ; then
        echo "Translucent Proxy overlay requires back-ldap backend, test skipped"
        exit 0
@@ -57,6 +52,8 @@ fi
 REMOTEPID="$PID"
 KILLPIDS="$PID"
 
+sleep 1
+
 for i in 0 1 2 3 4 5; do
        $LDAPSEARCH -s base -b "$MONITOR" -H $URI1 \
                'objectclass=*' > /dev/null 2>&1
@@ -89,6 +86,8 @@ fi
 LOCALPID="$PID"
 KILLPIDS="$LOCALPID $REMOTEPID"
 
+sleep 1
+
 for i in 0 1 2 3 4 5; do
        $LDAPSEARCH -s base -b "$MONITOR" -H $URI2 \
                'objectclass=*' > /dev/null 2>&1
@@ -199,7 +198,7 @@ fi
 
 echo "Shutting down local slapd..."
 kill -HUP $LOCALPID
-sleep 5
+wait $LOCALPID
 
 echo "Configuring local slapd without translucent_no_glue..."
 . $CONFFILTER $BACKEND $MONITORDB < $TRANSLUCENTLOCALCONF | \
@@ -215,6 +214,8 @@ fi
 LOCALPID="$PID"
 KILLPIDS="$REMOTEPID $PID"
 
+sleep 1
+
 for i in 0 1 2 3 4 5; do
        $LDAPSEARCH -s base -b "$MONITOR" -H $URI2 \
                'objectclass=*' > /dev/null 2>&1
@@ -620,7 +621,7 @@ fi
 
 echo "Shutting down local slapd..."
 kill -HUP $LOCALPID
-sleep 5
+wait $LOCALPID
 
 echo "Configuring local slapd with translucent_strict..."
 echo translucent_strict >> $CONF2
@@ -635,6 +636,8 @@ fi
 LOCALPID="$PID"
 KILLPIDS="$REMOTEPID $PID"
 
+sleep 1
+
 for i in 0 1 2 3 4 5; do
        $LDAPSEARCH -s base -b "$MONITOR" -H $URI2 \
                'objectclass=*' > /dev/null 2>&1
@@ -712,7 +715,31 @@ if test $RC != 19 ; then
        exit 1
 fi
 
+echo "Testing invalid Bind request..."
+$LDAPWHOAMI -D "$TRANSLUCENTDN" -H $URI2 -w Wrong"$TRANSLUCENTPASSWD" > \
+       $TESTOUT 2>&1
+RC=$?
+if test $RC != 49 ; then
+       echo "ldapwhoami failed ($RC), expected INVALID CREDENTIALS!"
+       grep "$FAILURE" $TESTOUT
+       test $KILLSERVERS != no && kill -HUP $KILLPIDS
+       exit 1
+fi
+
+$LDAPWHOAMI -D "$TRANSLUCENTDN" -H $URI2 -w "$TRANSLUCENTPASSWD" > \
+       $TESTOUT 2>&1
+RC=$?
+if test $RC != 0 ; then
+       echo "ldapwhoami failed ($RC), expected SUCCESS!"
+       grep "$FAILURE" $TESTOUT
+       test $KILLSERVERS != no && kill -HUP $KILLPIDS
+       exit 1
+fi
+
 test $KILLSERVERS != no && kill -HUP $KILLPIDS
 
 echo ">>>>> Test succeeded"
+
+test $KILLSERVERS != no && wait
+
 exit 0