4 echo "running defines.sh"
5 . $SRCDIR/scripts/defines.sh
7 mkdir -p $TESTDIR $DBDIR1
9 echo "Starting slapd on TCP/IP port $PORT..."
10 . $CONFFILTER $BACKEND $MONITORDB < $PWCONF > $CONF1
11 $SLAPD -f $CONF1 -h $URI1 -d $LVL $TIMING > $LOG1 2>&1 &
13 if test $WAIT != 0 ; then
19 echo "Using ldapsearch to check that slapd is running..."
20 for i in 0 1 2 3 4 5; do
21 $LDAPSEARCH -s base -b "$MONITOR" -h $LOCALHOST -p $PORT1 \
22 'objectclass=*' > /dev/null 2>&1
24 if test $RC = 0 ; then
27 echo "Waiting 5 seconds for slapd to start..."
31 echo "Testing ldapwhoami as anonymous..."
32 $LDAPWHOAMI -h $LOCALHOST -p $PORT1
35 if test $RC != 0 ; then
36 echo "ldapwhoami failed ($RC)!"
37 test $KILLSERVERS != no && kill -HUP $KILLPIDS
41 echo "Testing ldapwhoami as ${MANAGERDN}..."
42 $LDAPWHOAMI -h $LOCALHOST -p $PORT1 -D "$MANAGERDN" -w $PASSWD
45 if test $RC != 0 ; then
46 echo "ldapwhoami failed ($RC)!"
47 test $KILLSERVERS != no && kill -HUP $KILLPIDS
51 echo "Testing ldapwhoami as ${MANAGERDN} for anonymous..."
52 $LDAPWHOAMI -h $LOCALHOST -p $PORT1 -D "$MANAGERDN" -w $PASSWD \
56 if test $RC != 0 ; then
57 echo "ldapwhoami failed ($RC)!"
58 test $KILLSERVERS != no && kill -HUP $KILLPIDS
62 echo "Testing ldapwhoami as ${MANAGERDN} for dn:$BABSDN..."
63 $LDAPWHOAMI -h $LOCALHOST -p $PORT1 -D "$MANAGERDN" -w $PASSWD \
64 -e \!authzid="dn:$BABSDN"
67 if test $RC != 0 ; then
68 echo "ldapwhoami failed ($RC)!"
69 test $KILLSERVERS != no && kill -HUP $KILLPIDS
73 echo "Testing ldapwhoami as ${MANAGERDN} for u:ursula..."
74 $LDAPWHOAMI -h $LOCALHOST -p $PORT1 -D "$MANAGERDN" -w $PASSWD \
75 -e \!authzid="u:ursula"
78 if test $RC != 0 ; then
79 echo "ldapwhoami failed ($RC)!"
80 test $KILLSERVERS != no && kill -HUP $KILLPIDS
84 test $KILLSERVERS != no && kill -HUP $KILLPIDS
86 echo ">>>>> Test succeeded"