]> git.sur5r.net Git - openldap/blob - tests/scripts/test000-rootdse
Hack test environment to support multiple backends using
[openldap] / tests / scripts / test000-rootdse
1 #! /bin/sh
2 # $OpenLDAP$
3
4 SRCDIR="."
5 if test $# -ge 1 ; then
6         SRCDIR=$1; shift
7 fi
8 BACKEND=ldbm
9 if test $# -ge 1 ; then
10         BACKEND=$1; shift
11 fi
12
13 echo "running defines.sh"
14 . $SRCDIR/scripts/defines.sh
15
16 echo "Datadir is $DATADIR"
17
18 echo "Cleaning up in $DBDIR..."
19
20 rm -f $DBDIR/[!C]*
21
22 echo "Starting slapd on TCP/IP port $PORT..."
23 . $CONFFILTER $BACKEND < $SCHEMACONF > $DBCONF
24 $SLAPD -f $DBCONF -h $MASTERURI -d $LVL $TIMING > $MASTERLOG 2>&1 &
25 PID=$!
26
27 echo "Using ldapsearch to retrieve all the entries..."
28 for i in 0 1 2 3 4 5; do
29         $LDAPSEARCH -b "" -s base -h localhost:$PORT '+' > $SEARCHOUT 2>&1
30         RC=$?
31         if test $RC = 1 ; then
32                 echo "Waiting 5 seconds for slapd to start..."
33                 sleep 5
34         fi
35 done
36
37 kill -HUP $PID
38
39 cat $SEARCHOUT
40
41 if test $RC != 0 ; then
42         echo ">>>>> Test failed"
43 else
44         if grep "TLS:" $SEARCHOUT; then
45                 RC=-1
46         else
47             echo ">>>>> Test succeeded"
48         fi
49 fi
50
51
52 exit $RC