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:
38
tests/ldap/slapd-init.in
Normal file
38
tests/ldap/slapd-init.in
Normal 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
|
||||
Reference in New Issue
Block a user