From: Pierangelo Masarati Date: Thu, 13 Sep 2007 17:58:10 +0000 (+0000) Subject: fix test when slapo-memberof(5) built as module (ITS#5132) X-Git-Tag: OPENLDAP_REL_ENG_2_4_9~20^2~655 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=9f3f281df0d733b6a8ec90a76cc9c79096631b98;p=openldap fix test when slapo-memberof(5) built as module (ITS#5132) --- diff --git a/tests/run.in b/tests/run.in index 24133fbcb5..d00d212f24 100644 --- a/tests/run.in +++ b/tests/run.in @@ -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 diff --git a/tests/scripts/conf.sh b/tests/scripts/conf.sh index 25dd524f01..89d76fdacf 100755 --- a/tests/scripts/conf.sh +++ b/tests/scripts/conf.sh @@ -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}#//" \ diff --git a/tests/scripts/defines.sh b/tests/scripts/defines.sh index ae55ad3995..38f16e353d 100755 --- a/tests/scripts/defines.sh +++ b/tests/scripts/defines.sh @@ -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} diff --git a/tests/scripts/test052-memberof b/tests/scripts/test052-memberof index 687b53ede8..6a0881c4db 100755 --- a/tests/scripts/test052-memberof +++ b/tests/scripts/test052-memberof @@ -16,6 +16,11 @@ 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 < $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 <