and auto-link the files if they are found in /etc/ldap/schema/
#!/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