]> git.sur5r.net Git - openldap/blob - tests/scripts/test000-rootdse
Fix last commit
[openldap] / tests / scripts / test000-rootdse
1 #! /bin/sh
2 # $OpenLDAP$
3
4 echo "running defines.sh"
5 . $SRCDIR/scripts/defines.sh
6
7 mkdir -p $TESTRUN $DBDIR1
8
9 echo "Starting slapd on TCP/IP port $PORT1..."
10 . $CONFFILTER $BACKEND $MONITORDB < $SCHEMACONF > $CONF1
11 $SLAPD -f $CONF1 -h $URI1 -d $LVL $TIMING > $LOG1 2>&1 &
12 PID=$!
13 if test $WAIT != 0 ; then
14     echo PID $PID
15     read foo
16 fi
17 KILLPIDS="$PID"
18
19 echo "Using ldapsearch to retrieve the root DSE..."
20 for i in 0 1 2 3 4 5; do
21         $LDAPSEARCH -b "" -s base -h $LOCALHOST -p $PORT1 '+extensibleObject' > $SEARCHOUT 2>&1
22         RC=$?
23         if test $RC = 0 ; then
24                 break
25         fi
26         echo "Waiting 5 seconds for slapd to start..."
27         sleep 5
28 done
29
30 if test $RC = 0 -a $MONITORDB = yes ; then
31         echo "Using ldapsearch to retrieve the cn=Monitor..."
32         $LDAPSEARCH -b "cn=Monitor" -s base -h $LOCALHOST -p $PORT1 '+extensibleObject' >> $SEARCHOUT 2>&1
33         RC=$?
34 fi
35
36 test $KILLSERVERS != no && kill -HUP $KILLPIDS
37
38 cat $SEARCHOUT
39
40 if test $RC != 0 ; then
41         echo ">>>>> Test failed"
42 else
43         if grep "TLS:" $SEARCHOUT; then
44                 RC=-1
45         else
46             echo ">>>>> Test succeeded"
47         fi
48 fi
49
50 exit $RC