summaryrefslogtreecommitdiff
path: root/source4/lib/ldb/tests/init_slapd.sh
diff options
context:
space:
mode:
Diffstat (limited to 'source4/lib/ldb/tests/init_slapd.sh')
-rwxr-xr-xsource4/lib/ldb/tests/init_slapd.sh18
1 files changed, 18 insertions, 0 deletions
diff --git a/source4/lib/ldb/tests/init_slapd.sh b/source4/lib/ldb/tests/init_slapd.sh
index be06ac0d74..8ebfed9c66 100755
--- a/source4/lib/ldb/tests/init_slapd.sh
+++ b/source4/lib/ldb/tests/init_slapd.sh
@@ -19,5 +19,23 @@ fi
# we don't consider a slapadd failure as a test suite failure, as it
# has nothing to do with ldb
+
+MODCONF=tests/tmp/modules.conf
+rm -f $MODCONF
+touch $MODCONF || exit 1
+
+if ! slaptest -u -f $LDBDIR/tests/slapd.conf > /dev/null 2>&1; then
+echo "enabling sladp modules"
+cat > $MODCONF <<EOF
+modulepath /usr/lib/ldap
+moduleload back_bdb
+EOF
+fi
+
+if ! slaptest -u -f $LDBDIR/tests/slapd.conf; then
+ echo "slaptest failed - skipping ldap tests"
+ exit 0
+fi
+
slapadd -f $LDBDIR/tests/slapd.conf < $LDBDIR/tests/init.ldif || exit 0