summaryrefslogtreecommitdiff
path: root/source4/lib/ldb/tests/test-ldap.sh
blob: d9fa73b641c22f1b70c12fbdf691c593a51e2cc3 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
#!/bin/sh

export PATH=/usr/local/sbin:/usr/sbin:/sbin:$PATH
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
	if [ -r /etc/openldap/schema/$f.schema ]; then
	    ln -s /etc/openldap/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

export LDB_URL=`tests/ldapi_url.sh`

PATH=bin:$PATH
export PATH

if [ -z "$LDBDIR" ]; then
    LDBDIR="."
    export LDBDIR
fi

. $LDBDIR/tests/init_slapd.sh
. $LDBDIR/tests/start_slapd.sh

. $LDBDIR/tests/test-generic.sh