From f7cbd3450b0099cc2b79e786b9a4fe3fdd9594ff Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Mon, 15 Nov 2004 00:15:25 +0000 Subject: 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) --- source4/lib/ldb/tests/test-ldap.sh | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) (limited to 'source4/lib/ldb') 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 -- cgit