diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-06-03 05:34:59 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-06-03 05:34:59 +0000 |
commit | 36a5f1403a91d93db689e989ead3d9cf140c3cde (patch) | |
tree | 278cc6e7860205b0d40a895b977a46ea09018eb2 /tests/scripts/test052-memberof | |
parent | Releasing progress-linux version 2.6.7+dfsg-1~exp1~progress7.99u1. (diff) | |
download | openldap-36a5f1403a91d93db689e989ead3d9cf140c3cde.tar.xz openldap-36a5f1403a91d93db689e989ead3d9cf140c3cde.zip |
Merging upstream version 2.6.8+dfsg.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'tests/scripts/test052-memberof')
-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 |