]> git.sur5r.net Git - openldap/blobdiff - tests/scripts/test034-translucent
Sync with HEAD
[openldap] / tests / scripts / test034-translucent
index 7728d676efd1d62b4d7290725e2b49e384f769ae..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
@@ -168,7 +167,7 @@ if test $RC != 50 ; then
        echo "ldapadd failed ($RC), expected INSUFFICIENT ACCESS!"
        grep "$FAILURE" $TESTOUT
        test $KILLSERVERS != no && kill -HUP $KILLPIDS
-       exit $RC
+       exit 1
 fi
 
 echo "Testing add: valid local record, no_glue..."
@@ -181,7 +180,7 @@ if test $RC != 32 ; then
        echo "ldapadd failed ($RC), expected NO SUCH OBJECT!"
        grep "$FAILURE" $TESTOUT
        test $KILLSERVERS != no && kill -HUP $KILLPIDS
-       exit $RC
+       exit 1
 fi
 
 echo "Testing modrdn: valid local record, no_glue..."
@@ -194,12 +193,12 @@ if test $RC != 32 ; then
        echo "ldapmodrdn failed ($RC), expected NO SUCH OBJECT!"
        grep "$FAILURE" $TESTOUT
        test $KILLSERVERS != no && kill -HUP $KILLPIDS
-       exit $RC
+       exit 1
 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
@@ -256,7 +257,8 @@ if test $RC != 0 ; then
        exit $RC
 fi
 
-$CMP $SEARCHOUT $LDIFTRANSLUCENTMERGED > $CMPOUT
+. $LDIFFILTER < $SEARCHOUT > $SEARCHFLT
+$CMP $SEARCHFLT $LDIFTRANSLUCENTMERGED > $CMPOUT
 
 if test $? != 0 ; then
        echo "Comparison failed -- local data failed to merge with remote!"
@@ -273,7 +275,7 @@ RC=$?
 if test $RC != 6 ; then
        echo "ldapcompare failed ($RC), expected TRUE!"
        test $KILLSERVERS != no && kill -HUP $KILLPIDS
-       exit $RC
+       exit 1
 fi
 
 echo "Testing compare: valid remote..."
@@ -285,7 +287,7 @@ RC=$?
 if test $RC != 6 ; then
        echo "ldapcompare failed ($RC), expected TRUE!"
        test $KILLSERVERS != no && kill -HUP $KILLPIDS
-       exit $RC
+       exit 1
 fi
 
 echo "Testing compare: bogus local..."
@@ -297,7 +299,7 @@ RC=$?
 if test $RC != 5 ; then
        echo "ldapcompare failed ($RC), expected FALSE!"
        test $KILLSERVERS != no && kill -HUP $KILLPIDS
-       exit $RC
+       exit 1
 fi
 
 echo "Testing compare: bogus remote..."
@@ -309,7 +311,7 @@ RC=$?
 if test $RC != 5 ; then
        echo "ldapcompare failed ($RC), expected FALSE!"
        test $KILLSERVERS != no && kill -HUP $KILLPIDS
-       exit $RC
+       exit 1
 fi
 
 echo "Testing modify: nonexistent record..."
@@ -328,7 +330,7 @@ if test $RC != 32 ; then
        echo "ldapmodify failed ($RC), expected NO SUCH OBJECT!"
        grep "$FAILURE" $TESTOUT
        test $KILLSERVERS != no && kill -HUP $KILLPIDS
-       exit $RC
+       exit 1
 fi
 
 echo "Testing modify: valid local record, nonexistent attribute..."
@@ -427,7 +429,7 @@ if test $RC != 16 ; then
        echo "ldapmodify failed ($RC), expected NO SUCH ATTRIBUTE!"
        grep "$FAILURE" $TESTOUT
        test $KILLSERVERS != no && kill -HUP $KILLPIDS
-       exit $RC
+       exit 1
 fi
 
 echo "Testing delete: valid local record, nonexistent attribute..."
@@ -458,7 +460,7 @@ if test $RC != 50 ; then
        echo "ldapmodrdn failed ($RC), expected INSUFFICIENT ACCESS!"
        grep "$FAILURE" $TESTOUT
        test $KILLSERVERS != no && kill -HUP $KILLPIDS
-       exit $RC
+       exit 1
 fi
 
 echo "Testing modrdn: valid local record..."
@@ -488,7 +490,7 @@ if test $RC != 50 ; then
        echo "ldapadd failed ($RC), expected INSUFFICIENT ACCESS!"
        grep "$FAILURE" $TESTOUT
        test $KILLSERVERS != no && kill -HUP $KILLPIDS
-       exit $RC
+       exit 1
 fi
 
 echo "Testing delete: valid local record..."
@@ -522,7 +524,7 @@ if test $RC != 32 ; then
        echo "ldapmodify failed ($RC), expected NO SUCH OBJECT!"
        grep "$FAILURE" $TESTOUT
        test $KILLSERVERS != no && kill -HUP $KILLPIDS
-       exit $RC
+       exit 1
 fi
 
 echo "Testing delete: nonexistent local record, nonexistent attribute..."
@@ -567,7 +569,7 @@ if test $RC != 16 ; then
        echo "ldapmodify failed ($RC), expected NO SUCH ATTRIBUTE!"
        grep "$FAILURE" $TESTOUT
        test $KILLSERVERS != no && kill -HUP $KILLPIDS
-       exit $RC
+       exit 1
 fi
 
 echo "Testing modify: valid remote record, combination add-modify-delete..."
@@ -619,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
@@ -634,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
@@ -666,7 +670,7 @@ if test $RC != 19 ; then
        echo "ldapmodify failed ($RC), expected CONSTRAINT VIOLATION!"
        grep "$FAILURE" $TESTOUT
        test $KILLSERVERS != no && kill -HUP $KILLPIDS
-       exit $RC
+       exit 1
 fi
 
 echo "Testing strict mode delete: nonexistent remote attribute..."
@@ -684,7 +688,7 @@ if test $RC != 19 ; then
        echo "ldapmodify failed ($RC), expected CONSTRAINT VIOLATION!"
        grep "$FAILURE" $TESTOUT
        test $KILLSERVERS != no && kill -HUP $KILLPIDS
-       exit $RC
+       exit 1
 fi
 
 echo "Testing strict mode modify: combination add-modify-delete..."
@@ -708,10 +712,34 @@ if test $RC != 19 ; then
        echo "ldapmodify failed ($RC), expected CONSTRAINT VIOLATION!"
        grep "$FAILURE" $TESTOUT
        test $KILLSERVERS != no && kill -HUP $KILLPIDS
-       exit $RC
+       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