Update tests to support lloadd as a module

This commit is contained in:
Ondřej Kuzník 2018-01-24 17:48:29 +00:00
parent 7a69017f6f
commit 9baa56adc2
8 changed files with 63 additions and 7 deletions

View File

@ -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"

View File

@ -0,0 +1,33 @@
# stand-alone slapd config -- for testing (with indexing)
# $OpenLDAP$
## This work is part of OpenLDAP Software <http://www.openldap.org/>.
##
## 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
## <http://www.OpenLDAP.org/license.html>.
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

View File

@ -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 <backend> (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

View File

@ -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}#//" \

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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