]> git.sur5r.net Git - openldap/blobdiff - tests/scripts/test052-memberof
s/ldap_sync.h/ldap.h/
[openldap] / tests / scripts / test052-memberof
index 687b53ede8c298be88b67c9f28de3fb4d4ce3e23..951405c2d2f68ea4cfedb9762a51a0cdecf62536 100755 (executable)
@@ -2,7 +2,7 @@
 # $OpenLDAP$
 ## This work is part of OpenLDAP Software <http://www.openldap.org/>.
 ##
-## Copyright 1998-2007 The OpenLDAP Foundation.
+## Copyright 1998-2008 The OpenLDAP Foundation.
 ## All rights reserved.
 ##
 ## Redistribution and use in source and binary forms, with or without
 echo "running defines.sh"
 . $SRCDIR/scripts/defines.sh
 
+if test $MEMBEROF = memberofno; then 
+       echo "Memberof overlay not available, test skipped"
+       exit 0
+fi 
+
 mkdir -p $TESTDIR $DBDIR1 $TESTDIR/confdir
 
 $SLAPPASSWD -g -n >$CONFIGPWF
@@ -50,13 +55,30 @@ fi
 
 cat /dev/null > $TESTOUT
 
+if [ "$MEMBEROF" = memberofmod ]; then
+       echo "Inserting memberof overlay on producer..."
+       $LDAPADD -D cn=config -H $URI1 -y $CONFIGPWF <<EOF > $TESTOUT 2>&1
+dn: cn=module,cn=config
+objectClass: olcModuleList
+cn: module
+olcModulePath: ../servers/slapd/overlays
+olcModuleLoad: memberof.la
+EOF
+       RC=$?
+       if test $RC != 0 ; then
+               echo "ldapadd failed for moduleLoad ($RC)!"
+               test $KILLSERVERS != no && kill -HUP $KILLPIDS
+               exit $RC
+       fi
+fi
+
 echo "Running ldapadd to build slapd config database..."
 $LDAPADD -h $LOCALHOST -p $PORT1 -D 'cn=config' -w `cat $CONFIGPWF` \
        >> $TESTOUT 2>&1 <<EOF
-dn: olcDatabase={1}bdb,cn=config
+dn: olcDatabase={1}$BACKEND,cn=config
 objectClass: olcDatabaseConfig
-objectClass: olcBdbConfig
-olcDatabase: {1}bdb
+objectClass: olc${BACKEND}Config
+olcDatabase: {1}$BACKEND
 olcSuffix: $BASEDN
 olcRootDN: cn=Manager,$BASEDN
 olcRootPW:: c2VjcmV0
@@ -69,8 +91,8 @@ olcDbIndex: uid pres,eq,sub
 olcDbIndex: sn pres,eq,sub
 olcDbMode: 384
 
-# {0}memberof, {1}bdb, config
-dn: olcOverlay={0}memberof,olcDatabase={1}bdb,cn=config
+# {0}memberof, {1}$BACKEND, config
+dn: olcOverlay={0}memberof,olcDatabase={1}$BACKEND,cn=config
 objectClass: olcOverlayConfig
 objectClass: olcMemberOf
 olcOverlay: {0}memberof