summaryrefslogtreecommitdiff
path: root/source4/lib
diff options
context:
space:
mode:
authorAndrew Tridgell <tridge@samba.org>2006-09-01 01:51:54 +0000
committerGerald (Jerry) Carter <jerry@samba.org>2007-10-10 14:16:59 -0500
commitf2c083169760db02e267e2ca673e09ff2493931f (patch)
treec6dacdb2d4774b6c33f4f2ded19105064f3b368e /source4/lib
parente117323e2f60868b587cad3e4201df2fe198c9d9 (diff)
downloadsamba-f2c083169760db02e267e2ca673e09ff2493931f.tar.gz
samba-f2c083169760db02e267e2ca673e09ff2493931f.tar.bz2
samba-f2c083169760db02e267e2ca673e09ff2493931f.zip
r17978: make the ldap backend test for ldb work both with and without modules
(so it works on both redhat and debian, for example) (This used to be commit 71264bb78558ada7539ef59048eb38887579c1d1)
Diffstat (limited to 'source4/lib')
-rwxr-xr-xsource4/lib/ldb/tests/init_slapd.sh18
-rw-r--r--source4/lib/ldb/tests/slapd.conf3
2 files changed, 19 insertions, 2 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
diff --git a/source4/lib/ldb/tests/slapd.conf b/source4/lib/ldb/tests/slapd.conf
index fc9d659b0b..fa2789d8c1 100644
--- a/source4/lib/ldb/tests/slapd.conf
+++ b/source4/lib/ldb/tests/slapd.conf
@@ -14,8 +14,7 @@ access to * by * write
allow update_anon bind_anon_dn
-modulepath /usr/lib/ldap
-moduleload back_bdb
+include tests/tmp/modules.conf
defaultsearchbase "o=University of Michigan,c=TEST"