--- tests/scripts/relay 2005/01/19 22:49:24 1.6 +++ tests/scripts/relay 2005/01/20 21:49:32 1.7 @@ -1,5 +1,5 @@ #! /bin/sh -# $OpenLDAP: pkg/ldap/tests/scripts/relay,v 1.5 2005/01/15 17:42:35 ando Exp $ +# $OpenLDAP: pkg/ldap/tests/scripts/relay,v 1.6 2005/01/19 22:49:24 ando Exp $ ## This work is part of OpenLDAP Software . ## ## Copyright 1998-2005 The OpenLDAP Foundation. @@ -174,6 +174,50 @@ if test $RC != 0 ; then exit $RC fi +BASEDN="o=Example,c=US" +echo "Modifying database \"$BASEDN\"..." +$LDAPMODIFY -v -D "cn=Manager,$BASEDN" -h $LOCALHOST -p $PORT1 -w $PASSWD \ + -M >> $TESTOUT 2>&1 << EOMODS +dn: cn=Added Group,ou=Groups,$BASEDN +changetype: add +objectClass: groupOfNames +objectClass: uidObject +cn: Added Group +member: cn=Added Group,ou=Groups,$BASEDN +uid: added + +dn: cn=Another Added Group,ou=Groups,$BASEDN +changetype: add +objectClass: groupOfNames +cn: Another Added Group +member: cn=Added Group,ou=Groups,$BASEDN +member: cn=Another Added Group,ou=Groups,$BASEDN + +dn: cn=Another Added Group,ou=Groups,$BASEDN +changetype: modify +add: objectClass +objectClass: uidObject +- +add: uid +uid: added +- + +dn: cn=Added Group,ou=Groups,$BASEDN +changetype: modify +delete: objectClass +objectClass: uidObject +- +delete: uid +- +EOMODS + +RC=$? +if test $RC != 0 ; then + echo "Modify failed ($RC)!" + test $KILLSERVERS != no && kill -HUP $KILLPIDS + exit $RC +fi + echo "Searching base=\"$BASEDN\"..." echo "# searching base=\"$BASEDN\"..." >> $SEARCHOUT $LDAPSEARCH -h $LOCALHOST -p $PORT1 -b "$BASEDN" >> $SEARCHOUT 2>&1 @@ -249,6 +293,23 @@ $LDAPSEARCH -h $LOCALHOST -p $PORT1 -b " >> $SEARCHOUT 2>&1 RC=$? if test $RC != 0 ; then + echo "Search failed ($RC)!" + test $KILLSERVERS != no && kill -HUP $KILLPIDS + exit $RC +fi + +BASEDN="o=Example,c=US" +FILTER="(member=cn=Another Added Group,ou=Groups,$BASEDN)" +echo "Searching filter=\"$FILTER\"" +echo " attrs=\"member\"" +echo " base=\"$BASEDN\"..." +echo "# searching filter=\"$FILTER\"" >> $SEARCHOUT +echo "# attrs=\"seeAlso\"" >> $SEARCHOUT +echo "# base=\"$BASEDN\"..." >> $SEARCHOUT +$LDAPSEARCH -h $LOCALHOST -p $PORT1 -b "$BASEDN" "$FILTER" member \ + >> $SEARCHOUT 2>&1 +RC=$? +if test $RC != 0 ; then echo "Search failed ($RC)!" test $KILLSERVERS != no && kill -HUP $KILLPIDS exit $RC