]> git.sur5r.net Git - openldap/blob - tests/scripts/test000-rootdse
Allow an object class to be provided in an attribute description list,
[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 WAIT=0
14 if test $# -ge 1 ; then
15         WAIT=1; shift
16 fi
17
18 echo "running defines.sh"
19 . $SRCDIR/scripts/defines.sh
20
21 echo "Datadir is $DATADIR"
22
23 echo "Cleaning up in $DBDIR..."
24
25 rm -f $DBDIR/[!C]*
26
27 echo "Starting slapd on TCP/IP port $PORT..."
28 . $CONFFILTER $BACKEND < $SCHEMACONF > $DBCONF
29 $SLAPD -f $DBCONF -h $MASTERURI -d $LVL $TIMING > $MASTERLOG 2>&1 &
30 PID=$!
31 if test $WAIT != 0 ; then
32     echo PID $PID
33     read foo
34 fi
35
36 echo "Using ldapsearch to retrieve all the entries..."
37 for i in 0 1 2 3 4 5; do
38         $LDAPSEARCH -b "" -s base -h localhost:$PORT 'extensibleObject' > $SEARCHOUT 2>&1
39         RC=$?
40         if test $RC = 1 ; then
41                 echo "Waiting 5 seconds for slapd to start..."
42                 sleep 5
43         fi
44 done
45
46 kill -HUP $PID
47
48 cat $SEARCHOUT
49
50 if test $RC != 0 ; then
51         echo ">>>>> Test failed"
52 else
53         if grep "TLS:" $SEARCHOUT; then
54                 RC=-1
55         else
56             echo ">>>>> Test succeeded"
57         fi
58 fi
59
60
61 exit $RC