ldap test, inspired from the samba ldb tests

git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@20220 ec53bebd-3082-4978-b11e-865c3cabbd6b
This commit is contained in:
Love Hörnquist Åstrand
2007-02-15 00:11:18 +00:00
parent 393f98a743
commit 3cb07032b9
8 changed files with 292 additions and 0 deletions

38
tests/ldap/slapd-init.in Normal file
View File

@@ -0,0 +1,38 @@
#!/bin/sh
srcdir=@srcdir@
rm -rf db
mkdir db
# kill of old slapd if running
sh ${srcdir}/slapd-stop > /dev/null
SCHEMA_NEEDED="hdb core nis cosine inetorgperson openldap"
SCHEMA_PATHS="${srcdir}/../../lib/hdb /etc/ldap/schema /etc/openldap/schema /private/etc/openldap/schema"
test -d schema || mkdir schema
# setup needed schema files
for f in $SCHEMA_NEEDED; do
if [ ! -r schema/$f.schema ]; then
for d in $SCHEMA_PATHS ; do
if [ -r $d/$f.schema ] ; then
cp $d/$f.schema schema/$f.schema
continue 2
fi
done
echo "SKIPPING TESTS: you need the following schema file: $f.schema"
exit 1
fi
done
touch modules.conf || exit 1
slapadd -f ${srcdir}/slapd.conf < ${srcdir}/init.ldif || exit 0
echo "starting slapd"
slapd -d0 -f ${srcdir}/slapd.conf -h ldapi://.%2Fldap-socket &
sleep 4