]> git.ipfire.org Git - thirdparty/openldap.git/commitdiff
Update tests to support lloadd as a module
authorOndřej Kuzník <okuznik@symas.com>
Wed, 24 Jan 2018 17:48:29 +0000 (17:48 +0000)
committerOndřej Kuzník <okuznik@symas.com>
Tue, 17 Nov 2020 17:58:14 +0000 (17:58 +0000)
tests/Makefile.in
tests/data/slapd-lload.conf [new file with mode: 0644]
tests/run.in
tests/scripts/conf.sh
tests/scripts/defines.sh
tests/scripts/lloadd/test000-rootdse
tests/scripts/lloadd/test001-backend-issues
tests/scripts/lloadd/test002-load

index b4c42571fac3b365758d509473a83c4ad1c2a1b1..57a782792a6102249a8af4d7a5749b358ad81be7 100644 (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"
diff --git a/tests/data/slapd-lload.conf b/tests/data/slapd-lload.conf
new file mode 100644 (file)
index 0000000..8ac942a
--- /dev/null
@@ -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
index 98119b78e6f8505fbe83cc36322cf8a52c1c4826..5bdaa1b535f1625fd084a75c64ce7a79dbd74d5b 100644 (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
 
index 2e66e7715b0bf651e274f93b863a8263a2f0cdc1..7b49c523db80fb1edb328de3c1d9007f6627c004 100755 (executable)
@@ -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}#//"                             \
index 8dcd84615781124461bba14b18e120f11938024f..61ac0798a53c18afcccf8d3476596d39ad205a0f 100755 (executable)
@@ -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
index c20e9990691ecfa72f730522c0d55f93030641cb..ddbd39e54a5a06196233111447694084e12c0288 100755 (executable)
@@ -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
index c940ecde1beb5cf2aa2ded104b571e9d48349bb4..93737a35f58e4fd7442328f5ff1c439d86bc13a0 100755 (executable)
@@ -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
index 1ecd913266cc510f11144b1cdf2aba2ce9ac5a8b..1477e066cdff85c512d3509e2cbdc823ab773c5d 100755 (executable)
@@ -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