]> git.sur5r.net Git - openldap/blob - tests/scripts/test000-rootdse
Grep for PRNG message in $SEARCHOUT to make sure error is caught.
[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 PRNG $SEARCHOUT; then
45             cat << EOF
46
47 You need a pseudo random number generator, such as a /dev/urandom,
48 /dev/urandom, or an entropy gathering daemon.  Alternatively, you
49 can use openssl to generate a $HOME/.rnd file.
50 See www.openssl.org for more details on how to do this.
51 EOF
52         RC=-1
53         else
54             echo ">>>>> Test succeeded"
55         fi
56 fi
57
58
59 exit $RC