3 ## This work is part of OpenLDAP Software <http://www.openldap.org/>.
5 ## Copyright 1998-2005 The OpenLDAP Foundation.
6 ## All rights reserved.
8 ## Redistribution and use in source and binary forms, with or without
9 ## modification, are permitted only as authorized by the OpenLDAP
12 ## A copy of this license is available in the file LICENSE in the
13 ## top-level directory of the distribution or, alternatively, at
14 ## <http://www.OpenLDAP.org/license.html>.
16 echo "running defines.sh"
17 . $SRCDIR/scripts/defines.sh
19 if test $RETCODE = retcodeno; then
20 echo "Retcode overlay not available, test skipped"
24 mkdir -p $TESTDIR $DBDIR1
26 echo "Running slapadd to build slapd database..."
27 . $CONFFILTER $BACKEND $MONITORDB < $MCONF > $ADDCONF
28 $SLAPADD -f $ADDCONF -l $LDIFORDERED
30 if test $RC != 0 ; then
31 echo "slapadd failed ($RC)!"
35 echo "Running slapindex to index slapd database..."
36 . $CONFFILTER $BACKEND $MONITORDB < $RETCODECONF > $CONF1
39 if test $RC != 0 ; then
40 echo "warning: slapindex failed ($RC)"
41 echo " assuming no indexing support"
44 echo "Starting slapd on TCP/IP port $PORT1..."
45 $SLAPD -f $CONF1 -h $URI1 -d $LVL $TIMING > $LOG1 2>&1 &
47 if test $WAIT != 0 ; then
53 echo "Testing slapd searching..."
54 for i in 0 1 2 3 4 5; do
55 $LDAPSEARCH -s base -b "$MONITOR" -h $LOCALHOST -p $PORT1 \
56 '(objectclass=*)' > /dev/null 2>&1
58 if test $RC = 0 ; then
61 echo "Waiting 5 seconds for slapd to start..."
65 if test $RC != 0 ; then
66 echo "ldapsearch failed ($RC)!"
67 test $KILLSERVERS != no && kill -HUP $KILLPIDS
71 echo "Testing searching for timelimitExceeded..."
72 $LDAPSEARCH -b "cn=timelimitExceeded,ou=RetCodes,$BASEDN" \
73 -h $LOCALHOST -p $PORT1 '(objectClass=*)' >> $TESTOUT 2>&1
75 if test $RC != 3 ; then
76 echo "ldapsearch failed ($RC)!"
77 test $KILLSERVERS != no && kill -HUP $KILLPIDS
81 echo "Testing modifying for unwillingToPerform..."
82 $LDAPMODIFY -D "$MANAGERDN" -w $PASSWD \
83 -h $LOCALHOST -p $PORT1 >> $TESTOUT 2>&1 << EOMODS
84 dn: cn=unwillingToPerform,ou=RetCodes,$BASEDN
88 if test $RC != 53 ; then
89 echo "ldapmodify failed ($RC)!"
90 test $KILLSERVERS != no && kill -HUP $KILLPIDS
94 test $KILLSERVERS != no && kill -HUP $KILLPIDS
96 echo ">>>>> Test succeeded"