From 59897fcc6686e3dcd51c4975aa886f4860ccf779 Mon Sep 17 00:00:00 2001 From: Howard Chu Date: Tue, 3 Feb 2009 02:16:03 +0000 Subject: [PATCH] ITS#5903 more tests --- tests/data/memberof.out | 41 ++++++++++++++ tests/scripts/test052-memberof | 100 ++++++++++++++++++++++++++++++++- 2 files changed, 140 insertions(+), 1 deletion(-) diff --git a/tests/data/memberof.out b/tests/data/memberof.out index ff6e7e3a63..833df204af 100644 --- a/tests/data/memberof.out +++ b/tests/data/memberof.out @@ -148,3 +148,44 @@ cn: Roger Rabbit sn: Rabbit memberOf: cn=Cartoonia,ou=Groups,dc=example,dc=com +# Re-search the entire database... +dn: dc=example,dc=com +objectClass: organization +objectClass: dcObject +o: Example, Inc. +dc: example + +dn: cn=group1,ou=Groups,dc=example,dc=com +objectClass: groupA +cn: group1 + +dn: cn=group2,ou=Groups,dc=example,dc=com +objectClass: groupB +cn: group2 +memberB: cn=person1,ou=People,dc=example,dc=com +memberB: cn=person2,ou=People,dc=example,dc=com + +dn: ou=Groups,dc=example,dc=com +objectClass: organizationalUnit +ou: Groups + +dn: ou=People,dc=example,dc=com +objectClass: organizationalUnit +ou: People + +dn: cn=person1,ou=People,dc=example,dc=com +objectClass: person +objectClass: groupMemberA +objectClass: groupMemberB +cn: person1 +sn: person1 +memberOfB: cn=group2,ou=Groups,dc=example,dc=com + +dn: cn=person2,ou=People,dc=example,dc=com +objectClass: person +objectClass: groupMemberA +objectClass: groupMemberB +cn: person2 +sn: person2 +memberOfB: cn=group2,ou=Groups,dc=example,dc=com + diff --git a/tests/scripts/test052-memberof b/tests/scripts/test052-memberof index 307336241a..22a45d2686 100755 --- a/tests/scripts/test052-memberof +++ b/tests/scripts/test052-memberof @@ -75,6 +75,26 @@ fi echo "Running ldapadd to build slapd config database..." $LDAPADD -h $LOCALHOST -p $PORT1 -D 'cn=config' -w `cat $CONFIGPWF` \ >> $TESTOUT 2>&1 <> $TESTOUT 2>&1 <> $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 + test $KILLSERVERS != no && kill -HUP $KILLPIDS LDIF=$MEMBEROFOUT -- 2.39.5