X-Git-Url: https://git.sur5r.net/?a=blobdiff_plain;ds=sidebyside;f=tests%2Fscripts%2Ftest052-memberof;h=b697ad8ae543452266c52a24554be23469520cbd;hb=e76299c196bb93fd2e3ca7972260aa55f9c1a796;hp=8dc24f784892f39f44e70418bd84bfd784bc6c6d;hpb=0f86c2e8eb07910670ab5262d470efaf6c497898;p=openldap
diff --git a/tests/scripts/test052-memberof b/tests/scripts/test052-memberof
index 8dc24f7848..b697ad8ae5 100755
--- a/tests/scripts/test052-memberof
+++ b/tests/scripts/test052-memberof
@@ -2,7 +2,7 @@
# $OpenLDAP$
## This work is part of OpenLDAP Software .
##
-## Copyright 1998-2009 The OpenLDAP Foundation.
+## Copyright 1998-2011 The OpenLDAP Foundation.
## All rights reserved.
##
## Redistribution and use in source and binary forms, with or without
@@ -56,7 +56,7 @@ fi
cat /dev/null > $TESTOUT
if [ "$MEMBEROF" = memberofmod ]; then
- echo "Inserting memberof overlay on producer..."
+ echo "Inserting memberof overlay on provider..."
$LDAPADD -D cn=config -H $URI1 -y $CONFIGPWF < $TESTOUT 2>&1
dn: cn=module,cn=config
objectClass: olcModuleList
@@ -72,6 +72,14 @@ EOF
fi
fi
+indexInclude="" mainInclude="" bdbInclude="# " nullExclude=""
+test $INDEXDB = indexdb || indexInclude="# "
+test $MAINDB = maindb || mainInclude="# "
+case $BACKEND in
+bdb | hdb) bdbInclude="" ;;
+null) nullExclude="# " ;;
+esac
+
echo "Running ldapadd to build slapd config database..."
$LDAPADD -h $LOCALHOST -p $PORT1 -D 'cn=config' -w `cat $CONFIGPWF` \
>> $TESTOUT 2>&1 <> $SEARCHOUT
+echo "# Re-search the entire database after adding Jessica Rabbit and Cartoonia..." >> $SEARCHOUT
$LDAPSEARCH -S "" -b "$BASEDN" -h $LOCALHOST -p $PORT1 \
'(objectClass=*)' '*' memberOf >> $SEARCHOUT 2>&1
RC=$?
@@ -225,18 +233,60 @@ if test $RC != 0 ; then
exit $RC
fi
-echo "Running ldapmodify to add self..."
+echo "Running ldapmodify to rename a member..."
+$LDAPMODIFY -h $LOCALHOST -p $PORT1 \
+ -D "cn=Manager,$BASEDN" -w secret \
+ >> $TESTOUT 2>&1 << EOF
+dn: cn=Baby Herman,ou=People,$BASEDN
+changetype: modrdn
+newrdn: cn=Baby Herman Jr
+deleteoldrdn: 1
+EOF
+
+echo "Re-search the entire database..."
+echo "# Re-search the entire database after renaming Baby Herman..." >> $SEARCHOUT
+$LDAPSEARCH -S "" -b "$BASEDN" -h $LOCALHOST -p $PORT1 \
+ '(objectClass=*)' '*' memberOf >> $SEARCHOUT 2>&1
+RC=$?
+if test $RC != 0 ; then
+ echo "ldapsearch failed ($RC)!"
+ test $KILLSERVERS != no && kill -HUP $KILLPIDS
+ exit $RC
+fi
+
+echo "Running ldapmodify to rename a group..."
$LDAPMODIFY -h $LOCALHOST -p $PORT1 \
-D "cn=Manager,$BASEDN" -w secret \
>> $TESTOUT 2>&1 << EOF
dn: cn=Cartoonia,ou=Groups,$BASEDN
+changetype: modrdn
+newrdn: cn=Toon Town
+deleteoldrdn: 1
+EOF
+
+echo "Re-search the entire database..."
+echo "# Re-search the entire database after renaming Cartoonia..." >> $SEARCHOUT
+$LDAPSEARCH -S "" -b "$BASEDN" -h $LOCALHOST -p $PORT1 \
+ '(objectClass=*)' '*' memberOf >> $SEARCHOUT 2>&1
+RC=$?
+if test $RC != 0 ; then
+ echo "ldapsearch failed ($RC)!"
+ test $KILLSERVERS != no && kill -HUP $KILLPIDS
+ exit $RC
+fi
+
+echo "Running ldapmodify to add self..."
+$LDAPMODIFY -h $LOCALHOST -p $PORT1 \
+ -D "cn=Manager,$BASEDN" -w secret \
+ >> $TESTOUT 2>&1 << EOF
+dn: cn=Toon Town,ou=Groups,$BASEDN
changetype: modify
add: member
-member: cn=Cartoonia,ou=Groups,$BASEDN
+member: cn=Toon Town,ou=Groups,$BASEDN
EOF
echo "Re-search the entire database..."
-echo "# Re-search the entire database..." >> $SEARCHOUT
+echo "# Re-search the entire database after adding Toon Town to self..." >> $SEARCHOUT
$LDAPSEARCH -S "" -b "$BASEDN" -h $LOCALHOST -p $PORT1 \
'(objectClass=*)' '*' memberOf >> $SEARCHOUT 2>&1
RC=$?
@@ -250,12 +300,31 @@ echo "Running ldapdelete to remove a member..."
$LDAPMODIFY -h $LOCALHOST -p $PORT1 \
-D "cn=Manager,$BASEDN" -w secret \
>> $TESTOUT 2>&1 << EOF
-dn: cn=Baby Herman,ou=People,$BASEDN
+dn: cn=Baby Herman Jr,ou=People,$BASEDN
changetype: delete
EOF
echo "Re-search the entire database..."
-echo "# Re-search the entire database..." >> $SEARCHOUT
+echo "# Re-search the entire database after deleting Baby Herman..." >> $SEARCHOUT
+$LDAPSEARCH -S "" -b "$BASEDN" -h $LOCALHOST -p $PORT1 \
+ '(objectClass=*)' '*' memberOf >> $SEARCHOUT 2>&1
+RC=$?
+if test $RC != 0 ; then
+ echo "ldapsearch failed ($RC)!"
+ test $KILLSERVERS != no && kill -HUP $KILLPIDS
+ exit $RC
+fi
+
+echo "Running ldapdelete to remove a group..."
+$LDAPMODIFY -h $LOCALHOST -p $PORT1 \
+ -D "cn=Manager,$BASEDN" -w secret \
+ >> $TESTOUT 2>&1 << EOF
+dn: cn=Toon Town,ou=Groups,$BASEDN
+changetype: delete
+EOF
+
+echo "Re-search the entire database..."
+echo "# Re-search the entire database after deleting Toon Town..." >> $SEARCHOUT
$LDAPSEARCH -S "" -b "$BASEDN" -h $LOCALHOST -p $PORT1 \
'(objectClass=*)' '*' memberOf >> $SEARCHOUT 2>&1
RC=$?
@@ -275,9 +344,6 @@ changetype: delete
dn: cn=Jessica Rabbit,ou=People,$BASEDN
changetype: delete
-dn: cn=Cartoonia,ou=Groups,$BASEDN
-changetype: delete
-
dn: cn=person1,ou=People,$BASEDN
changetype: add
objectClass: person
@@ -315,7 +381,7 @@ delete: memberA
EOF
echo "Re-search the entire database..."
-echo "# Re-search the entire database..." >> $SEARCHOUT
+echo "# Re-search the entire database after adding groups with MAY member type schemas..." >> $SEARCHOUT
$LDAPSEARCH -S "" -b "$BASEDN" -h $LOCALHOST -p $PORT1 \
'(objectClass=*)' '*' memberOf >> $SEARCHOUT 2>&1
RC=$?