summaryrefslogtreecommitdiff
path: root/source4/lib/ldb/tests
diff options
context:
space:
mode:
Diffstat (limited to 'source4/lib/ldb/tests')
-rwxr-xr-xsource4/lib/ldb/tests/init_slapd.sh7
-rwxr-xr-xsource4/lib/ldb/tests/start_slapd.sh9
-rwxr-xr-xsource4/lib/ldb/tests/test-generic.sh10
-rwxr-xr-xsource4/lib/ldb/tests/test-ldap.sh13
-rwxr-xr-xsource4/lib/ldb/tests/test-tdb.sh2
5 files changed, 29 insertions, 12 deletions
diff --git a/source4/lib/ldb/tests/init_slapd.sh b/source4/lib/ldb/tests/init_slapd.sh
index fc1ed16a4c..c50ea0ecab 100755
--- a/source4/lib/ldb/tests/init_slapd.sh
+++ b/source4/lib/ldb/tests/init_slapd.sh
@@ -1,5 +1,10 @@
#!/bin/sh
+if [ -z "$LDBDIR" ]; then
+ LDBDIR=`dirname $0`/..
+ export LDBDIR
+fi
+
rm -rf tests/tmp/db
mkdir -p tests/tmp/db
@@ -10,4 +15,4 @@ sleep 2
if pidof slapd > /dev/null; then
killall -9 slapd
fi
-slapadd -f tests/slapd.conf < tests/init.ldif || exit 1
+slapadd -f $LDBDIR/tests/slapd.conf < $LDBDIR/tests/init.ldif || exit 1
diff --git a/source4/lib/ldb/tests/start_slapd.sh b/source4/lib/ldb/tests/start_slapd.sh
index 6dd3eaa9b8..49ce5538f1 100755
--- a/source4/lib/ldb/tests/start_slapd.sh
+++ b/source4/lib/ldb/tests/start_slapd.sh
@@ -1,7 +1,12 @@
#!/bin/sh
-mkdir -p tests/tmp/db
+if [ -z "$LDBDIR" ]; then
+ LDBDIR=`dirname $0`/..
+ export LDBDIR
+fi
-slapd -f tests/slapd.conf -h "`tests/ldapi_url.sh`" $*
+mkdir -p $LDBDIR/tests/tmp/db
+
+slapd -f $LDBDIR/tests/slapd.conf -h "`$LDBDIR/tests/ldapi_url.sh`" $*
sleep 2
diff --git a/source4/lib/ldb/tests/test-generic.sh b/source4/lib/ldb/tests/test-generic.sh
index 3246b7138f..363bf89065 100755
--- a/source4/lib/ldb/tests/test-generic.sh
+++ b/source4/lib/ldb/tests/test-generic.sh
@@ -1,5 +1,9 @@
#!/bin/sh
+if [ -z "$LDB_SPECIALS" ]; then
+ export LDB_SPECIALS=1
+fi
+
echo "LDB_URL: $LDB_URL"
echo "Adding base elements"
@@ -22,8 +26,10 @@ $VALGRIND ldbsearch '(uid=uham)' || exit 1
echo "Starting ldbtest"
time $VALGRIND ldbtest --num-records 100 --num-searches 10 || exit 1
-echo "Adding index"
-$VALGRIND ldbadd $LDBDIR/tests/test-index.ldif || exit 1
+if [ $LDB_SPECIALS = 1 ]; then
+ echo "Adding index"
+ $VALGRIND ldbadd $LDBDIR/tests/test-index.ldif || exit 1
+fi
echo "Adding attributes"
$VALGRIND ldbadd $LDBDIR/tests/test-wrong_attributes.ldif || exit 1
diff --git a/source4/lib/ldb/tests/test-ldap.sh b/source4/lib/ldb/tests/test-ldap.sh
index d9fa73b641..592e09f408 100755
--- a/source4/lib/ldb/tests/test-ldap.sh
+++ b/source4/lib/ldb/tests/test-ldap.sh
@@ -24,17 +24,18 @@ for f in $SCHEMA_NEEDED; do
fi
done
-export LDB_URL=`tests/ldapi_url.sh`
-
-PATH=bin:$PATH
-export PATH
-
if [ -z "$LDBDIR" ]; then
- LDBDIR="."
+ LDBDIR=`dirname $0`/..
export LDBDIR
fi
+export LDB_URL=`$LDBDIR/tests/ldapi_url.sh`
+
+PATH=bin:$PATH
+export PATH
+
. $LDBDIR/tests/init_slapd.sh
. $LDBDIR/tests/start_slapd.sh
+export LDB_SPECIALS=0
. $LDBDIR/tests/test-generic.sh
diff --git a/source4/lib/ldb/tests/test-tdb.sh b/source4/lib/ldb/tests/test-tdb.sh
index c0f9d7b2de..e1052d1651 100755
--- a/source4/lib/ldb/tests/test-tdb.sh
+++ b/source4/lib/ldb/tests/test-tdb.sh
@@ -13,7 +13,7 @@ export PATH
rm -f $LDB_URL*
if [ -z "$LDBDIR" ]; then
- LDBDIR="."
+ LDBDIR=`dirname $0`/..
export LDBDIR
fi