]> git.sur5r.net Git - openldap/commitdiff
fix test when slapo-memberof(5) built as module (ITS#5132)
authorPierangelo Masarati <ando@openldap.org>
Thu, 13 Sep 2007 17:58:10 +0000 (17:58 +0000)
committerPierangelo Masarati <ando@openldap.org>
Thu, 13 Sep 2007 17:58:10 +0000 (17:58 +0000)
tests/run.in
tests/scripts/conf.sh
tests/scripts/defines.sh
tests/scripts/test052-memberof

index 24133fbcb5d33e0156059cd874b8f927dfb082eb..d00d212f248836e5148ff0134fb203143da29fdb 100644 (file)
@@ -36,6 +36,7 @@ AC_sql=sql@BUILD_SQL@
 AC_accesslog=accesslog@BUILD_ACCESSLOG@
 AC_dds=dds@BUILD_DDS@
 AC_dynlist=dynlist@BUILD_DYNLIST@
+AC_memberof=memberof@BUILD_MEMBEROF@
 AC_pcache=pcache@BUILD_PROXYCACHE@
 AC_ppolicy=ppolicy@BUILD_PPOLICY@
 AC_refint=refint@BUILD_REFINT@
@@ -63,9 +64,9 @@ if test "${AC_meta}" = "metamod" && test "${AC_LIBS_DYNAMIC}" = "static" ; then
 fi
 
 export AC_bdb AC_hdb AC_ldap AC_meta AC_monitor AC_relay AC_sql \
-       AC_accesslog AC_dynlist AC_pcache AC_ppolicy AC_refint AC_retcode \
-       AC_rwm AC_unique AC_syncprov AC_translucent AC_valsort \
-       AC_dds \
+       AC_accesslog AC_dds AC_dynlist AC_memberof AC_pcache AC_ppolicy \
+       AC_refint AC_retcode AC_rwm AC_unique AC_syncprov AC_translucent \
+       AC_valsort \
        AC_WITH_SASL AC_WITH_TLS AC_WITH_MODULES_ENABLED AC_ACI_ENABLED \
        AC_THREADS AC_LIBS_DYNAMIC
 
index 25dd524f0176c20a2e5ff0c4c12da47652611054..89d76fdacfe50a916a5c48e6cc165b92e60dc4f4 100755 (executable)
@@ -44,6 +44,7 @@ sed -e "s/@BACKEND@/${BACKEND}/"                      \
        -e "s/^#${AC_accesslog}#//"                     \
        -e "s/^#${AC_dds}#//"                           \
        -e "s/^#${AC_dynlist}#//"                       \
+       -e "s/^#${AC_memberof}#//"                      \
        -e "s/^#${AC_pcache}#//"                        \
        -e "s/^#${AC_ppolicy}#//"                       \
        -e "s/^#${AC_refint}#//"                        \
index ae55ad3995bb26fbc3ef291eec07de46aa954aba..38f16e353d2dedc8fe213305beb3567b5f7693e6 100755 (executable)
@@ -30,6 +30,7 @@ BACKSQL=${AC_sql-sqlno}
 ACCESSLOG=${AC_accesslog-accesslogno}
 DDS=${AC_dds-ddsno}
 DYNLIST=${AC_dynlist-dynlistno}
+MEMBEROF=${AC_memberof-memberofno}
 PROXYCACHE=${AC_pcache-pcacheno}
 PPOLICY=${AC_ppolicy-ppolicyno}
 REFINT=${AC_refint-refintno}
index 687b53ede8c298be88b67c9f28de3fb4d4ce3e23..6a0881c4dbc0e43d8c2c4a324517bccb5c4c0792 100755 (executable)
 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,6 +55,23 @@ 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