From 37964b63e323fd83fe1cb9f07cf12c4c1a10a7c4 Mon Sep 17 00:00:00 2001
From: Howard Chu <hyc@openldap.org>
Date: Thu, 4 Dec 2003 11:15:07 +0000
Subject: [PATCH] ITS#2740, #2859 fixes for dynamic backends

---
 tests/data/slapd-acl.conf                     | 4 ++--
 tests/data/slapd-cache-master.conf            | 4 ++--
 tests/data/slapd-dnssrv.conf                  | 4 ++--
 tests/data/slapd-glue.conf                    | 4 ++--
 tests/data/slapd-master.conf                  | 4 ++--
 tests/data/slapd-nis-master.conf              | 4 ++--
 tests/data/slapd-passwd.conf                  | 4 ++--
 tests/data/slapd-proxycache.conf              | 6 ++++--
 tests/data/slapd-pw.conf                      | 4 ++--
 tests/data/slapd-ref-slave.conf               | 4 ++--
 tests/data/slapd-referrals.conf               | 4 ++--
 tests/data/slapd-repl-master.conf             | 4 ++--
 tests/data/slapd-repl-slave.conf              | 4 ++--
 tests/data/slapd-schema.conf                  | 4 ++--
 tests/data/slapd-syncrepl-master.conf         | 4 ++--
 tests/data/slapd-syncrepl-slave-persist1.conf | 4 ++--
 tests/data/slapd-syncrepl-slave-persist2.conf | 4 ++--
 tests/data/slapd-syncrepl-slave-persist3.conf | 4 ++--
 tests/data/slapd-syncrepl-slave-refresh1.conf | 4 ++--
 tests/data/slapd-syncrepl-slave-refresh2.conf | 4 ++--
 tests/data/slapd.conf                         | 5 ++---
 tests/data/slapd2.conf                        | 5 ++---
 tests/run.in                                  | 4 +++-
 tests/scripts/conf.sh                         | 7 +++----
 24 files changed, 52 insertions(+), 51 deletions(-)

diff --git a/tests/data/slapd-acl.conf b/tests/data/slapd-acl.conf
index 2c4a1f2573..d54893fc87 100644
--- a/tests/data/slapd-acl.conf
+++ b/tests/data/slapd-acl.conf
@@ -26,8 +26,8 @@ argsfile    ./testrun/slapd.1.args
 access to dn.base="" attr=objectClass by users read
 access to * by * read
 
-modulepath      ../servers/slapd/back-@BACKEND@/
-@MODULELOAD@
+#mod#modulepath	../servers/slapd/back-@BACKEND@/
+#mod#moduleload	back_@BACKEND@.la
 
 #######################################################################
 # ldbm database definitions
diff --git a/tests/data/slapd-cache-master.conf b/tests/data/slapd-cache-master.conf
index 122e98fb4e..881c23e366 100644
--- a/tests/data/slapd-cache-master.conf
+++ b/tests/data/slapd-cache-master.conf
@@ -23,8 +23,8 @@ include ./schema/nis.schema
 pidfile     ./testrun/slapd.1.pid
 argsfile    ./testrun/slapd.1.args
 
-modulepath      ../servers/slapd/back-@BACKEND@/
-@MODULELOAD@
+#mod#modulepath	../servers/slapd/back-@BACKEND@/
+#mod#moduleload	back_@BACKEND@.la
 
 #######################################################################
 # database definitions
diff --git a/tests/data/slapd-dnssrv.conf b/tests/data/slapd-dnssrv.conf
index b8eaf00801..fe07cfd283 100644
--- a/tests/data/slapd-dnssrv.conf
+++ b/tests/data/slapd-dnssrv.conf
@@ -21,8 +21,8 @@ argsfile    ./test-db/slapd.args
 sasl-secprops noanonymous
 #sasl-secprops none
 
-modulepath      ../servers/slapd/back-@BACKEND@/
-@MODULELOAD@
+#mod#modulepath	../servers/slapd/back-@BACKEND@/
+#mod#moduleload	back_@BACKEND@.la
 
 #######################################################################
 # ldbm database definitions
diff --git a/tests/data/slapd-glue.conf b/tests/data/slapd-glue.conf
index f942ab26c0..2a7758d90b 100644
--- a/tests/data/slapd-glue.conf
+++ b/tests/data/slapd-glue.conf
@@ -22,8 +22,8 @@ include ./schema/nis.schema
 pidfile     ./testrun/slapd.1.pid
 argsfile    ./testrun/slapd.1.args
 
-modulepath      ../servers/slapd/back-@BACKEND@/
-@MODULELOAD@
+#mod#modulepath	../servers/slapd/back-@BACKEND@/
+#mod#moduleload	back_@BACKEND@.la
 
 #######################################################################
 # ldbm database definitions
diff --git a/tests/data/slapd-master.conf b/tests/data/slapd-master.conf
index 6d43331523..c67b0fc4ac 100644
--- a/tests/data/slapd-master.conf
+++ b/tests/data/slapd-master.conf
@@ -25,8 +25,8 @@ include ./testdata/ditcontentrules.conf
 pidfile     ./testrun/slapd.1.pid
 argsfile    ./testrun/slapd.1.args
 
-modulepath      ../servers/slapd/back-@BACKEND@/
-@MODULELOAD@
+#mod#modulepath	../servers/slapd/back-@BACKEND@/
+#mod#moduleload	back_@BACKEND@.la
 
 #######################################################################
 # ldbm database definitions
diff --git a/tests/data/slapd-nis-master.conf b/tests/data/slapd-nis-master.conf
index fbf36868cb..fc624be89f 100644
--- a/tests/data/slapd-nis-master.conf
+++ b/tests/data/slapd-nis-master.conf
@@ -23,8 +23,8 @@ include		./schema/internet_mail.oc.conf
 pidfile     ./test-db/slapd.pid
 argsfile    ./test-db/slapd.args
 
-modulepath      ../servers/slapd/back-@BACKEND@/
-@MODULELOAD@
+#mod#modulepath	../servers/slapd/back-@BACKEND@/
+#mod#moduleload	back_@BACKEND@.la
 
 #######################################################################
 # ldbm database definitions
diff --git a/tests/data/slapd-passwd.conf b/tests/data/slapd-passwd.conf
index ffe8d65216..54bea414d9 100644
--- a/tests/data/slapd-passwd.conf
+++ b/tests/data/slapd-passwd.conf
@@ -22,8 +22,8 @@ include ./schema/nis.schema
 pidfile     ./test-db/slapd.pid
 argsfile    ./test-db/slapd.args
 
-modulepath      ../servers/slapd/back-@BACKEND@/
-@MODULELOAD@
+#mod#modulepath	../servers/slapd/back-@BACKEND@/
+#mod#moduleload	back_@BACKEND@.la
 
 #######################################################################
 # ldbm database definitions
diff --git a/tests/data/slapd-proxycache.conf b/tests/data/slapd-proxycache.conf
index b8b74134e0..b2add6011e 100644
--- a/tests/data/slapd-proxycache.conf
+++ b/tests/data/slapd-proxycache.conf
@@ -25,8 +25,10 @@ argsfile    ./testrun/slapd.2.args
 
 access to * by write
 
-modulepath      ../servers/slapd/back-@BACKEND@/
-@MODULELOAD@
+#mod#modulepath	../servers/slapd/back-@BACKEND@/
+#mod#moduleload	back_@BACKEND@.la
+#ldapmod#moduleload	../servers/slapd/back-ldap/back_ldap.la
+#metamod#moduleload	../servers/slapd/back-meta/back_meta.la
 
 #######################################################################
 # database definitions
diff --git a/tests/data/slapd-pw.conf b/tests/data/slapd-pw.conf
index 25a0646f2a..d1ed9552b2 100644
--- a/tests/data/slapd-pw.conf
+++ b/tests/data/slapd-pw.conf
@@ -24,8 +24,8 @@ argsfile    ./testrun/slapd.1.args
 
 # password-hash	{md5}
 
-modulepath      ../servers/slapd/back-@BACKEND@/
-@MODULELOAD@
+#mod#modulepath	../servers/slapd/back-@BACKEND@/
+#mod#moduleload	back_@BACKEND@.la
 
 #######################################################################
 # ldbm database definitions
diff --git a/tests/data/slapd-ref-slave.conf b/tests/data/slapd-ref-slave.conf
index ffaab2a17e..ceb4e474d6 100644
--- a/tests/data/slapd-ref-slave.conf
+++ b/tests/data/slapd-ref-slave.conf
@@ -23,8 +23,8 @@ include ./schema/nis.schema
 pidfile     ./testrun/slapd.2.pid
 argsfile    ./testrun/slapd.2.args
 
-modulepath      ../servers/slapd/back-@BACKEND@/
-@MODULELOAD@
+#mod#modulepath	../servers/slapd/back-@BACKEND@/
+#mod#moduleload	back_@BACKEND@.la
 
 #######################################################################
 # ldbm database definitions
diff --git a/tests/data/slapd-referrals.conf b/tests/data/slapd-referrals.conf
index 1715ed180c..a4ab357025 100644
--- a/tests/data/slapd-referrals.conf
+++ b/tests/data/slapd-referrals.conf
@@ -22,8 +22,8 @@ include ./schema/nis.schema
 pidfile     ./testrun/slapd.pid
 argsfile    ./testrun/slapd.args
 
-modulepath      ../servers/slapd/back-@BACKEND@/
-@MODULELOAD@
+#mod#modulepath	../servers/slapd/back-@BACKEND@/
+#mod#moduleload	back_@BACKEND@.la
 
 #######################################################################
 # ldbm database definitions
diff --git a/tests/data/slapd-repl-master.conf b/tests/data/slapd-repl-master.conf
index d63f800cca..6c5d3077b6 100644
--- a/tests/data/slapd-repl-master.conf
+++ b/tests/data/slapd-repl-master.conf
@@ -23,8 +23,8 @@ include ./schema/nis.schema
 pidfile     ./testrun/slapd.1.pid
 argsfile    ./testrun/slapd.1.args
 
-modulepath      ../servers/slapd/back-@BACKEND@/
-@MODULELOAD@
+#mod#modulepath	../servers/slapd/back-@BACKEND@/
+#mod#moduleload	back_@BACKEND@.la
 
 #######################################################################
 # ldbm database definitions
diff --git a/tests/data/slapd-repl-slave.conf b/tests/data/slapd-repl-slave.conf
index df8e27c917..94b23e41a0 100644
--- a/tests/data/slapd-repl-slave.conf
+++ b/tests/data/slapd-repl-slave.conf
@@ -23,8 +23,8 @@ include ./schema/nis.schema
 pidfile     ./testrun/slapd.2.pid
 argsfile    ./testrun/slapd.2.args
 
-modulepath      ../servers/slapd/back-@BACKEND@/
-@MODULELOAD@
+#mod#modulepath	../servers/slapd/back-@BACKEND@/
+#mod#moduleload	back_@BACKEND@.la
 
 #######################################################################
 # ldbm database definitions
diff --git a/tests/data/slapd-schema.conf b/tests/data/slapd-schema.conf
index b01053a75c..15f7c57a4c 100644
--- a/tests/data/slapd-schema.conf
+++ b/tests/data/slapd-schema.conf
@@ -33,8 +33,8 @@ argsfile    ./testrun/slapd.1.args
 #
 rootdse 	./testdata/rootdse.ldif
 
-modulepath	../servers/slapd/back-@BACKEND@/
-@MODULELOAD@
+#mod#modulepath	../servers/slapd/back-@BACKEND@/
+#mod#moduleload	back_@BACKEND@.la
 
 #######################################################################
 # ldbm database definitions
diff --git a/tests/data/slapd-syncrepl-master.conf b/tests/data/slapd-syncrepl-master.conf
index 35d51145dd..a5d8d0b097 100644
--- a/tests/data/slapd-syncrepl-master.conf
+++ b/tests/data/slapd-syncrepl-master.conf
@@ -23,8 +23,8 @@ include ./schema/nis.schema
 pidfile     ./testrun/slapd.1.pid
 argsfile    ./testrun/slapd.1.args
 
-modulepath      ../servers/slapd/back-@BACKEND@/
-@MODULELOAD@
+#mod#modulepath	../servers/slapd/back-@BACKEND@/
+#mod#moduleload	back_@BACKEND@.la
 
 #######################################################################
 # master database definitions
diff --git a/tests/data/slapd-syncrepl-slave-persist1.conf b/tests/data/slapd-syncrepl-slave-persist1.conf
index 6a7c2016af..3eba9cf275 100644
--- a/tests/data/slapd-syncrepl-slave-persist1.conf
+++ b/tests/data/slapd-syncrepl-slave-persist1.conf
@@ -23,8 +23,8 @@ include ./schema/nis.schema
 pidfile     ./testrun/slapd.4.pid
 argsfile    ./testrun/slapd.4.args
 
-modulepath      ../servers/slapd/back-@BACKEND@/
-@MODULELOAD@
+#mod#modulepath	../servers/slapd/back-@BACKEND@/
+#mod#moduleload	back_@BACKEND@.la
 
 #######################################################################
 # consumer database definitions
diff --git a/tests/data/slapd-syncrepl-slave-persist2.conf b/tests/data/slapd-syncrepl-slave-persist2.conf
index 7b9ca28a89..d0d80058f8 100644
--- a/tests/data/slapd-syncrepl-slave-persist2.conf
+++ b/tests/data/slapd-syncrepl-slave-persist2.conf
@@ -11,8 +11,8 @@ include ./schema/nis.schema
 pidfile     ./testrun/slapd.5.pid
 argsfile    ./testrun/slapd.5.args
 
-modulepath      ../servers/slapd/back-@BACKEND@/
-@MODULELOAD@
+#mod#modulepath	../servers/slapd/back-@BACKEND@/
+#mod#moduleload	back_@BACKEND@.la
 
 #######################################################################
 # consumer database definitions
diff --git a/tests/data/slapd-syncrepl-slave-persist3.conf b/tests/data/slapd-syncrepl-slave-persist3.conf
index 01cb1799d7..372104a59a 100644
--- a/tests/data/slapd-syncrepl-slave-persist3.conf
+++ b/tests/data/slapd-syncrepl-slave-persist3.conf
@@ -23,8 +23,8 @@ include ./schema/nis.schema
 pidfile     ./testrun/slapd.6.pid
 argsfile    ./testrun/slapd.6.args
 
-modulepath      ../servers/slapd/back-@BACKEND@/
-@MODULELOAD@
+#mod#modulepath	../servers/slapd/back-@BACKEND@/
+#mod#moduleload	back_@BACKEND@.la
 
 #######################################################################
 # consumer database definitions
diff --git a/tests/data/slapd-syncrepl-slave-refresh1.conf b/tests/data/slapd-syncrepl-slave-refresh1.conf
index b4cfc380d5..f0ee980a4a 100644
--- a/tests/data/slapd-syncrepl-slave-refresh1.conf
+++ b/tests/data/slapd-syncrepl-slave-refresh1.conf
@@ -23,8 +23,8 @@ include ./schema/nis.schema
 pidfile     ./testrun/slapd.2.pid
 argsfile    ./testrun/slapd.2.args
 
-modulepath      ../servers/slapd/back-@BACKEND@/
-@MODULELOAD@
+#mod#modulepath	../servers/slapd/back-@BACKEND@/
+#mod#moduleload	back_@BACKEND@.la
 
 #######################################################################
 # consumer database definitions
diff --git a/tests/data/slapd-syncrepl-slave-refresh2.conf b/tests/data/slapd-syncrepl-slave-refresh2.conf
index 64c6ccb6eb..3a755be615 100644
--- a/tests/data/slapd-syncrepl-slave-refresh2.conf
+++ b/tests/data/slapd-syncrepl-slave-refresh2.conf
@@ -23,8 +23,8 @@ include ./schema/nis.schema
 pidfile     ./testrun/slapd.3.pid
 argsfile    ./testrun/slapd.3.args
 
-modulepath      ../servers/slapd/back-@BACKEND@/
-@MODULELOAD@
+#mod#modulepath	../servers/slapd/back-@BACKEND@/
+#mod#moduleload	back_@BACKEND@.la
 
 #######################################################################
 # consumer database definitions
diff --git a/tests/data/slapd.conf b/tests/data/slapd.conf
index 9d6af807fc..0820faed5f 100644
--- a/tests/data/slapd.conf
+++ b/tests/data/slapd.conf
@@ -24,9 +24,8 @@ include ./schema/nis.schema
 pidfile     ./testrun/slapd.1.pid
 argsfile    ./testrun/slapd.1.args
 
-modulepath      ../servers/slapd/back-@BACKEND@/
-@MODULELOAD@
-
+#mod#modulepath	../servers/slapd/back-@BACKEND@/
+#mod#moduleload	back_@BACKEND@.la
 
 #######################################################################
 # database definitions
diff --git a/tests/data/slapd2.conf b/tests/data/slapd2.conf
index 296f2e9075..fa58dbfddd 100644
--- a/tests/data/slapd2.conf
+++ b/tests/data/slapd2.conf
@@ -23,9 +23,8 @@ include ./schema/nis.schema
 pidfile     ./testrun/slapd.2.pid
 argsfile    ./testrun/slapd.2.args
 
-modulepath      ../servers/slapd/back-@BACKEND@/
-@MODULELOAD@
-
+#mod#modulepath	../servers/slapd/back-@BACKEND@/
+#mod#moduleload	back_@BACKEND@.la
 
 #######################################################################
 # database definitions
diff --git a/tests/run.in b/tests/run.in
index 5c7ac93f90..16e5a0a0f5 100644
--- a/tests/run.in
+++ b/tests/run.in
@@ -25,11 +25,13 @@ export SRCDIR TOPSRCDIR LN_S
 AC_bdb=@BUILD_BDB@
 AC_hdb=@BUILD_HDB@
 AC_ldbm=@BUILD_LDBM@
+AC_ldap=ldap@BUILD_LDAP@
+AC_meta=meta@BUILD_META@
 AC_MONITOR=@BUILD_MONITOR@
 AC_CACHE=@BUILD_CACHE@
 AC_WITH_TLS=@WITH_TLS@
 
-export AC_MONITOR AC_CACHE AC_WITH_TLS
+export AC_MONITOR AC_CACHE AC_WITH_TLS AC_ldap AC_meta
 
 if test ! -x ../servers/slapd/slapd ; then
 	echo "Could not locate slapd(8)"
diff --git a/tests/scripts/conf.sh b/tests/scripts/conf.sh
index 9c51238e29..81f4b42f3a 100755
--- a/tests/scripts/conf.sh
+++ b/tests/scripts/conf.sh
@@ -17,12 +17,11 @@ if [ x"$MONITORDB" = x"yes" ] ; then
 else
 	MON=nomonitor
 fi
-if [ x"$BACKENDTYPE" = x"mod" ]; then
-	MODULELOAD="moduleload	back_${BACKEND}.la"
-fi
 sed -e "s/@BACKEND@/${BACKEND}/"	\
-	-e "s/@MODULELOAD@/${MODULELOAD}/" \
 	-e "s/^#${BACKEND}#//"			\
+	-e "s/^#${BACKENDTYPE}#//"			\
+	-e "s/^#${AC_ldap}#//"			\
+	-e "s/^#${AC_meta}#//"			\
 	-e "s/^#${MON}#//"				\
 	-e "s/@CACHETTL@/${CACHETTL}/"   \
 	-e "s/@ENTRY_LIMIT@/${CACHE_ENTRY_LIMIT}/"   
-- 
GitLab