diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-06-03 05:34:56 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-06-03 05:34:56 +0000 |
commit | 3102bdaf142acf3c952310cb620274258492a795 (patch) | |
tree | 907e389a831fe1f9dc5d94479d8457584b352434 /tests/scripts/test052-memberof | |
parent | Adding debian version 2.6.7+dfsg-1~exp1. (diff) | |
download | openldap-3102bdaf142acf3c952310cb620274258492a795.tar.xz openldap-3102bdaf142acf3c952310cb620274258492a795.zip |
Merging upstream version 2.6.8+dfsg.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to '')
-rwxr-xr-x | tests/scripts/test052-memberof | 57 |
1 files changed, 56 insertions, 1 deletions
diff --git a/tests/scripts/test052-memberof b/tests/scripts/test052-memberof index afa5eb9..04a5745 100755 --- a/tests/scripts/test052-memberof +++ b/tests/scripts/test052-memberof @@ -2,7 +2,7 @@ # $OpenLDAP$ ## This work is part of OpenLDAP Software <http://www.openldap.org/>. ## -## Copyright 1998-2022 The OpenLDAP Foundation. +## Copyright 1998-2024 The OpenLDAP Foundation. ## All rights reserved. ## ## Redistribution and use in source and binary forms, with or without @@ -441,6 +441,61 @@ if test $RC != 0 ; then exit $RC fi +echo "Running ldapmodify to enable add checking..." +$LDAPMODIFY -H $URI1 -D 'cn=config' -w `cat $CONFIGPWF` \ + >> $TESTOUT 2>&1 <<EOF +dn: olcOverlay={0}memberof,olcDatabase={1}$BACKEND,cn=config +changetype: modify +replace: olcMemberOfAddCheck +olcMemberOfAddCheck: TRUE + +EOF +RC=$? +if test $RC != 0 ; then + echo "ldapmodify failed ($RC)!" + test $KILLSERVERS != no && kill -HUP $KILLPIDS + exit $RC +fi + +echo "Adding group and users out of order..." +$LDAPADD -H $URI1 \ + -D "cn=Manager,$BASEDN" -w secret \ + >> $TESTOUT 2>&1 <<EOF +dn: cn=group3,ou=Groups,$BASEDN +objectclass: groupOfNames +cn: group3 +member: cn=New Person,ou=People,$BASEDN +member: cn=New Group,ou=Groups,$BASEDN + +dn: cn=New Group,ou=Groups,$BASEDN +objectclass: groupOfNames +cn: New Group +member: cn=New Person,ou=People,$BASEDN + +dn: cn=New Person,ou=People,$BASEDN +objectclass: person +cn: New Person +sn: Person + +EOF +RC=$? +if test $RC != 0 ; then + echo "ldapadd failed ($RC)!" + test $KILLSERVERS != no && kill -HUP $KILLPIDS + exit $RC +fi + +echo "Re-search the entire database..." +echo "# Re-search the entire database after adding out-of-order groups/users..." >> $SEARCHOUT +$LDAPSEARCH -S "" -b "$BASEDN" -H $URI1 \ + '(objectClass=*)' '*' memberOf >> $SEARCHOUT 2>&1 +RC=$? +if test $RC != 0 ; then + echo "ldapsearch failed ($RC)!" + test $KILLSERVERS != no && kill -HUP $KILLPIDS + exit $RC +fi + test $KILLSERVERS != no && kill -HUP $KILLPIDS LDIF=$MEMBEROFOUT |