5 if test $# -ge 1 ; then
9 if test $# -ge 1 ; then
13 if test $# -ge 1 ; then
17 if test $# -ge 1 ; then
21 echo "running defines.sh"
22 . $SRCDIR/scripts/defines.sh
24 echo "Cleaning up in $DBDIR..."
28 echo "Starting slapd on TCP/IP port $PORT..."
29 . $CONFFILTER $BACKEND $MONITORDB < $PWCONF > $DBCONF
30 $SLAPD -f $DBCONF -h $MASTERURI -d $LVL $TIMING > $MASTERLOG 2>&1 &
32 if test $WAIT != 0 ; then
37 echo "Using ldapsearch to check that slapd is running..."
38 for i in 0 1 2 3 4 5; do
39 $LDAPSEARCH -s base -b "$MONITOR" -h $LOCALHOST -p $PORT \
40 'objectclass=*' > /dev/null 2>&1
42 if test $RC = 0 ; then
45 echo "Waiting 5 seconds for slapd to start..."
49 echo "Testing ldapwhoami as anonymous..."
50 $LDAPWHOAMI -h $LOCALHOST -p $PORT
53 if test $RC != 0 ; then
54 echo "ldapwhoami failed ($RC)!"
59 echo "Testing ldapwhoami as ${MANAGERDN}..."
60 $LDAPWHOAMI -h $LOCALHOST -p $PORT -D "$MANAGERDN" -w $PASSWD
63 if test $RC != 0 ; then
64 echo "ldapwhoami failed ($RC)!"
69 echo "Testing ldapwhoami as ${MANAGERDN} for anonymous..."
70 $LDAPWHOAMI -h $LOCALHOST -p $PORT -D "$MANAGERDN" -w $PASSWD \
74 if test $RC != 0 ; then
75 echo "ldapwhoami failed ($RC)!"
80 echo "Testing ldapwhoami as ${MANAGERDN} for dn:$BABSDN..."
81 $LDAPWHOAMI -h $LOCALHOST -p $PORT -D "$MANAGERDN" -w $PASSWD \
82 -e \!authzid="dn:$BABSDN"
85 if test $RC != 0 ; then
86 echo "ldapwhoami failed ($RC)!"
91 echo "Testing ldapwhoami as ${MANAGERDN} for u:ursula..."
92 $LDAPWHOAMI -h $LOCALHOST -p $PORT -D "$MANAGERDN" -w $PASSWD \
93 -e \!authzid="u:ursula"
96 if test $RC != 0 ; then
97 echo "ldapwhoami failed ($RC)!"
104 echo ">>>>> Test succeeded"