diff --git a/tests/Makefile.in b/tests/Makefile.in
index b4c42571fa..57a782792a 100644
--- a/tests/Makefile.in
+++ b/tests/Makefile.in
@@ -55,7 +55,7 @@ lloadd test-lloadd: lloadd-$(BUILD_BALANCER)
lloadd-no:
@echo "run configure with --enable-balancer to run the Load Balancer tests"
-lloadd-yes: lloadd-slapd-$(BUILD_SLAPD)
+lloadd-yes lloadd-mod: lloadd-slapd-$(BUILD_SLAPD)
lloadd-slapd-no:
@echo "run configure with --enable-slapd to run the Load Balancer tests"
diff --git a/tests/data/slapd-lload.conf b/tests/data/slapd-lload.conf
new file mode 100644
index 0000000000..8ac942a96e
--- /dev/null
+++ b/tests/data/slapd-lload.conf
@@ -0,0 +1,33 @@
+# stand-alone slapd config -- for testing (with indexing)
+# $OpenLDAP$
+## This work is part of OpenLDAP Software .
+##
+## Copyright 1998-2020 The OpenLDAP Foundation.
+## All rights reserved.
+##
+## Redistribution and use in source and binary forms, with or without
+## modification, are permitted only as authorized by the OpenLDAP
+## Public License.
+##
+## A copy of this license is available in the file LICENSE in the
+## top-level directory of the distribution or, alternatively, at
+## .
+
+include @SCHEMADIR@/core.schema
+include @SCHEMADIR@/cosine.schema
+include @SCHEMADIR@/inetorgperson.schema
+include @SCHEMADIR@/openldap.schema
+include @SCHEMADIR@/nis.schema
+include @DATADIR@/test.schema
+
+#
+pidfile @TESTDIR@/slapd.1.pid
+argsfile @TESTDIR@/slapd.1.args
+
+# allow big PDUs from anonymous (for testing purposes)
+sockbuf_max_incoming 4194303
+
+modulepath ../servers/lloadd/
+moduleload lloadd.la @TESTDIR@/slapd.1.conf.lloadd "@URI1@"
+
+database monitor
diff --git a/tests/run.in b/tests/run.in
index 98119b78e6..5bdaa1b535 100644
--- a/tests/run.in
+++ b/tests/run.in
@@ -23,6 +23,9 @@ EGREP_CMD="@EGREP@"
export SRCDIR TOPSRCDIR LN_S EGREP_CMD
+# Load balancer
+AC_lloadd=lloadd@BUILD_BALANCER@
+
# backends known to ./run -b (used to deduce $BACKENDTYPE)
AC_ldif=yes
AC_mdb=@BUILD_MDB@
@@ -75,6 +78,7 @@ export AC_ldap AC_mdb AC_meta AC_asyncmeta AC_monitor AC_null AC_perl AC_relay A
AC_accesslog AC_autoca AC_constraint 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_lloadd \
AC_WITH_SASL AC_WITH_TLS AC_WITH_MODULES_ENABLED AC_ACI_ENABLED \
AC_LIBS_DYNAMIC AC_WITH_TLS AC_TLS_TYPE
diff --git a/tests/scripts/conf.sh b/tests/scripts/conf.sh
index 2e66e7715b..7b49c523db 100755
--- a/tests/scripts/conf.sh
+++ b/tests/scripts/conf.sh
@@ -49,6 +49,7 @@ sed -e "s/@BACKEND@/${BACKEND}/" \
-e "s/^#${AC_translucent}#//" \
-e "s/^#${AC_unique}#//" \
-e "s/^#${AC_valsort}#//" \
+ -e "s/^#${AC_lloadd}#//" \
-e "s/^#${INDEXDB}#//" \
-e "s/^#${MAINDB}#//" \
-e "s/^#${SASL}#//" \
diff --git a/tests/scripts/defines.sh b/tests/scripts/defines.sh
index 8dcd846157..61ac0798a5 100755
--- a/tests/scripts/defines.sh
+++ b/tests/scripts/defines.sh
@@ -151,6 +151,7 @@ VALREGEXCONF=$DATADIR/slapd-valregex.conf
DYNAMICCONF=$DATADIR/slapd-dynamic.ldif
+SLAPDLLOADCONF=$DATADIR/slapd-lload.conf
LLOADDCONF=$DATADIR/lloadd.conf
LLOADDANONCONF=$DATADIR/lloadd-anon.conf
LLOADDUNREACHABLECONF=$DATADIR/lloadd-backend-issues.conf
diff --git a/tests/scripts/lloadd/test000-rootdse b/tests/scripts/lloadd/test000-rootdse
index c20e999069..ddbd39e54a 100755
--- a/tests/scripts/lloadd/test000-rootdse
+++ b/tests/scripts/lloadd/test000-rootdse
@@ -49,8 +49,14 @@ fi
KILLPIDS="$KILLPIDS $PID"
echo "Starting lloadd on TCP/IP port $PORT1..."
-. $CONFFILTER $BACKEND < $LLOADDANONCONF > $CONF1
-$LLOADD -f $CONF1 -h $URI1 -d $LVL > $LOG1 2>&1 &
+. $CONFFILTER $BACKEND < $LLOADDANONCONF > $CONF1.lloadd
+if test $AC_lloadd = lloaddyes; then
+ $LLOADD -f $CONF1.lloadd -h $URI1 -d $LVL > $LOG1 2>&1 &
+else
+ . $CONFFILTER $BACKEND < $SLAPDLLOADCONF > $CONF1.slapd
+ # FIXME: this won't work on Windows, but lloadd doesn't support Windows yet
+ $SLAPD -f $CONF1.slapd -h $URI6 -d $LVL > $LOG1 2>&1 &
+fi
PID=$!
if test $WAIT != 0 ; then
echo PID $PID
diff --git a/tests/scripts/lloadd/test001-backend-issues b/tests/scripts/lloadd/test001-backend-issues
index c940ecde1b..93737a35f5 100755
--- a/tests/scripts/lloadd/test001-backend-issues
+++ b/tests/scripts/lloadd/test001-backend-issues
@@ -93,8 +93,13 @@ if test $RC != 0 ; then
fi
echo "Starting lloadd on TCP/IP port $PORT1..."
-. $CONFFILTER $BACKEND < $LLOADDUNREACHABLECONF > $CONF1
-$LLOADD -f $CONF1 -h $URI1 -d $LVL > $LOG1 2>&1 &
+. $CONFFILTER $BACKEND < $LLOADDUNREACHABLECONF > $CONF1.lloadd
+if test $AC_lloadd = lloaddyes; then
+ $LLOADD -f $CONF1.lloadd -h $URI1 -d $LVL > $LOG1 2>&1 &
+else
+ . $CONFFILTER $BACKEND < $SLAPDLLOADCONF > $CONF1.slapd
+ $SLAPD -f $CONF1.slapd -h $URI6 -d $LVL > $LOG1 2>&1 &
+fi
PID=$!
if test $WAIT != 0 ; then
echo PID $PID
diff --git a/tests/scripts/lloadd/test002-load b/tests/scripts/lloadd/test002-load
index 1ecd913266..1477e066cd 100755
--- a/tests/scripts/lloadd/test002-load
+++ b/tests/scripts/lloadd/test002-load
@@ -112,8 +112,14 @@ if test $RC != 0 ; then
fi
echo "Starting lloadd on TCP/IP port $PORT1..."
-. $CONFFILTER $BACKEND < $LLOADDCONF > $CONF1
-$LLOADD -f $CONF1 -h $URI1 -d $LVL > $LOG1 2>&1 &
+. $CONFFILTER $BACKEND < $LLOADDCONF > $CONF1.lloadd
+if test $AC_lloadd = lloaddyes; then
+ $LLOADD -f $CONF1.lloadd -h $URI1 -d $LVL > $LOG1 2>&1 &
+else
+ . $CONFFILTER $BACKEND < $SLAPDLLOADCONF > $CONF1.slapd
+ # FIXME: this won't work on Windows, but lloadd doesn't support Windows yet
+ $SLAPD -f $CONF1.slapd -h $URI6 -d $LVL > $LOG1 2>&1 &
+fi
PID=$!
if test $WAIT != 0 ; then
echo PID $PID