]> git.sur5r.net Git - openldap/blob - tests/scripts/test000-rootdse
3f7a0e89fa3dfa952661be1133dbb3a95c01c2eb
[openldap] / tests / scripts / test000-rootdse
1 #! /bin/sh
2 # $OpenLDAP$
3
4 if test $# -eq 0 ; then
5         SRCDIR="."
6 else
7         SRCDIR=$1; shift
8 fi
9 if test $# -eq 1 ; then
10         BACKEND=$1; shift
11 fi
12
13 echo "running defines.sh $SRCDIR $BACKEND"
14
15 . $SRCDIR/scripts/defines.sh
16
17 echo "Datadir is $DATADIR"
18
19 echo "Cleaning up in $DBDIR..."
20
21 rm -f $DBDIR/[!C]*
22
23 echo "Starting slapd on TCP/IP port $PORT..."
24 $SLAPD -f $CONF -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