summaryrefslogtreecommitdiff
path: root/source4/lib
diff options
context:
space:
mode:
authorAndrew Tridgell <tridge@samba.org>2004-11-15 00:15:25 +0000
committerGerald (Jerry) Carter <jerry@samba.org>2007-10-10 13:05:49 -0500
commitf7cbd3450b0099cc2b79e786b9a4fe3fdd9594ff (patch)
tree90289ce8b4f588b1e42af2c8bb5caff117abf080 /source4/lib
parent24a40fb41280a9eb22be89699c76eeeb8aab7111 (diff)
downloadsamba-f7cbd3450b0099cc2b79e786b9a4fe3fdd9594ff.tar.gz
samba-f7cbd3450b0099cc2b79e786b9a4fe3fdd9594ff.tar.bz2
samba-f7cbd3450b0099cc2b79e786b9a4fe3fdd9594ff.zip
r3742: make test-ldap give a sane error message when the openldap schema files are missing
and auto-link the files if they are found in /etc/ldap/schema/ (This used to be commit 88b03ffc85d43ac83193a093cdb246794d74c4e4)
Diffstat (limited to 'source4/lib')
-rwxr-xr-xsource4/lib/ldb/tests/test-ldap.sh19
1 files changed, 19 insertions, 0 deletions
diff --git a/source4/lib/ldb/tests/test-ldap.sh b/source4/lib/ldb/tests/test-ldap.sh
index 29b40ff455..3e285a39a9 100755
--- a/source4/lib/ldb/tests/test-ldap.sh
+++ b/source4/lib/ldb/tests/test-ldap.sh
@@ -1,5 +1,24 @@
#!/bin/sh
+SCHEMA_NEEDED="core nis cosine inetorgperson openldap"
+
+# setup needed schema files
+for f in $SCHEMA_NEEDED; do
+ if [ ! -r tests/schema/$f.schema ]; then
+ mkdir -p tests/schema
+ if [ -r /etc/ldap/schema/$f.schema ]; then
+ ln -s /etc/ldap/schema/$f.schema tests/schema/$f.schema
+ continue;
+ fi
+
+ echo "ERROR: you need the following OpenLDAP schema files in tests/schema/"
+ for f in $SCHEMA_NEEDED; do
+ echo " $f.schema"
+ done
+ exit 1
+ fi
+done
+
tests/init_slapd.sh
tests/start_slapd.sh