sn: Rabbit
memberOf: cn=Cartoonia,ou=Groups,dc=example,dc=com
-# Re-search the entire database...
+# Re-search the entire database after adding Jessica Rabbit and Cartoonia...
dn: cn=Baby Herman,ou=People,dc=example,dc=com
objectClass: inetOrgPerson
cn: Baby Herman
sn: Rabbit
memberOf: cn=Cartoonia,ou=Groups,dc=example,dc=com
-# Re-search the entire database...
-dn: cn=Baby Herman,ou=People,dc=example,dc=com
+# Re-search the entire database after renaming Baby Herman...
+dn: cn=Baby Herman Jr,ou=People,dc=example,dc=com
objectClass: inetOrgPerson
-cn: Baby Herman
sn: Herman
memberOf: cn=Cartoonia,ou=Groups,dc=example,dc=com
+cn: Baby Herman Jr
dn: cn=Cartoonia,ou=Groups,dc=example,dc=com
objectClass: groupOfNames
cn: Cartoonia
member: cn=Roger Rabbit,ou=People,dc=example,dc=com
-member: cn=Baby Herman,ou=People,dc=example,dc=com
member: cn=Jessica Rabbit,ou=People,dc=example,dc=com
-member: cn=Cartoonia,ou=Groups,dc=example,dc=com
-memberOf: cn=Cartoonia,ou=Groups,dc=example,dc=com
+member: cn=Baby Herman Jr,ou=People,dc=example,dc=com
dn: dc=example,dc=com
objectClass: organization
sn: Rabbit
memberOf: cn=Cartoonia,ou=Groups,dc=example,dc=com
-# Re-search the entire database...
-dn: cn=Cartoonia,ou=Groups,dc=example,dc=com
+# Re-search the entire database after renaming Cartoonia...
+dn: cn=Baby Herman Jr,ou=People,dc=example,dc=com
+objectClass: inetOrgPerson
+sn: Herman
+memberOf: cn=Toon Town,ou=Groups,dc=example,dc=com
+cn: Baby Herman Jr
+
+dn: dc=example,dc=com
+objectClass: organization
+objectClass: dcObject
+o: Example, Inc.
+dc: example
+
+dn: ou=Groups,dc=example,dc=com
+objectClass: organizationalUnit
+ou: Groups
+
+dn: cn=Jessica Rabbit,ou=People,dc=example,dc=com
+objectClass: inetOrgPerson
+cn: Jessica Rabbit
+sn: Rabbit
+memberOf: cn=Toon Town,ou=Groups,dc=example,dc=com
+
+dn: ou=People,dc=example,dc=com
+objectClass: organizationalUnit
+ou: People
+
+dn: cn=Roger Rabbit,ou=People,dc=example,dc=com
+objectClass: inetOrgPerson
+cn: Roger Rabbit
+sn: Rabbit
+memberOf: cn=Toon Town,ou=Groups,dc=example,dc=com
+
+dn: cn=Toon Town,ou=Groups,dc=example,dc=com
objectClass: groupOfNames
-cn: Cartoonia
member: cn=Roger Rabbit,ou=People,dc=example,dc=com
member: cn=Jessica Rabbit,ou=People,dc=example,dc=com
-member: cn=Cartoonia,ou=Groups,dc=example,dc=com
-memberOf: cn=Cartoonia,ou=Groups,dc=example,dc=com
+member: cn=Baby Herman Jr,ou=People,dc=example,dc=com
+cn: Toon Town
+
+# Re-search the entire database after adding Toon Town to self...
+dn: cn=Baby Herman Jr,ou=People,dc=example,dc=com
+objectClass: inetOrgPerson
+sn: Herman
+memberOf: cn=Toon Town,ou=Groups,dc=example,dc=com
+cn: Baby Herman Jr
dn: dc=example,dc=com
objectClass: organization
objectClass: inetOrgPerson
cn: Jessica Rabbit
sn: Rabbit
-memberOf: cn=Cartoonia,ou=Groups,dc=example,dc=com
+memberOf: cn=Toon Town,ou=Groups,dc=example,dc=com
+
+dn: ou=People,dc=example,dc=com
+objectClass: organizationalUnit
+ou: People
+
+dn: cn=Roger Rabbit,ou=People,dc=example,dc=com
+objectClass: inetOrgPerson
+cn: Roger Rabbit
+sn: Rabbit
+memberOf: cn=Toon Town,ou=Groups,dc=example,dc=com
+
+dn: cn=Toon Town,ou=Groups,dc=example,dc=com
+objectClass: groupOfNames
+member: cn=Roger Rabbit,ou=People,dc=example,dc=com
+member: cn=Jessica Rabbit,ou=People,dc=example,dc=com
+member: cn=Baby Herman Jr,ou=People,dc=example,dc=com
+member: cn=Toon Town,ou=Groups,dc=example,dc=com
+cn: Toon Town
+memberOf: cn=Toon Town,ou=Groups,dc=example,dc=com
+
+# Re-search the entire database after deleting Baby Herman...
+dn: dc=example,dc=com
+objectClass: organization
+objectClass: dcObject
+o: Example, Inc.
+dc: example
+
+dn: ou=Groups,dc=example,dc=com
+objectClass: organizationalUnit
+ou: Groups
+
+dn: cn=Jessica Rabbit,ou=People,dc=example,dc=com
+objectClass: inetOrgPerson
+cn: Jessica Rabbit
+sn: Rabbit
+memberOf: cn=Toon Town,ou=Groups,dc=example,dc=com
+
+dn: ou=People,dc=example,dc=com
+objectClass: organizationalUnit
+ou: People
+
+dn: cn=Roger Rabbit,ou=People,dc=example,dc=com
+objectClass: inetOrgPerson
+cn: Roger Rabbit
+sn: Rabbit
+memberOf: cn=Toon Town,ou=Groups,dc=example,dc=com
+
+dn: cn=Toon Town,ou=Groups,dc=example,dc=com
+objectClass: groupOfNames
+member: cn=Roger Rabbit,ou=People,dc=example,dc=com
+member: cn=Jessica Rabbit,ou=People,dc=example,dc=com
+member: cn=Toon Town,ou=Groups,dc=example,dc=com
+cn: Toon Town
+memberOf: cn=Toon Town,ou=Groups,dc=example,dc=com
+
+# Re-search the entire database after deleting Toon Town...
+dn: dc=example,dc=com
+objectClass: organization
+objectClass: dcObject
+o: Example, Inc.
+dc: example
+
+dn: ou=Groups,dc=example,dc=com
+objectClass: organizationalUnit
+ou: Groups
+
+dn: cn=Jessica Rabbit,ou=People,dc=example,dc=com
+objectClass: inetOrgPerson
+cn: Jessica Rabbit
+sn: Rabbit
dn: ou=People,dc=example,dc=com
objectClass: organizationalUnit
objectClass: inetOrgPerson
cn: Roger Rabbit
sn: Rabbit
-memberOf: cn=Cartoonia,ou=Groups,dc=example,dc=com
-# Re-search the entire database...
+# Re-search the entire database after adding groups with MAY member type schemas...
dn: dc=example,dc=com
objectClass: organization
objectClass: dcObject
EOF
echo "Re-search the entire database..."
-echo "# Re-search the entire database..." >> $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=$?
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=$?
$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 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..." >> $SEARCHOUT
+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=$?
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
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=$?