summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rwxr-xr-xsource4/lib/ldb/tests/kill_slapd.sh12
-rwxr-xr-xsource4/lib/ldb/tests/test-ldap.sh18
2 files changed, 26 insertions, 4 deletions
diff --git a/source4/lib/ldb/tests/kill_slapd.sh b/source4/lib/ldb/tests/kill_slapd.sh
new file mode 100755
index 0000000000..91beb10814
--- /dev/null
+++ b/source4/lib/ldb/tests/kill_slapd.sh
@@ -0,0 +1,12 @@
+#!/bin/sh
+
+if [ -z "$LDBDIR" ]; then
+ LDBDIR=`dirname $0`/..
+ export LDBDIR
+fi
+
+if [ -f tests/tmp/slapd.pid ]; then
+ echo "killing slapd process `cat tests/tmp/slapd.pid`"
+ kill -9 `cat tests/tmp/slapd.pid`
+ rm -f tests/tmp/slapd.pid
+fi
diff --git a/source4/lib/ldb/tests/test-ldap.sh b/source4/lib/ldb/tests/test-ldap.sh
index 63e93e0fb0..b9d224e0af 100755
--- a/source4/lib/ldb/tests/test-ldap.sh
+++ b/source4/lib/ldb/tests/test-ldap.sh
@@ -36,9 +36,19 @@ export LDB_URL
PATH=bin:$PATH
export PATH
-. $LDBDIR/tests/init_slapd.sh
-. $LDBDIR/tests/start_slapd.sh
-
LDB_SPECIALS=0
export LDB_SPECIALS
-. $LDBDIR/tests/test-generic.sh
+
+if $LDBDIR/tests/init_slapd.sh &&
+ $LDBDIR/tests/start_slapd.sh &&
+ $LDBDIR/tests/test-generic.sh; then
+ echo "ldap tests passed";
+ ret=0
+else
+ echo "ldap tests failed";
+ ret=$?
+fi
+
+$LDBDIR/tests/kill_slapd.sh
+
+exit $ret